Filter Design

Trick for Identifying Filter Types from H(z)

You can identify the type of filter (high-pass, low-pass, band-pass, etc.) by looking at the behavior of H(z) at different frequency components, particularly at ω = 0 (DC component) and ω = π (Nyquist frequency).

The trick is to plug in z = 1 or z = -1 into the transfer function H(z). These specific values correspond to particular frequencies:

  • tells you how the filter behaves at the DC (zero) frequency. In other words, you'll see how constant or very low-frequency components are affected.

  • provides information at the Nyquist frequency, which is half the sampling rate. This tells you how the filter behaves at the highest frequency it can represent.

This is because:

  • When (DC component), because .

  • When (Nyquist frequency), because .

The following table summarizes the behavior of H(z) at these two frequencies for different types of filters:

Filter Type (DC) (Nyquist)
Low-pass Significant Close to zero
High-pass Close to zero Significant
Band-pass Attenuated Attenuated
Band-stop Significant Significant

While these are general rules, calculating the frequency response by plugging in e^(jω) for z can provide the most accurate picture.

Test your understanding

Here are 10 examples of transfer functions without indicating their types:

Can you identify the filter types? The answers are below.

    • , => High-pass
    • , => Low-pass
    • , => Low-pass
    • , => High-pass
    • , => Low-pass
    • , => Band-pass
    • , => Low-pass
    • , => Band-pass
    • , => Band-pass
    • , => Band-pass

Step-by-Step Filter Design: Overview

In the context of digital filter design, frequencies are often normalized to simplify the design process and make it more universal. Here's a simplified walk-through of designing a digital filter using the z-transform method:

Step 1: Define Requirements

Decide what type of filter you need (low-pass, high-pass, etc.) and determine its specifications, like the passband and stopband frequencies, ripple, and attenuation.

Step 2: Select Filter Type

Choose an appropriate filter design method. Popular methods include Butterworth, Chebyshev, and Elliptic filters for IIR design, and Window Method or Parks-McClellan for FIR design.

Step 3: Continuous-Time Prototype

For IIR filters, you often start with a continuous-time prototype. Using the chosen method, find its transfer function .

Step 4: Transform to Discrete Time

Convert the continuous-time prototype into a discrete-time filter. This is usually done using bilinear transform or impulse invariance methods. You'll get a discrete-time transfer function .

Step 5: Normalize Frequencies

Normalize the frequencies by dividing them by the sampling rate. This converts your design into a form where the Nyquist frequency corresponds to , and makes the design more universal.

Step 6: Calculate Coefficients

Extract the coefficients of the polynomial terms in the numerator and the denominator of . These will be used in your difference equation to implement the filter.

Step 7: Implement

Use the coefficients in your chosen programming language or hardware to implement the filter.

Step 8: Test

Finally, test the filter to ensure it meets the original specifications. This might involve using test signals, impulse responses, or any other relevant metrics.


Common Filter Design Methods

The most commonly used methods for digital filter design generally fall into these categories:

  1. Butterworth, Chebyshev, Elliptic Filters for IIR: These are classic designs that have closed-form solutions and provide various trade-offs between passband ripple, stopband attenuation, and filter order.

  2. Window Method for FIR: Simple to use and understand, this method involves multiplying the ideal impulse response by a window function. Common windows include Hamming, Blackman, and Kaiser.

  3. Parks-McClellan for FIR: This uses the Remez exchange algorithm to design a filter that minimizes the maximum error between the desired and actual frequency responses. It's optimal in a minimax sense.

  4. Frequency Sampling for FIR: This is straightforward to implement but can result in higher filter orders. You specify the desired frequency response and compute the impulse response using an inverse Fourier transform.

  5. Bilinear Transform for IIR: This method converts a continuous-time filter to a discrete-time filter and is often used in conjunction with analog prototype designs like Butterworth or Chebyshev.

  6. Impulse Invariance: Another method for converting continuous-time filters to discrete-time filters. It's particularly useful when you have a well-defined continuous-time system that you want to discretize.

Each method has its pros and cons, but these are generally the most common ones you'll encounter in both academia and industry.


Filter Design Methods: Butterworth, Chebyshev, Elliptic

Let's delve into Butterworth, Chebyshev, and Elliptic filters, which are commonly used for Infinite Impulse Response (IIR) filter design.

Butterworth Filters

Main Features: The Butterworth filter provides a smooth frequency response with no ripples. The transition from the passband to the stopband is not as sharp compared to other types, but it's maximally flat in the passband.

Use Cases: When you need a filter with no ripple and can compromise on the sharpness of the transition between passband and stopband.

Chebyshev Filters

Main Features: There are two types—Type I and Type II. Type I has ripple in the passband and is flat in the stopband. Type II is the opposite. Chebyshev filters have a steeper roll-off compared to Butterworth but come with ripples.

Use Cases: Useful when you need a steep roll-off and can tolerate some ripple.

Elliptic Filters

Main Features: Elliptic filters have ripples in both the passband and the stopband, but they offer the steepest roll-off for a given filter order.

Use Cases: When you need the steepest possible roll-off and can tolerate ripples in both passband and stopband.

Here's a summarizing table for quick reference:

Filter Type Passband Ripple Stopband Ripple Roll-off Rate
Butterworth No No Slower
Chebyshev Yes (Type I) Yes (Type II) Moderate to Fast
Elliptic Yes Yes Fastest

iir_filters