How to plot 2 data graph use freqz

15 visualizaciones (últimos 30 días)
Mano Moritani
Mano Moritani el 21 de Mayo de 2021
Respondida: Naoya el 24 de Mayo de 2021
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

Respuestas (1)

Naoya
Naoya el 24 de Mayo de 2021
% 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)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by