Aliasing in a nutshell

Suppose you have a sine wave with frequency f0 Hz.

We’re going to discretize this signal by sampling it fs times per second. That is, we’re going to evaluate S at integer multiples of

h = \frac{1}{f_s}.

The result is the sequence

\sin(2\pi f_0 hn)

where n runs through the integers.

Next, let k be an integer and consider the sine wave

A(t) = \sin(2\pi(f_0 + k f_s)t).

(Foreshadowing: A is for “alias.”)

Now let’s sample A at the same frequency as S, i.e. fs Hz. This gives us the sequence

\sin(2\pi(f_0 + kf_s)hn).

A short derivation shows

\begin{align*} \sin(2\pi(f_0 + kf_s)hn) &= \sin(2\pi\left(f_0 + k/h\right)hn) \\ &= \sin(2\pi f_0 hn + 2\pi kn) \\ &= \sin(2\pi f_0 hn) \end{align*}

which is exactly what we got from sampling S.

To recap, sampling a signal of f0 Hz at a rate of fs Hz produces the same samples as sampling a signal of f0 + kfs Hz at the same rate for any integer k.

So, for example, if we’re sampling signals at 1000 samples per second, then we’ll get the same samples whether we’re sampling a signal of 440 Hz or 1440 Hz or 2440 Hz etc.

Periodic sampling cannot distinguish frequency components that differ by an integer multiple of the sampling frequency.

If a signal has components at 440 Hz and at 1440 Hz, and we sample at 1000 Hz, all the information from the higher frequency component is aliased, added to the samples of the 440 Hz component.

If a signal contains frequencies between –B and B, you can avoid aliasing by sampling at a rate higher than 2B. In practice this may mean that your signal has frequency components outside the interval [-B, B] but these components are small enough to ignore.

A good rule of thumb is to sample at a frequency of at least 2.5B and not just the theoretical minimum of 2B. For more on this, see The Engineer’s Nyquist frequency.

One thought on “Aliasing in a nutshell

Comments are closed.