Realization scheme of a finite impulse response filter.
Because of the fact that the impulse response coefficients of an FIR filter are equal to the weights of the filter, it follows from Fig. 1 that the DE can be written as:
y[n]=M−1∑k=0h[k]x[n−k]
This equation performs the so called convolution sum operation: It describes the filter operation of an FIR. From this equation it follows that the procedure to compute the output samples y[n], for any index n, can be described as follows:
Convolution sum procedure:
Plot the impulse response weights h[k] as a function of index k.
Plot the input signal samples x[k] also as a function of index k.
Mirror (reverse) the input signal samples. That is replace x[k] into x[−k].
For each new index n, shift the mirrored signal samples x[−k] to index n, resulting in x[n−k].
For each new index n, the output signal sample y[n] is equal to the sum of the element by element multiplication of the sequence h[k] and the sequence x[n−k] in the range k=0,1,⋯,M−1, since h[k]=0 outside this range of indices.
In literature the symbol ⋆ is used to describe the convolution sum, thus:
y[n]=M−1∑k=0h[k]x[n−k]≡h[n]⋆x[n]
Example
Show in a plot the convolution sum result of x[n]=δ[n]+2δ[n−1]+3δ[n−2] with an FIR filter with coefficients b0=b1=b2=1.
The impulse response of the FIR filter writes as: h[n]=δ[n]+δ[n−1]+δ[n−2].
The upper hand two plots of the figure below show the impulse response h[k] and the input signal samples x[k]. The next step is to mirror the input signal samples into x[−k]. Now for each new sample n we have to shift this mirrored sequence of input signal samples over n samples
and calculate the sum of the element by element multiplication of the two sequences h[k] and x[n−k]. The intermediate results of the sequence x[n−k], for n=0,n=1 and n=2, are depicted in the figure below, while the result of the convolution sum procedure for all indices n is as follows:
⋮⋮⋮n=−1⇒y[−1]=h[0]x[−1]+h[1]x[−2]+h[2]x[−3]=0n=0⇒y[0]=h[0]x[0]+h[1]x[−1]+h[2]x[−2]=1n=1⇒y[1]=h[0]x[1]+h[1]x[0]+h[2]x[−1]=3n=2⇒y[2]=h[0]x[2]+h[1]x[1]+h[2]x[0]=6n=3⇒y[3]=h[0]x[3]+h[1]x[2]+h[2]x[1]=5n=4⇒y[4]=h[0]x[4]+h[1]x[3]+h[2]x[2]=3n=5⇒y[5]=h[0]x[5]+h[1]x[4]+h[2]x[3]=0⋮⋮⋮
Thus the output signal samples can be described as:
y[n]=δ[n]+3δ[n−1]+6δ[n−2]+5δ[n−3]+3δ[n−4]
which is depicted at the lower right corner of the figure below.
Example of convolution sum procedure.
From the previous example it follows that the convolution sum procedure results in a finite length sequence of output signal samples in case both the sequences of the input signal samples and the impulse response have finite length. In general:
When the length of an input sequence of signal samples is N and the length of the sequence of impulse response values is M, then the convolution sum procedure results in a sequence of length N+M−1 output signal samples y[n].