This document is designed to explain the method used to design the coefficients for people who are already familiar with DSP techniques. If you are not, then you probably will not understand a great deal of this! There are many books abd web pages on the subject, so I suggest if you want to get into DSP, have a look at these.
This is just one method to design a Finite Impulse Response digital filter. It uses the Hamming window. I designed this filter a bit "back to front" since I wanted the example to have only 5 taps. In reality the number of taps is a consequence of the design process, and is not a pre-requisite.
First we must establish some parameters for the design. These are fairly arbitrary in our case, but would normally be chosen based on the processor, and task at hand.
Sampling frequency = 16Hz
Cutoff frequency = 1Hz
Transition width = 10Hz
This means that the filter will start falling off at 1Hz, and at 11Hz will be fully attenuating. This design gives a stop-band attenuation of at least 51dB.
The number of taps required is normally calculated from the equation
This rather artificial setting gives us a filter with 5 taps.
Once the number of taps is known, the filter coefficients can be calculated. These are given by the equations:
For these equations, ‘n’ ranges from –2 to +2, giving the following values for h(n):
h(-2) = 0.021
h(-1) = 0.096
h(0) = 0.146
h(1) = 0.096
h(2) = 0.021
These represent the an parameters of the digital filter: