AVR223: Digital Filters with AVR - Atmel Corporation
AVR223: Digital Filters with AVR - Atmel Corporation
AVR223: Digital Filters with AVR - Atmel Corporation
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
2527B-<strong>AVR</strong>-07/08<br />
<strong><strong>AVR</strong>223</strong><br />
When all data and coefficients are Multiplied-and-Accumulated (MAC) and the filter<br />
node FIFO buffers are updated, the result is finally scaled down and returned. Note<br />
that the result in the accumulator is downscaled before it is stored in the y[n-1] FIFO<br />
buffer element. A data flow chart is shown in Figure 4-4.<br />
Figure 4-4: Generic IIR Filter Algorithm.<br />
NO<br />
YES<br />
k == N?<br />
NO<br />
Load node<br />
x[n-k].<br />
Load<br />
coefficient<br />
bk.<br />
MUL.<br />
k = N<br />
k = k - 1<br />
k < 0?<br />
Load node<br />
x[n-k].<br />
Load<br />
coefficient<br />
bk.<br />
Store node<br />
x[n-k] in<br />
x[n-k-1]<br />
MAC.<br />
YES<br />
k = N<br />
Load node<br />
y[n-k].<br />
Load<br />
coefficient<br />
ak.<br />
MAC.<br />
k = k - 1<br />
k < 1?<br />
YES<br />
Downscale<br />
result.<br />
Store node<br />
y[n] in<br />
y[n-1].<br />
Return<br />
output.<br />
Store node<br />
y[n-k] in<br />
y[n-k-1].<br />
NO<br />
15