un

guest
1 / ?
back to lessons

Two Conditions, Two Coefficients

A filter with k+1 free coefficients can meet exactly k+1 conditions on its transfer function. Hamming demonstrated this with the simplest non-trivial case: two coefficients, two conditions.

The Conditions

- At f = 1/6: H(1/6) = 1 (this frequency passes unchanged)

- At f = 1/3: H(1/3) = 0 (this frequency is completely stopped)

The Filter Form

A filter using two coefficients a and b with input x_n and one delay:

y_n = a · x_n + b · x_{n−1}

Substituting the Eigenfunction

Input e^{i2πfn}, output H(f) · e^{i2πfn}. The right side gives:

H(f) · e^{i2πfn} = a · e^{i2πfn} + b · e^{i2πf(n−1)}

Divide through by e^{i2πfn}:

H(f) = a + b · e^{−i2πf}

Now apply the two conditions to get two equations in two unknowns.

3-Sample Averaging Filter: Transfer Function

Solving for the Coefficients

Substituting f = 1/6 into H(f) = a + b·e^{−i2πf}:

1 = a + b·e^{−i2π/6} = a + b·(cos(−π/3) + i·sin(−π/3)) = a + b·(1/2 − i√3/2)

Substituting f = 1/3:

0 = a + b·e^{−i2π/3} = a + b·(−1/2 − i√3/2)

From these two equations, Hamming solved to get a = 1/2, b = 1/2 — the same as a 3-sample average (with the output at the middle position).

Hamming set up two equations from H(1/6) = 1 and H(1/3) = 0 with the filter form H(f) = a + b·e^{−i2πf}. The solution gives a = 1/2, b = 1/2. Verify this: substitute a = b = 1/2 back into H(f) = a + b·e^{−i2πf} and evaluate at f = 1/3. Show that you get H(1/3) = 0. Use Euler's formula: e^{iθ} = cos θ + i sin θ.

The Complete Filter

The filter that satisfies both conditions has the form:

y_n = (x_{n−1} + x_n + x_{n+1}) / 2

Output at position n uses the previous, current, & next input samples.

Transfer function:

H(f) = (e^{i2πf} + 1 + e^{−i2πf}) / 2 = (2cos(2πf) + 1) / 2 = cos(2πf) + 1/2

Verification:

- H(1/6) = cos(π/3) + 1/2 = 1/2 + 1/2 = 1 ✓

- H(1/3) = cos(2π/3) + 1/2 = −1/2 + 1/2 = 0 ✓

At other frequencies: H(0) = 1 + 1/2 = 3/2 (passes DC with gain), H(1/2) = −1 + 1/2 = −1/2.

Insight: a digital filter implements in software what an analog RC filter implements in hardware. The choice of coefficients controls the frequency response analytically.

Transfer Function at Multiple Frequencies

The transfer function H(f) = cos(2πf) + 1/2 applies at every frequency, not just the two design points.

Using H(f) = cos(2πf) + 1/2, compute H(f) at f = 0, f = 1/4, and f = 1/2. Then describe the overall character of this filter: is it a lowpass, highpass, bandpass, or bandstop filter? What evidence from your three calculations supports this classification?

Gibbs' Discovery

Hamming told the story of Michelson — of Michelson-Morley fame — who built an analog machine to compute Fourier series up to 75 terms. When he reconstructed a discontinuous function from its coefficients, the machine showed a persistent overshoot near the jump.

Michelson asked local mathematicians. They blamed the equipment. Only Gibbs listened.

The Gibbs phenomenon: when a Fourier series truncated to N terms approximates a step discontinuity, the approximation overshoots by approximately 8.9% of the jump height — and this overshoot does NOT decrease as N increases. More terms narrow the overshoot spike but never eliminate it.

Mathematically: the N-term Fourier series converges pointwise everywhere except at the discontinuity. At the discontinuity, the partial sums converge to the midpoint of the jump, but the maximum of the partial sum near the jump approaches 1.0895 (for a unit-height step), not 1.0.

Why It Matters for Filters

An ideal lowpass filter has a step function transfer function: H(f) = 1 for f < f_c, H(f) = 0 for f > f_c. That discontinuity between passband & stopband means any finite-length filter (truncated Fourier series) exhibits Gibbs ripple in its frequency response.

The consequence: truncated Fourier series design alone produces filters with ≈9% ripple in both passband & stopband, regardless of how many coefficients are used.

Gibbs Phenomenon & Window Functions

Implications of the Gibbs Phenomenon

Hamming used this result to motivate window functions: multiplying the ideal Fourier coefficients by a smoothly tapering window reduces the Gibbs overshoot dramatically.

The Hamming window: w_k = 0.54 + 0.46·cos(πk/N). This window reduces Gibbs ripple to less than 0.2%.

The trade-off: windowing smooths the transition but widens the transition band. Sharper cutoff always requires more coefficients.

A filter designer computes the ideal Fourier coefficients for a sharp cutoff lowpass filter and then truncates to N = 50 terms. She then increases N to 500 terms. Describe what happens to: (a) the width of the transition band; (b) the height of the Gibbs overshoot in the passband. Be specific about what changes and what does not.