Digital Signal Processing Reference
In-Depth Information
This implementation of the FIR filter is slow because of the constant memory
state shuffle. Note that most sophisticated DSP processors have handled this
shuffle by implementing what is referred to as a circular buffer. A circular buffer
is one in which the last entry is magically connected to the first entry. In other
words, if a pointer that is pointing to the last entry in the buffer is incremented, the
processor automatically adjusts the pointer to point to the first entry of the buffer.
This helps tremendously, because with a circular buffer, no memory states need to
be moved. The newest input value is simply written into the circular buffer over
the oldest memory state. The starting point of the convolution is then adjusted to
the proper value and the process continues in the normal manner. Although a
circular buffer can be simulated on a PC, it requires special coding beyond the
scope of this text. In the next section we will discuss a much faster nonreal-time
method that we can use instead. We will leave the real-time circular buffer
implementation to the DSP chip programmers since DSP systems are usually used
for this type of work.
8.3.2 Nonreal-Time Implementation of FIR Filters
The implementation of the FIR filter under nonreal-time conditions can be made
much more efficient because we will have available as many of the input values as
we would like (and that memory will hold). The input values not only represent
the input for the system, but also the memory states of the system. The need for
the constant shuffle of past memory states will be removed (to a great degree) as
we will see. To understand the efficiency of the nonreal-time process, it may be
helpful to view the convolution process graphically. Figure 8.5 shows an array of
input values and an array of coefficient values. We can visualize the convolution
process as the generation of the sum of products as the coefficients slide past the
input values.
In part (a) of Figure 8.5, we see the initial position of the convolution process
where x 0 is the first input value to be processed. If previous values of the input are
not available then x −1 through x −( N −1) would be set to zero. After the convolution
sum of products is calculated, the value of y 0 can be determined. The array of
coefficients can then be effectively moved one position to the right and the
convolution performed again for y 1 . This procedure will continue until we reach
the end of the input array, processing the last value of the array x L −1 , as shown in
part (b). Note that since we have a very large array of input values, we can
perform many convolution sums without shuffling the past values of input.
However, there is usually a limit to how large an input array can be brought into
memory. Therefore, we will eventually need to bring in a new array of L input
values and start the convolution again from the start of the new array. But in order
for the initial convolution sums on this new array to be correct, the values
immediately preceding the x L value must be available at the beginning of the input
array, as shown in part (c) of the figure. Consequently, we will need to move the
last N − 1 values of the initial input array to the beginning on the array. This
Search WWH ::




Custom Search