For most digital filters, you typically design the digital filter response in the frequency domain. The frequency response specification for the digital filter typically includes the target magnitude response, phase response, and the allowable deviation for each.

The following figure illustrates the magnitude frequency response of a lowpass filter, which allows low frequencies to pass and attenuates high frequencies:

Figure 1. Magnitude Frequency Response of a Lowpass Filter

The frequency range from the passband edge frequency to the stopband edge frequency is the transition band, which has a frequency response that is unspecified. The filter passband and stopband can contain oscillations, which are known as ripples. A typical example of a ripple appears in the circle of the previous figure. δp indicates the magnitude of the passband ripple, which equals the maximum deviation from the unity. δs indicates the magnitude response of the stopband ripple, which equals the maximum deviation from zero.

Notice the transition band between the passband and stopband frequencies. In an ideal design, a digital filter has a target gain in the passband and a zero gain (−∞ dB) in the stopband. In a real implementation, a finite transition region between the passband and the stopband, which is known as the transition band, always exists. The gain of the filter in the transition band is unspecified. The gain usually changes gradually through the transition band from 1 (0 dB) in the passband to 0 (−∞ dB) in the stopband.

You can measure the passband ripple and stopband ripple in decibels, as shown in the following equations:

Passband   ripple = 20 log 10 ( 1 δ p )

Stopband   ripple = 20 log 10 ( δ s )

Based on the two equations above, you can convert the passband ripple to or from the decibel representation. For example, if passband ripple equals 0.01 dB, that is,

0 . 01 = 20 log 10 ( 1 δ p )
, then δp = 0.00115. Similarly, if stopband ripple equals 60 dB, that is,
60 = 20 log 10 ( δ s )
, then δs = 0.001.

The following figure illustrates the magnitude frequency responses of a highpass filter, which passes high frequencies and attenuates low frequencies:

Figure 2. Magnitude Frequency Responses of a Highpass Filter

The following figure illustrates the magnitude frequency responses of a bandpass filter, which passes a certain band of frequencies and attenuates lower and higher frequencies:

Figure 3. Magnitude Frequency Responses of a Bandpass Filter

In the previous figure, stopband edge frequency 1 indicates the maximum frequency of the lower frequency range that you want to attenuate, and stopband edge frequency 2 indicates the minimum frequency of the higher frequency range that you want to attenuate. The frequency range between passband edge frequency 1 and 2 indicates the range of frequencies that can pass through the filter.

The following figure illustrates the magnitude frequency response of a bandstop filter, which attenuates a certain band of frequencies and passes all frequencies not within the band:

Figure 4. Magnitude Frequency Response of a Bandstop Filter

In the previous figure, passband edge frequency 1 indicates the maximum frequency of the lower frequency range that can pass through the filter, and passband edge frequency 2 indicates the minimum frequency of the higher frequency range that can pass through the filter. The frequency range between stopband edge frequency 1 and 2 indicates the range of frequencies that you want to attenuate.