matlab - Difference between bode and freqz -
i creating filter in matlab so:
[num,den] = ellip(10,0.1,50,4000/22050,'high');
using freqz found frequency response of filter so:
freqz(num,den)
this produces expected high pass filter plot. however, if try plot same set of values using bode function entirely different.
bode(tr(num,den))
this produces low pass filter plot. not understanding how these functions work? understanding freqz took coefficients of transfer function arguments. doing bode function.
why difference?
[b,a] = ellip(n,rp,rs,wp)
where b,a
z-domain representatives,
while tf
default s-domain:
you can use filt
instead,
[b,a] = ellip(10,0.1,50,4000/22050,'high'); freqz(b,a) figure bode(filt(b,a))
you can use bode(tf(b,a,-1,'variable','z^-1'))
.
check variable property
tf
.
string specifying transfer function display variable. variable can take following values:
's' — default continuous-time models
'z' — default discrete-time models
'p' — equivalent 's'
'q' — equivalent 'z'
'z^-1' — inverse of 'z'
'q^-1' — equivalent 'z^-1'
Comments
Post a Comment