How to plot 2 data graph use freqz
7 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (1 件)
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)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Color and Styling についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!