A few things about the FIR filter

The FIR filter or Finite Impulse Response Filter is a pure digital implementation of the classical passive filters. Many characteristics can be achieved that cannot be obtained by classical filters. eg: extremely sharp cut off, very linear phase. However, unlike perfect classical passive filters the response repeats at multiples of the sampling frequency. Thus a digital filter is sometimes complemented by monotonic passive filter to act above the sampling frequency.

FIR filter design

The stereo generator DSP based design implements three FIR filters, each of different design. There is the LP input filter to limit the frequency range of the input signals and remove any possible presence of a 19KHz signal. Then there is an interpolation filter, implemented as a polyphase 1:4 linear phase filter. Finally there is an amplitude/phase correction filter to compensate for the deviations from ideal of the DAC and MPX filter.

FIR filter formulas

The generaL formula for a FIR filter is a sum of k taps (coefficients). Where N is the order of the filter. The order N can be much higher than any practical passive or active component filter. Using a suitable CAD application the filter response can be distorted "to measure".

FIR formula 1

FIR formula 2

Although it is possible to design a FIR filter by hand, the probability that an error will be made in the calculation of, say a N = 60 filter will be > 99.9%.

Transversal Filter Diagram

A graphical representation of the algorithms as a transversal filter. This is the most common form of FIR filter implementation since it is easily implemented in DSP hardware. There are otherways, especially if the the filter is linear phase. In this case the filter coefficients are symettrical, so only half the number of calculations are needed. However due to the complex indexing requirements of the intermediate calculations a DSP based algorithms are more complex, so negating the time saving of reduced coefficients.

Note: the Analogue Device, especially 215xx series incorporate hardware engines for both IIR and FIR filter calculations. Using these additions can reduce the substantially the CPU load on the main core CPU by triggering the hardware engines when a filter calculation is required. Once the calculation is completed the main CPU core is informed so the results can be collected. In this way the CPU core can be dedicated to other tasks.

float	pm	coeffs_19k[66] =
//	19k input filter, fs=48k, fl=15.4117k, fh=18.7883k, stop=100db, ripple=0.01db


Here are the coefficients of a linear phase 19KHz filter, the filter parameters are given in the comment line. There is a spare variable in the array that can be used as a scratch pad in the pm (program memory). Note: since the filter is not monotonic there is the need for an aliasing frequency filter in the analogue domain at the ADC input to ensure removal of any frequencies above the sampling frequency

There are two further filter type of interest that are used in the stereo generator.

An Interpolation Filter

A Correction Filter