numerator and denominator coefficients from designfilt function

40 ビュー (過去 30 日間)
Rohit Mallampati
Rohit Mallampati 2020 年 7 月 13 日
回答済み: Peter Bode 2021 年 3 月 1 日
I am designing an lowpass IIR filter using designfilt function. I found coefficients for the filter which is 9x6 Double. Now, how can I find numerator and denominator from this?

採用された回答

Nipun Katyal
Nipun Katyal 2020 年 7 月 15 日
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
  2 件のコメント
Rohit Mallampati
Rohit Mallampati 2020 年 7 月 15 日
Thanks Nipun
John Gauci
John Gauci 2021 年 2 月 1 日
This does not always work. For example:
filterObj2 = designfilt('lowpassiir', 'PassbandFrequency', 0.02, 'StopbandFrequency', 0.04, 'PassbandRipple', 1, 'StopbandAttenuation', 60);
fvtool(filterObj2);
[b,a] = sos2tf(filterObj2.Coefficients);
fvtool(b,a);
shows two very different filter reponses, the second being drastically wrong and which gets worse the closer the stop band gets to the pass band.
Is there another way of getting the coefficients from designfilt?

サインインしてコメントする。

その他の回答 (1 件)

Peter Bode
Peter Bode 2021 年 3 月 1 日
Do Mathworks stiil support the legacy filter design functions which have been proven useful for decades?

カテゴリ

Help Center および File ExchangeDigital Filter Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by