Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Extracting filter coefficients from filter design using "designfilt"

75 views
Skip to first unread message

Branko Celler

unread,
Jun 3, 2016, 8:36:09 PM6/3/16
to
USING MATLAB 2016B

% Design 10th order Elliptic filter
% designfilt Designs a DIGITAL Filter
d = designfilt('bandpassiir','FilterOrder',20, ...
'PassbandFrequency1',0.15,'PassbandFrequency2',0.6, ...
'PassbandRipple',1, ...
'StopbandAttenuation1',60,'StopbandAttenuation2',60, ...
'SampleRate',fs);
% BELOW WORKS
fvtool(d)
freqz(d)
filtfilt(d,data)

% Attempting to extract Numerator and Denominator coefficients
% this does NOT work! WHY NOT??
[numz,denz] = tf(d);
freqz(numz,denz);
filtfilt(numz,denz,data);

How else do I extract Numerator and Denominator coefficients of my filter design?
I don't understand why the above does not work!!

Georgios

unread,
Jun 5, 2016, 3:02:09 PM6/5/16
to
"Branko Celler" <b.ce...@unsw.edu.au> wrote in message <nit7pj$f5d$1...@newscl01ah.mathworks.com>...
Using Matlab R2016a (2016b is not officially released), I executed your code, after substituting a value for fs, "SampleRate'.

The command
> [numz,denz] = tf(d);
worked just fine. There is a semicolon at the end, so you will not see anything after execution. If you remove the semicolon, you will see numz and denz column vectors.

Regards,
Georgios
0 new messages