How to plot 2 data graph use freqz

16 次查看(过去 30 天)
Mano Moritani
Mano Moritani 2021-5-21
回答: Naoya 2021-5-24
I want to plot 2 date.
when I use " hold" can to plot 2 data at only Magnitude-Frequency.
i want to ploto 2 them at Degree-Frequency.
------code------
freqz(h1,1)
hold on
freqz(h2,1)
legend(LEG_NAME1,LEG_NAME2,'Location',LEG_LOCATION);
set(legend,'Fontname','Times New Roman','Fontsize',LEG_FSIZE,'EdgeColor','k','LineWidth',OUTLINE_WIDTH);
hold off

回答(1 个)

Naoya
Naoya 2021-5-24
% freqz を hold on して重ね描きされる際は、以下の様に freqz に戻り値を付けていただきますと、振幅/位相応答共に重ね表示することができます。
% 2種類のFIRフィルタの周波数応答データを取得
[H1,W1] = freqz(rand(1,5),1);
[H2,W2] = freqz(rand(1,5),1);
% 振幅表示
subplot(2,1,1)
plot(W1, 20*log10(abs(H1)))
hold on
plot(W2, 20*log10(abs(H2)))
% 位相表示
subplot(212)
plot(W1, unwrap(angle(H1))*180/pi)
hold on
plot(W2, unwrap(angle(H2))*180/pi)

类别

Help CenterFile Exchange 中查找有关 Vector Fields 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by