Digital Signal Processing Reference
In-Depth Information
//
bp55.cof
Coefficients for FIR bandpass filter centered @ Fs/4
#define N 55
//number of coefficients
float h[N]=
{1.7619E-017, 7.0567E-003, 2.2150E-018,-1.0962E-002, 4.0310E-017,
1.3946E-002, 7.1787E-018,-1.4588E-002, 3.9928E-017, 1.1474E-002,
5.9881E-018,-3.5159E-003,-6.6174E-018,-9.7476E-003,-1.7919E-017,
2.7932E-002,-9.4329E-017,-4.9740E-002, 3.3834E-017, 7.3066E-002,
-3.6228E-017,-9.5284E-002, 3.2194E-017, 1.1365E-001,-2.2165E-017,
-1.2576E-001, 7.8980E-018, 1.3000E-001, 7.8980E-018,-1.2576E-001,
-2.2165E-017, 1.1365E-001, 3.2194E-017,-9.5284E-002,-3.6228E-017,
7.3066E-002, 3.3834E-017,-4.9740E-002,-9.4329E-017, 2.7932E-002,
-1.7919E-017,-9.7476E-003,-6.6174E-018,-3.5159E-003, 5.9881E-018,
1.1474E-002, 3.9928E-017,-1.4588E-002, 7.1787E-018, 1.3946E-002,
4.0310E-017,-1.0962E-002, 2.2150E-018, 7.0567E-003, 1.7619E-017};
FIGURE 4.18.
Coefficient file in float format for a FIR bandpass filter centered at
F
s
/4
(
BP55.cof
).
55-coefficient FIR bandpass filter with a center frequency at
F
s
/4. A filter develop-
ment package (on the CD) that generates filter coefficients in float or hexadecimal
format is described in Appendix E.
Build this project as
FIRPRN
. Run this project (with the coefficient file
BP55.cof
)
and verify that the output is an FIR bandpass filter centered at 2 kHz. To verify the
output as the noise sequence, output
dly[0]
in lieu of
yn
when calling the func-
tion
output_sample.
Testing Different FIR Filters
Halt the program. Edit the C source program to include and test different coeffi-
cient files (on the CD) that represent different FIR filters, all using float format
values. Each coefficient file contains 55 coefficients (except
comb14.cof
).
1.
BP55.cof
: bandpass with center frequency
F
s
/4
2.
BS55.cof
: bandstop with center frequency
F
s
/4
3.
LP55.cof
: lowpass with cutoff frequency
F
s
/4
4.
HP55.cof
: highpass with bandwidth
F
s
/4
5.
Pass2b.cof
: with two passbands
6.
Pass3b.cof
: with three passbands
7.
Pass4b.cof
: with four passbands
8.
Comb14.cof
: with multiple notches (comb filter)
These filters were designed with MATLAB (see Appendix D). Figure 4.19
a
shows
the real-time output frequency response of an FIR filter with two passbands, using
Search WWH ::
Custom Search