un

guest
1 / ?
back to lessons

From Ideal Response to Practical Filter

Hamming presented a four-step design method for FIR filters using Fourier series.

Step 1: Specify the Ideal Response

Define H_ideal(f): the exact frequency response you want. For a lowpass filter: H = 1 for f < f_c, H = 0 for f > f_c. This is a step function in the frequency domain.

Step 2: Compute Fourier Coefficients

Expand H_ideal(f) as a Fourier series in the frequency variable. The coefficients c_k are the filter's ideal impulse response values:

c_k = ∫₀¹ H_ideal(f) · e^{i2πfk} df

For a lowpass filter with cutoff f_c: c_k = sin(2πf_c·k) / (πk) for k ≠ 0, c_0 = 2f_c.

This impulse response is infinite — the sinc function extends forever in time. A practical filter needs a finite number of coefficients.

Step 3: Truncate to 2N+1 Terms

Keep only coefficients c_k for |k| ≤ N. This rectangular window of 2N+1 terms is the simplest truncation. It produces the Gibbs phenomenon: ≈9% overshoot near the cutoff.

Step 4: Apply a Window

Multiply the truncated coefficients by a window function w_k to reduce Gibbs overshoot:

c̃_k = c_k · w_k

The windowed coefficients c̃_k define the practical filter.

Gibbs Phenomenon & Window Functions

Computing Fourier Coefficients

The Fourier coefficient formula c_k = sin(2πf_c·k) / (πk) for a lowpass filter with cutoff f_c gives the impulse response.

For a bandpass filter with lower cutoff f_l and upper cutoff f_u, the Fourier coefficient for the ideal response is: c_k = [sin(2πf_u·k) − sin(2πf_l·k)] / (πk).

For a lowpass filter with cutoff f_c = 1/4, compute the Fourier coefficients c_k for k = 0, 1, 2, and −1. Use c_0 = 2f_c and c_k = sin(2πf_c·k)/(πk) for k ≠ 0. Show the computation for each. Then explain why the coefficient sequence is symmetric: c_k = c_{−k}.

How Windows Reduce Gibbs Overshoot

A window function w_k tapers the truncated coefficient sequence from its central value down to zero at the edges. The taper removes the sharp edges introduced by rectangular truncation.

Why Tapering Works

Gibbs overshoot arises because the rectangular window's Fourier transform (the sinc function) has large sidelobes. These sidelobes add together near the discontinuity to produce the ≈9% overshoot.

A smooth window has a Fourier transform with smaller sidelobes. Multiplying the coefficients by the window convolves the ideal frequency response with the window's Fourier transform. Smaller sidelobes → less ripple.

Common Windows

Rectangular (no windowing): sidelobes ≈ −13 dB, Gibbs ≈ 9%.

Hann (von Hann): w_k = 0.5 + 0.5·cos(πk/N). Sidelobes ≈ −31 dB.

Hamming: w_k = 0.54 + 0.46·cos(πk/N). Sidelobes ≈ −41 dB, first sidelobe ≈ −43 dB. Gibbs < 0.2%.

Kaiser: w_k = I₀(α·√(1−(k/N)²)) / I₀(α). Tunable: α controls the sidelobe level, allowing a design to trade off sidelobe height vs transition band width.

The Window Trade-Off

Every window imposes a trade-off: suppressing sidelobes always widens the main lobe.

A wider main lobe means a wider transition band — the range of frequencies between passband & stopband.

Hamming formalized this in terms of Kaiser's design parameters:

- δ: allowable ripple (vertical tolerance from ideal — how much the response can deviate from 0 or 1)

- ΔF: transition width (horizontal tolerance — how narrow the transition from pass to stop)

Kaiser's method finds both N (number of coefficients) and α (the window shape parameter) from δ and ΔF alone. No guessing the window type.

A filter specification requires: passband ripple ≤ 0.01 (δ = 0.01) and transition band width ΔF = 0.05 (normalized). A second filter requires: passband ripple ≤ 0.001 (δ = 0.001) and the same ΔF = 0.05. Which filter requires more coefficients N? Explain the relationship between ripple tolerance δ and filter order N in Fourier series design.

From Specifications to Coefficients

Kaiser's method takes two specifications — δ (ripple tolerance) and ΔF (transition width) — and produces both N and the window coefficients without trial and error.

The Design Sequence

1. Compute A = −20·log₁₀(δ) (attenuation in dB)

2. Compute the shape parameter α:

- If A > 50: α = 0.1102·(A − 8.7)

- If 21 ≤ A ≤ 50: α = 0.5842·(A − 21)^{0.4} + 0.07886·(A − 21)

- If A < 21: α = 0 (rectangular window)

3. Compute N = (A − 8) / (2.285 · 2πΔF)

4. Compute the Kaiser window weights: w_k = I₀(α·√(1−(k/N)²)) / I₀(α)

5. Multiply the ideal Fourier coefficients by the window weights

6. Evaluate the resulting transfer function and check ripple against δ. If ripple exceeds δ (edge interference), repeat with a smaller tolerance.

Hamming noted: Kaiser arrived at the exponent 0.4 by trying 0.5 (too large) and finding 0.4 fit well. The computer served as an experimental tool for theoretical research.

Applying Kaiser's Method

The Bessel function I₀(x) appears in Kaiser's window formula. It computes as a rapidly converging series:

I₀(x) = Σ_{m=0}^∞ [(x/2)^m / m!]²

For small x the series converges in a few terms because of the m!² in the denominator.

A lowpass filter requires δ = 0.01 (1% ripple) and ΔF = 0.1 (10% of the sampling rate as transition width). Using Kaiser's formula: A = −20·log₁₀(0.01) = 40 dB. Since 21 ≤ 40 ≤ 50, use α = 0.5842·(A−21)^{0.4} + 0.07886·(A−21). Compute α. Then use N = (A−8)/(2.285·2πΔF) to compute the required number of filter coefficients. Round N up to the nearest integer.