How to calculate IIR coefficient from filterDesigner

50 次查看(过去 30 天)
Hi i am newbie and i am using filterDesiner command to generate an IIR filter. After finishing design filter with Filter Designer window, my result is as below:
And i generated a header C code file and my result is as below:
And i do not know how to convert my result to the coefficient i need. My coefficient i need is the coefficient in the equatation:
y(n) = b0*x(n) + b1*x(n-1) ... + bM*x(n-M) - a1*y(n-1) - ... - aN*y(n-M)
I need a table of [b0 .... bM] and [a1 ... aM].

回答(2 个)

Sriram Tadavarty
Sriram Tadavarty 2020-3-23
Hi Thanah,
To export the filiter coefficients, you can try the following as suggested here https://www.mathworks.com/help/signal/examples/introduction-to-filter-designer.html#FDAToolExample-8
Hope this helps.
Regards,
Sriram
  2 个评论
thanh nguyen
thanh nguyen 2020-3-24
I have tried as your link, but when i choose export coefficient, the result still is a array same as the resuld, which i posted in my question. You can see it in the below picture:
I know that i can calculate the coefficient, which i export from matlab is an other fomat of coefficient in the equatation:
y(n) = b0*x(n) + b1*x(n-1) ... + bM*x(n-M) - a1*y(n-1) - ... - aN*y(n-M)
And i can convert the result of matlab to my expected coefficient, but i do know how. I have try another software to design filter and in the result i could receive my expected fomat coefficient. If could please expain me about the coefficient result of matlab.
Sriram Tadavarty
Sriram Tadavarty 2020-3-24
编辑:Sriram Tadavarty 2020-3-24
Hi,
You are right. For the IIR filter, the coefficients you get is in the form of SOS and G. To convert those in to filter numerator and denominator, you can try sos2tf function, which provides the required coefficients.
Hope this helps.
Regards,
Sriram

请先登录,再进行评论。


James Pollard
James Pollard 2021-11-10
Hi Thanh,
If you haven't already solved this problem by now, please see attached an Arduino library I wrote, which takes the outputted 'fdacoefs.h' file and realises it into an IIR filter.
If you study the fdacoefs.h file, you will notice that the 'num' array holds the B matrix coefficients and, likewise, the 'den' array holds both the A and S matrix coefficients.
If you realise this into simulink, you will find a block model of how these values are used. If this doesn't fit your equation model, then you should be able to adapt it.

类别

Help CenterFile Exchange 中查找有关 Digital and Analog Filters 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by