DSP Format Discrete Transfer Function Matlab

3 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Filter Analysis 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by