What does a filter do to a square wave?

Predict · 9 min

A Bode plot says what a filter does to sine waves, one frequency at a time. But a square wave is a mixture of many frequencies: a fundamental, plus sharp edges made of high harmonics (module 03.5 takes it apart).

So a filter changes a square wave's shape:

  • a low-pass keeps the slow part and smooths off the edges;
  • a high-pass keeps the edges and loses the slow, flat tops.

How much depends on where the corner is compared with the square's frequency. Here are four outputs:

Match each waveform in the picture to its filter. "Corner far below" means the filter's corner is well below the square wave's frequency; "far above", well above it.

Match each of these:

  • Waveform A
  • Waveform B
  • Waveform C
  • Waveform D

with one of these:

  • High-pass, corner far above: only the edges get through, as spikes
  • High-pass, corner far below: a square whose flat tops sag a little
  • Low-pass, corner far below: smoothed nearly to a small triangle
  • Low-pass, corner far above: a square with rounded edges

On the board, a 1 kHz square wave goes into a low-pass with its corner at 159 Hz, well below. What will channel 2 show?

  • A small triangle wave
  • A square with rounded corners
  • Spikes at each edge

Press Run.

Now the same square wave into a high-pass with the same 159 Hz corner. What will channel 2 show?

  • A small triangle wave
  • The square wave, its flat tops sagging
  • Spikes at each edge

Press Run.

One circuit, two views:

FilterCorner vs signalSquare wave comes out as
low-passfar aboverounded edges
low-passfar belowa small triangle (integrated)
high-passfar belowsagging tops
high-passfar abovespikes at the edges (differentiated)

A rounded edge is a missing high frequency; a sagging top is a missing low one. Reading which is gone, from a waveform, is one of the most useful habits in electronics.

On a real bench a scope probe's compensation is adjusted with exactly this: probe a square-wave test signal and turn the little screw until the edges are neither rounded nor peaked. Sagging tops on a square wave through an audio amplifier show its coupling capacitors cutting the bass.