Digital Signal Processing Reference
In-Depth Information
FIGURE 4.7. MATLAB's filter designer SPTool, showing the characteristics of a FIR band-
stop filter centered at 2700 Hz.
tion with N coefficients and N delay samples for a specific time n . At time n the
output is
() =
()() +
()
(
) +◊◊◊+
(
)
(
(
)
)
yn
h
0
xn
h
1
xn
-
1
hN
-
1
xn
--
N
1
The delay samples are then updated within the second loop to be used for calcu-
lating y ( n ) at time n
1). The newly acquired input sample always resides
at the beginning of the samples buffer (in this example). The memory location that
contained the sample x ( n ) now contains the newly acquired sample x ( n
+
1, or y ( n
+
+
1). The
output y ( n
+
1) at time n
+
1 is then calculated. This scheme uses a data move to
update the delay samples.
Example 4.7 illustrates how various memory organizations can be used for both
the delay samples and the filter coefficients, as well as for updating the delay samples
within the same loop as the convolution equation. We also illustrate the use of a cir-
cular buffer with a pointer to update the delay samples in lieu of moving the data
in memory. The output is scaled (right-shifted by 15) before it is sent to the codec's
DAC. This allows for a fixed-point implementation as well.
Bandstop, Centered at 2700 Hz ( bs2700.cof )
Build and run this project as FIR . Input a sinusoidal signal and vary the input fre-
quency slightly below and above 2700 Hz. Verify that the output is a minimum at
2700 Hz.
Search WWH ::




Custom Search