1.Why should I care?
A digital system only knows the world at the moments it takes samples. Sample too slowly and it does not just miss detail: it sees things that are not there. Choosing a sample rate is one of the first decisions in any sensing project.
- ◇ Convert between sample rate and sample period, and count samples in a recording.
- ◇ Calculate samples per cycle and explain why fewer than two per cycle cannot represent a wave.
- ◇ Describe aliasing with an everyday example and say how engineers avoid it.
2.Watch
→ Notice that the camera takes separate pictures (samples). Ask: how far does the wheel turn between two frames?
The wagon-wheel effect: a camera samples too slowly for a fast wheel, so the frames show a slow, false motion. Aliasing you have already seen.
Length: see YouTube · captions on YouTube · source
Nothing loads from YouTube until you press play.
The video is optional: everything you need is also in the lesson text and the interactive.
3.Predict
A signal goes up and down 9 times a second. You sample it 10 times a second. What wave do your samples seem to show?
Guess first. Being wrong here is how the surprise works.
4.Discover
Set the signal to 9 Hz and the sample rate to 10 Hz. Untick the real signal: what do the dots show? Now raise the sample rate until the readout stops warning you. How many samples per cycle did that take?
Loading the interactive…
Can't use the interactive? Read a description instead
In the signal lab, a 9 Hz wave sampled 10 times a second gives dots that trace a slow 1 Hz wave: the readout warns that there are fewer than 2 samples per cycle. Raising the sample rate above 18 Hz removes the warning, and around 40–60 Hz the dots clearly follow the real wave's shape.
5.Checkpoint: guided practice
Check what you just discovered before going on. Hints appear after a wrong answer.
Practice 1 · a fresh version every time
You sample a 1 Hz signal at 10 Hz. How many samples land in each cycle of the signal?
6.Understand
Rate and period
The sample rate fs is samples per second (Hz); the sample period is the time between samples, 1 ÷ fs. A greenhouse logger sampling at 0.1 Hz takes one reading every 10 s; an audio recorder at 44,100 Hz takes one every 22.7 µs. Samples recorded = rate × duration: 50 Hz for 60 s gives 3,000 samples.
Samples per cycle
Divide the sample rate by the signal frequency to get samples per cycle. Ten or more show the wave's shape clearly. Between two and about five catch the frequency but the shape looks rough. Fewer than two per cycle cannot represent the wave at all. So a signal with frequency f needs a sample rate of more than 2f: half the sample rate is the highest frequency you can capture.
Aliasing and how to avoid it
When a signal is too fast for the sample rate, its samples line up into a slower, false wave: an alias. A 9 Hz wiggle sampled at 10 Hz pretends to be 1 Hz, and no maths afterwards can tell the difference. Engineers prevent it by sampling fast enough for every frequency present and by filtering out faster wiggles (like mains hum) before the ADC.
Explain it another way
Imagine photographing a spinning fan with a flash once a second. If it spins almost exactly once between flashes, each photo shows it nearly still, creeping slowly: your photos tell a lie about its speed.
The Nyquist–Shannon sampling theorem: a signal containing no frequencies at or above fs/2 can be reconstructed from its samples. Anti-aliasing filters (low-pass) remove content above fs/2 before conversion.
Sample period = 1/fs. Samples per cycle = fs/f; need fs/f > 2. A sine of frequency f sampled at fs appears at |f − k·fs| for the nearest whole number k: 9 Hz at 10 Hz → |9 − 10| = 1 Hz.
Music is sampled at 44.1 kHz because people hear up to about 20 kHz: 44.1 > 2 × 20. A motor vibration monitor sampling too slowly can report a slow wobble that is not really there.
Worked example 1
You want to measure 50 Hz mains hum on a sensor line. What is the slowest sample rate that could possibly capture it, and what would you actually choose?
More than 2 × 50 = 100 Hz is the bare minimum. To see the shape you might choose 1,000 Hz: 20 samples per cycle.
Worked example 2
A logger samples at 250 Hz for 30 s. How many samples?
250 × 30 = 7,500 samples.
Common mix-ups
- Sampling too slowly just makes the wave a bit rough.
✓ Below two samples per cycle the samples show a different, false frequency. That is worse than roughness: it is wrong information. - You can fix aliasing later with clever software.
✓ Once aliased, the false wave looks exactly like a real slow one. Prevent it with a fast enough rate and a filter before sampling.
7.Practice on your own
Practice, not a test. Wrong answers get a hint and another try.
Practice 2 · a fresh version every time
A data logger samples at 1000 Hz for 2 s. How many samples does it record?
Practice 3
A sensor is sampled at 200 Hz. How long is the gap between samples, in milliseconds?
Practice 4
A 48 Hz vibration is sampled at 50 Hz. What frequency do the samples seem to show, in Hz?
Practice 5
A heart-rate signal contains rhythms up to 3 Hz. Which sample rate is the smallest that could work?
8.Apply it
Pick sample rates for three sensors in the greenhouse: air temperature (changes over minutes), a fan's speed sensor (pulses up to 40 times a second) and a microphone listening for a failing pump bearing (sounds up to 5 kHz). Justify each with the 'more than twice' rule and a margin.
9.Reflect
Concepts: Signals: amplitude, frequency and period · Sampling rate and aliasing