Direct form 2 iir filter
显示 更早的评论
I am trying to write a code for implementing a direct form 2 based iir filter (without using the filter command), the problem is that i am confused about the intermediate variable (let's call it "w"), isn't "w" just a delayed version of x (x being the input signal), if not, could you help clarify the doubt of how to fill up the intermediate variable i.e "w".

These are the two equations i use to implement the IIR filter in direct form 2, where "b" and "a" represent the filter coeffecients pertaining to the numerator and the denominator of the transfer function.
i went through your function file as well, it works just fine, but i am having a hard time understanding the role of "w(n)".
1 个评论
If I guess, that your a is defined such, that a(0) is set to 1, your w is the vector of the last M+1 elements of the input scaled by a.
It might get clear, if you write down the equations for a specific |M| and a, b. Then the equivalence between these two equations and the Direct Form II approach in my code gets visible. See this form also:
N M
y(n) = - SUM a(k+1) y(n-k) + SUM b(k+1) x(n-k) for 1<=n<=length(x)
k=1 k=0
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Smoothing and Denoising 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!