필터 지우기
필터 지우기

How to plot 2 data graph use freqz

조회 수: 6 (최근 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