Sampling - Digitizing an analog signal

When digitizing an analog signal, we measure the signal amplitude at specific points in time. These measurements are done periodically, at what we call the sampling rate. The measured amplitude values can be stored as a series (list) of numbers, and this is the data we manipulate when doing digital signal processing.

A Sine wave
A Sine wave sampled at fine resolution
A Sine wave sampled at coarse resolution

The Nyquist frequency

The highest frequency we can represent with a digital signal is determined by the sampling rate. According to the Nyquist theorem, the theoretical highest frequency we can represent is at half the sampling rate. Obviously, the digital representation of a sine wave at half the sampling frequency will no longer look like a sine wave when represented digitally. When the signal is converted back to analog audio, these shapr edges are smoothed out, so we actually will get back a sine wave on the audio output.

A Sine wave at the Nyquist frequency (sampling rate / 2)

The above theoretical example also requires that our audio signal and sampling rate are perfectly aligned (in phase). Let's see what happens if the two are exactly out of phase.

A Sine wave at the Nyquist frequency (sampling rate / 2), sampled out of phase

Given the above, our recommendation is to use at least four times higher sampling rate than the highest frequency you want to represent digitally.

A Sine wave digitized at sampling rate / 4