In the simplest FIR filter implementation, each filter coefficients is multiplied by an input sample. The first filter coefficients is multipled by the first sample, the next coefficient by the next sample, etc., for the length of the filter. The sum of each product is the first output sample. Then the FIR filter is moved one sample ahead, so the first coefficient is multiplied by the second sample, and the second coefficient is multipled by the third sample, etc.. These products are sums to produce the next output sample. This is repeated, sliding the FIR filter along the input samples, and calculating each new output sample.
The formula is:
For n = 0 ... N - 1, where N is the number of input samples:
where the impulse response, i.e. FIR filter coefficients, are defined from N1 to N2.
This is often written with N1 = 0 and N2 = filter_length - 1.