C915 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

C9 · Lesson 15 · Frequency response, distortion and ideal filters

Gain, phase, delay, and the filter you can't build

An audio amplifier should change only the size of a signal; a cable should only delay it. Anything else is distortion: frequencies amplified unequally, or delayed by different amounts so a sharp edge smears. The frequency response tells exactly which, through its magnitude and its phase. And it explains a surprising fact about the filter every designer would like to have, one that passes everything below a cutoff perfectly and nothing above it: its impulse response starts before the impulse arrives. The ideal filter can't be built, only approached.

  • The curve is the impulse response of an ideal low-pass filter with cutoff fc: h(t)=2fcsinc(2fct), a central peak with ripples on both sides.
  • Raise fc: the peak gets taller and narrower. A wider passband gives a sharper response in time.
  • Look left of t = 0: the ripples are there too. The filter responds before the impulse arrives, so no real circuit can do this. Real filters delay a truncated version of it, or settle for a gentler cutoff.

Predict

The ideal low-pass filter passes every frequency below 1 kHz with gain 1 and zero phase, and nothing above. What is wrong with building one?

Name it

Magnitude and phase

H(jω)=|H(jω)|ejϕ(ω). The magnitude is the gain at each frequency (often in dB, 20log10⁡|H|), the phase is the shift.

Distortionless transmission

A system that only scales and delays, y(t)=Kx(t−t0), has

H(jω)=Ke−jωt0

a flat magnitude and a linear phase, ϕ=−ωt0. Unequal gains cause magnitude distortion; a phase that isn't a straight line through the origin causes phase distortion: frequencies arrive at different times and edges smear.

Delay

τg(ω)=−dϕdω(group delay),τp(ω)=−ϕ(ω)ω(phase delay)

The group delay is how late the envelope of a narrowband signal near ω arrives. For an RC low-pass, ϕ=−arctan⁡ωτ and τg=τ/(1+ω2τ2): τ at low frequencies, half that at the corner. A symmetric FIR filter of N taps has exactly linear phase, delaying everything by (N − 1)/2 samples.

Ideal filters

The ideal low-pass, H=1 for |ω|<ωc and 0 above, has

h(t)=sin⁡ωctπt=2fcsinc(2fct)

with sinc(x)=sin⁡(πx)/(πx): height 2fc, zeros every 1/(2fc), and nonzero for t < 0. Ideal high-pass, band-pass and band-stop filters are built from it, and none is causal.

Worked example

An RC low-pass has τ = 1 ms. What is its group delay at low frequencies and at its corner?

Show the solution
  1. Group delay of the RC low-pass. τg=τ1+ω2τ2
  2. Near DC. It's τ = 1 ms.
  3. At the corner. There ωτ = 1, so it's τ/2 = 0.5 ms.
  4. What that means. Frequencies near the corner arrive earlier than low ones, which is a small amount of phase distortion.

Answer 1 ms at low frequencies and 0.5 ms at the corner.

Worked example

An 11-tap FIR filter has symmetric coefficients. What is its phase at ω = π/4?

Show the solution
  1. Linear phase. Symmetry makes the phase −5ω (the center tap is 5 samples in), wherever the gain is positive.
  2. At π/4. −5ω=−5π/4=−225°
  3. No distortion. Every frequency is delayed by exactly 5 samples: no phase distortion.

Answer the phase is −5π/4, or −225°, a delay of exactly 5 samples.

Worked example

The ideal low-pass with cutoff ωc=π/4 has h[n]=sin⁡(ωcn)/(πn). Find h[0], h[2] and h[4], and say why it can't be built.

Show the solution
  1. h[0]. The limit at n = 0: h[0]=ωc/π=0.25
  2. h[2] and h[4]. h[2]=sin⁡(π/2)/(2π)=0.159h[4]=sin⁡(π)/(4π)=0
  3. Why it can't be built. The response extends forever in both directions, with samples before n = 0, so it's non-causal and infinitely long.
  4. In practice. Practical filters truncate and delay it, which costs a gradual transition band and ripple.

Answer h[0] = 0.25, h[2] = 0.159 and h[4] = 0. It can't be built because it's non-causal and infinitely long.

Check

A pure delay of 0.5 ms. What phase shift does it give a 100 Hz sinusoid, in degrees?

Check

What is the group delay of an RC low-pass with τ = 2 ms at 100 Hz?

Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.

Check

An ideal low-pass filter cuts off at 2 kHz.

(a)

What is the height of its impulse response's peak, per millisecond?

(b)

Where is its first zero after t = 0?

Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.

Check

A symmetric FIR filter has 21 taps. How many samples does it delay every frequency?

Check

A system's phase is ϕ=−2πft0−ϕ0 with t0 = 1 ms and a constant ϕ0 = 30°.

(a)

What is its group delay?

Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.

(b)

What is its phase delay at 500 Hz?

Check

An RC low-pass uses R = 1 kΩ and C = 10 nF. What is its 3 dB bandwidth?

Write units the way you normally would: 1.5 Hz, 1500 mHz and 0.0015 kHz are the same answer.

Check

A filter passes 1 kHz with gain 1 and 3 kHz with gain 1, but delays 3 kHz by 0.2 ms more than 1 kHz. What happens to a square wave at 1 kHz?

Check

A linear-phase FIR filter has 31 symmetric taps and runs at 1 kHz.

(a)

What is its delay in samples?

(b)

And in milliseconds?

Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.

Check

An RC low-pass has τ = 1 ms.

(a)

What is its group delay where ωτ = 0.5?

Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.

(b)

At what frequency is that?

Explain why

Why does a perfectly flat magnitude still not guarantee an undistorted output?

Practice

Keep practicing

11 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.