Skip to content

Sampling, clipping and aliasing

Interactive: pick a sampling frequency

The dense signal above is \(y = 3 + 3\sin(2\pi \cdot 10 t)\) — a 10 Hz tone. Pick \(f_s\) below. Red dots are the samples; the blue line joins them, so you see the (possibly aliased) frequency the digital system believes in. Nyquist says \(f_s > 2f = 20\) Hz keeps the true 10 Hz.

At \(f_s = 15\) Hz: \(f_a = |10 - 15 \times \mathrm{NINT}(10/15)| = 5\) Hz — aliasing. Try 30 Hz to fix it, or 4 Hz to see the \(2\) Hz twin of the \(6\) Hz case.

Estimate the aliasing using the folding diagram or the formula:

if \(f_s > 2 f\) , no aliasing

if \(2/3 f < f_s < 2 f\), \(f_a = |f_s - f|\)

if \(f_s < 2/3 f\), \(f_a = (f/f_f)f_f\), where \(f_f = f_s/2\)

in most cases: $\(f_a = \left|f- f_s \cdot NINT (f/f_s) \right|\)$

How do we use it? we use trial/error and smart guesses:

let's check different options:

if it's aliasing we could be in one of the two regions, either 6 Hz < 2/3 f, i.e. f > 1.5*6, f > 9 or

it can be that 6Hz is above 2/3f and below 2f, i.e. f is between 3 and 9 Hz

theoretically speaking if f is below 3Hz, then we're above the Nyquist frequency.

So, we see 2 Hz (2 peaks in 1 second) so it can be that we sampled correctly using 6 Hz or incorrectly and got aliasing.

Therefore we could test few things, but first let's prepare some options:

  1. if we are fine and 2Hz is there, so we just see not a nice sine signal and we can increase the sampling frequency and get it nice

  2. if we are aliasing, then it can be what? 2Hz = |f - 6Hz * NINT(f/6Hz)|, so f = 6Hz * NINT(f/6Hz) + 2Hz. Let's see if 10 Hz is reasonable: 10/6 = 1.6667 and the nearest integer is 2 and it means that 10 - 6*2 = 2 Hz.

  3. it can be also lower than 6Hz and we got 2Hz for instance if we sampled f = 4Hz