Hi All,
I have a beginner-esqe question: all of my DSP literature shows the
IIR Difference Equation as:
y(n) = b(0)x(n) + b(1)x(n-1) + b(2)x(n-2) + ... + a(1)y(n-1) +
a(2)y(n-2) + ...
But then the C code implementations I see are something along the
lines:
FeedForwardVariable = (b[0] * x[n]) + (b[1] * x[n-1]) + (b[2] *
x[n-2]);
FeedBackwardVariable = (a[1] * y[n-1]) + (a[2] * y[n-2]) + (a[3] *
y[n-3]);
ResultVariable = FeedForwardVariable - FeedBackwardVariable;
The implementation uses a subtraction operation on the feed back
calculations that I don't see in the Difference Equation. Why is that?
I realize I'm setting myself up for a "Duh!!", but I'm really confused
why this is the case.
Thanks much,
Ben
|
|
0
|
|
|
|
Reply
|
stocksb (22)
|
7/10/2003 7:25:13 PM |
|
"Benjamin M. Stocks" <stocksb@ieee.org> wrote in message
news:132e56ad.0307101125.17d67c7e@posting.google.com...
> Hi All,
> I have a beginner-esqe question: all of my DSP literature shows the
> IIR Difference Equation as:
> y(n) = b(0)x(n) + b(1)x(n-1) + b(2)x(n-2) + ... + a(1)y(n-1) +
> a(2)y(n-2) + ...
>
> But then the C code implementations I see are something along the
> lines:
> FeedForwardVariable = (b[0] * x[n]) + (b[1] * x[n-1]) + (b[2] *
> x[n-2]);
> FeedBackwardVariable = (a[1] * y[n-1]) + (a[2] * y[n-2]) + (a[3] *
> y[n-3]);
> ResultVariable = FeedForwardVariable - FeedBackwardVariable;
>
> The implementation uses a subtraction operation on the feed back
> calculations that I don't see in the Difference Equation. Why is that?
>
> I realize I'm setting myself up for a "Duh!!", but I'm really confused
> why this is the case.
>
> Thanks much,
>
> Ben
y(n) = b(0)x(n) + b(1)x(n-1) + b(2)x(n-2) + ... - [a(1)y(n-1) + a(2)y(n-2) +
....]
n.b^
or
y(n) = b(0)x(n) + b(1)x(n-1) + b(2)x(n-2) + ... -a(1)y(n-1) -
a(2)y(n-2) - ...
is the normal expression for the difference equation.
Fred
|
|
0
|
|
|
|
Reply
|
Fred
|
7/10/2003 8:25:02 PM
|
|