Skip to content
You Start with one site
Amounts in Start with one site
Measurement · Concept

Sampling and aliasing

One idea Intermediate 5 min read
Found this useful?

In a film, the wheels of a moving car can seem to turn slowly, or even backwards. The camera takes its pictures too far apart to follow the spokes. A data logger can make the same error. Sampling is reading a signal at fixed moments, and aliasing is the false slow pattern that appears when those moments are too far apart.

Yes, the log is data?The log holds one moment in every five minutes. The rest was never seen.Not proved
The sensor is faulty?Every single reading is correct. The pattern between them is not.No fault
The readings are too far apart?A fast cycle read slowly appears as a slow cycle.This is aliasing

See it

Predict first

The air in a cold room warms and cools once every 6 minutes as the compressor stops and starts. A logger stores one reading every 5 minutes. What does the log show?

See it: one room, read at the interval you choose

Readings in each cycle
True period of the room
Period the log shows

The thin line is the room. The dots are the only moments the logger sees, and the thick line is the picture a person draws from them. Every dot is a correct reading. With fewer than two dots in each cycle, the picture is wrong.

The idea

A logger sees a signal at one moment, then nothing until the next. The time between two readings is the sampling interval, written Δt.

For a signal that repeats with period T, the rule is short: you need more than two readings in each cycle, so Δt must be shorter than T ÷ 2. With fewer, the readings still form a regular wave, but a slower one. That false wave is the alias.

fa = | f − k × fs |

f = 1 ÷ T is the true frequency, fs = 1 ÷ Δt is the sampling frequency, fa is the frequency the log shows, and k is the whole number that makes fa smallest

The worst case is Δt equal to T. Every reading then falls at the same point of the cycle, and the log shows a steady value. A real machine does not repeat exactly, so its alias is often an irregular error and not a clean wave. The rule of T ÷ 2 is for an even cycle. A machine that is on for a short time in a long cycle needs Δt no longer than its shortest on time, or some runs fall between two readings and are never seen.

One worked number

The question

A cold room temperature cycles with a period of T = 6 min. The logger reads every Δt = 5 min. What period does the log show?

Show the worked solution, 3 steps
  1. Check the rule

    T ÷ 2 = 3 min. The interval of 5 min is longer than that, so there are only 6 ÷ 5 = 1.2 readings in each cycle. An alias will appear.

  2. Write the two frequencies

    f = 1 ÷ 6 per minute and fs = 1 ÷ 5 per minute. With k = 1, fa = 1/5 − 1/6 = 6/30 − 5/30 = 1/30 per minute.

  3. Turn it back into a period

    1 ÷ (1/30) = 30 min. The log describes a room that cycles every 30 min. The figure opens on this case: count the dots from one peak of the thick line to the next.

The mistake to avoid

A slow, regular pattern in a coarse log is not proof of a slow cycle in the machine. Before you believe it, compare the sampling interval with the real cycle time of the equipment. And an alias cannot be removed afterwards: no calculation on the stored readings can tell a true 30 minute cycle from an aliased 6 minute one. The protection is a shorter interval, or a meter that averages before it stores.

The lesson on sampling intervals and aggregation shows what the same error does to an energy total.

Check yourself

Question 1

A fan switches on and off with a period of 7 min. Its state is logged every 6 min. What period appears in the log?

Question 2

A pump starts and stops with a period of 10 min: 5 min on, then 5 min off. What is the longest sampling interval that still lets you count its cycles?

Question 3

A log with one reading every 15 min shows a compressor load that rises and falls smoothly every 2 hours. A colleague wants to smooth the data with software to find the true cycle. What do you answer?

Where you meet it

  • A cold room loggerA thermostat cycle of a few minutes, read every 5 or 15 min, appears as slow waves or as a steady value.
  • The energy of a cycling compressorIn the lesson, power read every 15 min gave between 6.9 and 9.6 kWh for a day that truly used 8.08 kWh.
  • Vibration measurementAn analyser that samples too slowly shows a fast vibration at a low frequency, so it filters the signal before it samples.
Key points
  • A logger sees only the moments it reads. What happens between them is lost.
  • To follow a cycle of period T, read more than twice in each cycle: Δt shorter than T ÷ 2.
  • Read too slowly and a false slow pattern appears: the alias.
  • An alias cannot be removed from stored data. Choose the interval before you log.
Practice

Found this useful?

Discussion

    Comments show your name. Be kind, stay on the topic.