Digital Signal Processing/Digital Filters

From testwiki
Jump to navigation Jump to search

Template:DSP Page

Digital Filters can be very complicated devices, but they must be able to map to the difference equations of the filter design. This means that since difference equations only have a limited number of operations available (addition and multiplication), digital filters only have limited operations that they need to handle as well. There are only a handful of basic components to a digital filter, although these few components can be arranged in complex ways to make complicated filters.

There are two types of filters in the digital realm: Infinite Impulse Response (IIR) filters, and Finite Impulse Response (FIR) filters. This page will attempt to discuss the differences between the two filter types, and the pros and cons of each.

FIR Filters

We will start the discussion with FIR filters, which are conceptually the easiest to understand and the easiest to design. However, FIR filters suffer from low efficiency, and creating an FIR to meet a given spec requires more hardware than an equivalent IIR filter. However, an FIR filter with symmetric coefficients is guaranteed to have linear phase. This is important in some applications.

If we define the discrete time impulse function as

δ[n]={1n=00n=0,

the response of an FIR filter to δ[n], denoted as h[n], will decay to zero after a finite number of samples. The transfer function of an FIR filter contains only zeros and no poles.

IIR Filters (infinite impulse response filter)

IIR filters are harder to design than the FIR filters, but the benefits are extraordinary: IIR filters are an order of magnitude more efficient than an equivalent FIR filter. Even though FIR is easier to design, IIR will do the same work with fewer components, and fewer components translate directly to less money. IIR filters differ from FIR filters because they always contain feedback elements in the circuit, which can make the transfer functions more complicated to work with.

The transfer function of an IIR filter contains both poles and zeros. Its impulse response never decays to zero (though it may get so close to zero that the response cannot be represented with the number of bits available in the system).

Highpass and Lowpass

High-Pass and Low-Pass filters are the most simple forms of digital filters, and they are relatively easy to design to specifications. This page will discuss high-pass and low-pass transfer functions, and the implementations of each as FIR and IIR designs.

Bandpass

Bandpass Filters are like a combination of a high-pass and a low-pass filter. Only specific bands are allowed to pass through the filter, and frequency data that is too high or too low will not pass the filter.

Bandstop

Notch filters are the opposite to Bandpass in that they only stop a certain narrow band of frequency information, and allow all other data to pass without problem.

Notch

The direct inverse of a bandpass filter is called a bandstop filter. A notch filter is essentially a very narrow bandstop filter.

Comb Filters

Comb Filters, as their name implies, look like a hair comb. They have many "teeth", which in essence are notches in the transfer function where information is removed. These notches are spaced evenly across the spectrum, so they are only useful for removing noise that appear at regular frequency intervals.

Allpass

The All pass filter is a filter that has a unity magnitude response for all frequencies. It does not affect the the frequency response of a filter. The allpass filter does affect the phase response of the system. For example, if an IIR filter is designed to meet a prescribed magnitude response often the phase response of the system will become non-linear. To correct for this non-linearity an allpass filter is cascaded with the IIR filter so that the overall response(IIR+Allpass) has a constant group delay.

Canonic and Non-Canonic

Canonic filters are filters where the order of the transfer function matches the number of delay units in the filter. conversely, noncanonic filters are when the filter has more delay units then the order of the transfer function. In general, IIR filters are noncanonic, and FIR filters are canonic. This is not always the case, however.

Here is a demonstration of a canonical, 2nd order filter:

Here is an example of a non-canonical 2nd order filter: File:NonCannonical DSP Filter.JPG

Notice that in the canonical filter, the system order (2) equals the number of delay units in the filter (2). In the noncanonical version, the system order is not equal to the number of delays (4 delay units). Both filters perform the same task, however the canonical version will be easier to implement in digital hardware, because you will need fewer delay units.

Notations

There are some basic notations that we will be using:

ωp Passband cut off frequency
ωs Stopband cut off frequency
δp Passband ripple peak magnitude
δs Stopband ripple peak magnitude