
80 CHAPTER 4. IIR DIGITAL FILTERS
Listing 4.2: Brute-force IIR filter declarations.
#d e f i n e N1 // filter order
2
float B [ N +1] = {1.0 , −1.0}; // numerator filter coefficients
4 float A [ N +1] = {1.0 , −0.9}; // denominator filter coefficients
float x [ N +1]; // input values
6 float y [ N +1]; // output values
The code shown below performs the actual filtering operation. The four main steps
involved in this operation will be discussed following the code listing.
Listing 4.3: Brute-force IIR filtering for real-time.
/* I added my routine here */
2 x [0] = CodecDataIn . Channel [ LEFT ]; // current input value
4 y [0] = −A [1]∗ y [1] + B [0]∗ x [0]