How to calculate alias frequencies in digital audio

At a 44.1 kHz sample rate, every sampled tone is represented somewhere between 0 Hz and the 22.05 kHz Nyquist frequency. A component above that boundary does not keep its original frequency after sampling. It folds into the available band.

Knowing the definition only gets you halfway. Once you understand how the Nyquist limit creates audio aliasing, the practical job is working out exactly where an offending component lands. No guesswork.

Alias frequency comes from the nearest sample-rate multiple​

For a single tone, the cleanest calculation is to compare its frequency with the nearest whole-number multiple of the sample rate. If the input frequency is f and the sample rate is fs, choose the integer k nearest to f divided by fs, then calculate the absolute difference between f and k times fs. The result falls between 0 and fs divided by two.

Take a 30 kHz component in a 44.1 kHz session. The nearest sample-rate multiple is 44.1 kHz, so the difference is 14.1 kHz. Your analyzer will therefore show the aliased component at 14.1 kHz, not at 30 kHz.

A 50 kHz component lands somewhere else even though it is further above Nyquist. Subtracting the nearest 44.1 kHz multiple leaves 5.9 kHz, so 50 kHz aliases to 5.9 kHz. A higher source frequency does not imply a higher alias.

The arithmetic gets more useful once the source crosses more than one sample-rate interval. A 70 kHz component at 44.1 kHz is closer to 88.2 kHz than to 44.1 kHz, leaving an 18.2 kHz difference. A 96 kHz component is 7.8 kHz above 88.2 kHz, so its sampled alias is 7.8 kHz.

You can reach the same answer with a remainder calculation. Divide the source frequency by the sample rate and keep the remainder. If the remainder is below 22.05 kHz in a 44.1 kHz session, keep it; if it is above 22.05 kHz, subtract it from 44.1 kHz.

Nyquist zones make the folding direction alternate​

Frequency folding repeats in bands that are each half a sample rate wide. The first Nyquist zone runs from 0 to 22.05 kHz at a 44.1 kHz rate, the second from 22.05 to 44.1 kHz, the third from 44.1 to 66.15 kHz, and the fourth from 66.15 to 88.2 kHz. Odd zones run upward in apparent frequency while even zones run downward.

A lone sine wave hides an important detail because you only see one peak. Feed in two components at 26 kHz and 30 kHz and they alias to 18.1 kHz and 14.1 kHz respectively. Their order reverses, which is why an aliased band can have its spectrum flipped rather than merely shifted downward.

The same frequency ambiguity across several Nyquist zones matters when distortion creates harmonics far above the sampling rate. A 9 kHz tone driven hard enough to produce a 45 kHz fifth harmonic will put that harmonic at 900 Hz in a 44.1 kHz system. Its seventh harmonic at 63 kHz folds to 18.9 kHz instead.

Those numbers explain why aliased distortion can sound unrelated to the musical harmonic series. The generated harmonics may begin as exact integer multiples of the input, yet repeated folding throws them into places that no longer preserve those ratios. Simply knowing which harmonics crossed Nyquist is not enough; you need to calculate where each one returned.

Exact Nyquist hits need more care​

A frequency exactly at half the sample rate is a boundary case, not a normal high-frequency tone with comfortable headroom. At 44.1 kHz, a 22.05 kHz sinusoid gets only two sample positions per cycle. The sampled result depends strongly on phase.

A cosine aligned with the sampling clock can appear as alternating positive and negative values at Nyquist. A sine wave sampled at its zero crossings can instead produce zeros at every sample even though the continuous signal has energy. Moving the phase changes the sample values without changing the frequency.

Integer multiples of the sample rate have a similar trap. A cosine at 44.1 kHz sampled at 44.1 kHz can produce a constant sequence and therefore appear at DC, while a suitably phased sine can collapse to zeros. The usual alias-frequency formula tells you where the component maps, but not whether its sampled amplitude survives a special phase relationship.

In a plugin test, do the calculation in two passes. Find every generated component first, then fold each frequency into the range from 0 to half the current sample rate. A clipper generating 27 kHz, 45 kHz, and 63 kHz products in a 44.1 kHz session puts them at 17.1 kHz, 900 Hz, and 18.9 kHz, three destinations you would never guess from the original harmonic order alone.
 

Attachments

  • How to calculate alias frequencies in digital audio.webp
    How to calculate alias frequencies in digital audio.webp
    282.3 KB · Views: 1

Sponsored

Top