Digital Signal Processing Reference
In-Depth Information
The first command finds the roots of the numerator and the denominator (zeros and
poles). The second command converts the resulting floating-point coefficients into
a format for implementation as second-order sections. The third command scales
these coefficients for a fixed-point implementation. The resulting numerator and
denominator coefficients should be listed as
27940 -10910 27940 32768 -11417 25710
.
.
.
32768 -14239 32768 32768 -15258 32584
These 30 coefficients represent the numerator coefficients a 0 , a 1 , and a 2 and the
denominator coefficients b 0 , b 1 , and b 2 . They represent six coefficients per stage, with
b 0 normalized to 1 and scaled by 2 15
=
32,768.
FDATool
Figure D.3 b shows the corresponding FDATool window for the design of the same
IIR bandstop filter. Note that a 10th order is specified with FDATool. Export the
coefficients to the workspace as bs1750. Within the workspace, type bs1750 to
obtain the coefficients in a float format. These coefficients can be scaled into a 16-
or 32-bit integer format.
The coefficients using SPTool are contained in the file bs1750.cof , listed in
Figure D.4 and used in Example 5.1. Figure D.4 shows 25 coefficients (in lieu of 30).
Since the coefficient b 0 is always normalized to 1, it is not used in the program. Note
//bs1750.cof IIR bandstop coefficient file, centered at 1,750 Hz
#define stages 5
//number of 2nd-order stages
int a[stages][3]=
{
//numerator coefficients
{27940, -10910, 27940},
//a10, a11, a12 for 1st stage
{32768, -11841, 32768},
//a20, a21, a22 for 2nd stage
{32768, -13744, 32768},
//a30, a31, a32 for 3rd stage
{32768, -11338, 32768},
//a40, a41, a42 for 4th stage
{32768, -14239, 32768} };
int b[stages][2]= { //*denominator coefficients
{-11417, 25710}, //b11, b12 for 1st stage
{-9204, 31581}, //b21, b22 for 2nd stage
{-15860, 31605}, //b31, b32 for 3rd stage
{-10221, 32581}, //b41, b42 for 4th stage
{-15258, 32584} }; //b51, b52 for 5th stage
FIGURE D.4. Coefficient file for an IIR bandstop filter centered at 1750 Hz designed using
MATLAB's filter designer SPTool ( BS1750.cof ).
Search WWH ::




Custom Search