Electronics School · Stage 6: Advanced Electronics and Engineering · Lesson 34

Frequency and Filters

Letting the signals you want through, and blocking the noise.

The question

Your temperature readings jitter up and down by a few tenths of a degree every second. How do you smooth them out without hiding real changes?

What you’ll discover: how resistors and capacitors make filters, how to calculate a filter’s cutoff frequency, what resonance is, and how software can filter too.

In simple terms

BeginnerFast and slow signals

Every signal can be thought of as a mix of slow and fast changes. Outdoor temperature changes slowly. Electrical noise, like interference from a motor or a switching power supply, changes very fast. A filter lets some frequencies through and blocks others.

  • A low-pass filter lets slow signals through and blocks fast ones: good for smoothing a sensor.
  • A high-pass filter does the opposite: it blocks steady (DC) voltage and passes changes, like the capacitor that blocks steady current from a speaker (Lesson 26).

The RC filter

A resistor and capacitor make the simplest filter. For a low-pass filter, the signal goes through the resistor, and the capacitor connects from the output to ground. The capacitor needs time to charge (as in the Fading Light), so it can’t follow fast changes.

The cutoff frequency, where the filter starts to block, is:

fc = 1 ÷ (2π × R × C)

Example: R = 10 kΩ and C = 100 nF give fc = 1 ÷ (2 × 3.14 × 10,000 × 0.0000001) ≈ 159 Hz: signals well above that are weakened, and at the cutoff the output has dropped to about 71%. Swap the resistor and capacitor and you have a high-pass filter with the same cutoff. A hardware filter like this is good for removing fast electrical noise; slow jitter in a temperature reading is best smoothed in software (below).

Go deeper

IntermediateResonance

A coil (inductor) and a capacitor together make a resonant circuit: energy sloshes back and forth between them at one natural frequency:

f = 1 ÷ (2π√(L × C))

That’s the tuned circuit in a radio (Lesson 25): it responds strongly to one frequency and weakly to all others. Turning the tuning knob changes L or C, moving the resonant frequency to a different station.

AdvancedFiltering in software

Once a signal is digitized, a program can filter it too. The simplest digital low-pass filter is a moving average: report the average of the last few readings. Averaging 10 readings reduces random noise considerably, but it also delays and softens real changes. Another common choice is the exponential filter:

smooth = smooth + 0.1 * (reading - smooth)

A smaller number (like 0.05) smooths more but responds more slowly. Choose based on how fast the real quantity can change: outdoor temperature rarely changes by much in a few seconds, but a chinook can raise it several degrees within an hour, and your filter must not hide that.

One more rule: to measure a signal digitally, you must sample more than twice as fast as the fastest change in the signal (the Nyquist rule), or fast changes masquerade as slow ones. Filtering before sampling prevents that.

Quick check

What does a low-pass filter do?

It passes slow changes and blocks fast ones, like smoothing noise from a sensor.

What is the cutoff frequency of an RC filter with R = 10 kΩ and C = 100 nF?

About 159 Hz.

What is the trade-off of a moving average filter?

More averaging reduces noise but delays and softens real changes.

Words to know

Filter
A circuit or program that passes some frequencies and blocks others.
Cutoff frequency
The frequency where a filter starts to block.
Resonance
A circuit’s strong response at one natural frequency.
Moving average
The average of the most recent readings, used to smooth data.

Electronics School is part of the Discovery Zone. Every activity here runs on small batteries or a USB cable: never wall outlets. The one plug-in tool is the optional soldering iron, set up by an adult.

Was this page helpful?
Get all four of our sites in one free email every Friday: Prairie Signals
⇧Top
Hello! “Know what you want, or you'll have to like what you get.”