Digital Signal Processing Reference
In-Depth Information
FIGURE 4.23.
Spectrum of an internally generated pseudorandom noise sequence with a
signal analyzer, using program
FIRPRNbuf.c
.
Example 4.6: Two Notch Filters to Recover Corrupted
Input Voice (
Notch2
)
This example illustrates the implementation of two notch (bandstop) FIR filters to
remove two undesired sinusoidal signals corrupting an input voice signal. The voice
signal (
TheForce.wav
on the CD) was “added” (using Goldwave) with the two
undesired sinusoidal signals at frequencies of 900 and 2700 Hz, to produce the cor-
rupted input signal
corruptvoice.wav
(on the CD).
Figure 4.24 shows a listing of the program
NOTCH2.c
, which implements the two
notch filters in cascade (series). Two coefficient files,
BS900.cof
and
BS2700.cof
(on the CD), each containing 89 coefficients and designed with MATLAB, are
included in the filter program
NOTCH2.c
. They represent two FIR notch filters, cen-
tered at 900 and 2700 Hz, respectively. A buffer is used for the delay samples of each
filter. The output of the first notch filter, centered at 900 Hz, becomes the input to
the second notch filter, centered at 2700 Hz.
Build this project as
notch2
. Input (play) the corrupted voice signal
cor-
ruptvoice.wav
. Verify that the slider in position 1 (as set initially) outputs the
corrupted voice signal, as shown in Figure 4.25. This plot is obtained with Goldwave
using the DSK output as the input to a sound card (see Appendix E). The plot is
shown on only one side (left channel) since a mono signal is used. Observe the two
spikes (representing the two sinusoidal signals) at 900 and 2700 Hz, respectively.
Change the slider to position 2 and verify that the two undesirable sinusoidal signals
are removed. Output
y1out
in lieu of
y2out
and verify that only the 2700-Hz spike
corrupts the input voice signal. Note that
y1out
is the output of the first notch filter.
Search WWH ::
Custom Search