DSP Format Discrete Transfer Function Matlab

1 vue (au cours des 30 derniers jours)
Si Bennett
Si Bennett le 28 Jan 2022
Réponse apportée : Paul le 28 Jan 2022
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

Réponse acceptée

Paul
Paul le 28 Jan 2022
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)

Plus de réponses (0)

Catégories

En savoir plus sur Dynamic System Models dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by