MATLAB: Numerator and denominator coefficients from designfilt function

digital signal processingfilter design

I am designing an lowpass IIR filter using designfilt function. I found coefficients for the filter which is 9×6 Double. Now, how can I find numerator and denominator from this?

Best Answer

The type of coefficients you encounter are called Second order section coefficients. Second-order section coefficients, specified as a matrix. sos is a K-by-6 matrix, where the number of sections, K, must be greater than or equal to 2. If the number of sections is less than 2, the function treats the input as a numerator vector. Each row of sos corresponds to the coefficients of a second-order (biquad) filter. The ith row of sos corresponds to [bi(1) bi(2) bi(3) ai(1) ai(2) ai(3)].
%Create a filter object using designfilt
filterObj = designfilt('lowpassiir', 'PassbandFrequency', .45, 'StopbandFrequency', .55, 'PassbandRipple', 1, 'StopbandAttenuation', 60);
%Convert the second order section coefficients to tranfer function format
[b,a] = sos2tf(filterObj.Coefficients);
%Here b is the numerator and a is the denominator
Related Question