DSP Format Discrete Transfer Function Matlab

1 回表示 (過去 30 日間)
Si Bennett
Si Bennett 2022 年 1 月 28 日
回答済み: Paul 2022 年 1 月 28 日
Hi,
If I have a discrete transfer function, defined using sys = filt(num,den)
In Matlab, how to I plot the response of the filter.
Can freqz be used? If so, how do I pass the filt(num,den) to freqz to obtain the bode diagram?
Thank you

採用された回答

Paul
Paul 2022 年 1 月 28 日
You can use freqz() if you want, Because filt() returns a tf object from the Control System Toolbox, bode() or bodeplot() functions in that toolbox can also be used
num = [1 2];
den = [1 2 3 4];
sys = filt(num,den);
w = logspace(-2,pi,100);
[m,p] = bode(sys,w);
figure
subplot(211);
semilogx(w,db(squeeze(m)));
subplot(212)
semilogx(w,180/pi*angle(exp(1j*squeeze(p*pi/180))))
h = freqz(sys.num{:},sys.den{:},w);
figure;
subplot(211);
semilogx(w,db(abs(h)));
subplot(212);
semilogx(w,angle(h)*180/pi)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFilter Analysis についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by