Digital Signal Processing Reference
In-Depth Information
movement process will have to be accomplished at the end of processing each
segment of the input array. If we make the input array buffer much larger than the
length of the FIR filter, this amount of processing should be insignificant.
Figure 8.5 Graphical interpretation of convolution.
Listing 8.5 shows the Dig_FIR_Filt_NRT function for implementing the
nonreal-time (NRT) form of the FIR filter. In this function, the pointers to the
input, output, and coefficient arrays are passed as arguments as well as the number
of coefficients and number of values to be processed in the input array. Notice that
a separate array of memory states is not necessary since the input array also
represents the memory states. The function starts by assigning the address of the
first input value to the pointer variable x , which will march through the array
keeping track of the starting point of the convolution. A temporary pointer to the
proper output array value is also initialized. The pointer to the coefficient array c
is initialized within the first for loop, which controls the processing of all input
values. The convolution sum is then calculated moving the x and c pointers
progressively through the respective arrays accumulating products. After the
summation is complete, the next step is to multiply the accumulation by the filter's
gain constant, which has been stored at the last entry in the C array. The process is
completed by converting the output floating-point value to a fixed-point value and
resetting the starting point in the x array to the correct position for the calculation
of the next output value. After all values in the input array have been processed,
Search WWH ::




Custom Search