Aliasing 101

DonH50

Member Sponsor & WBF Technical Expert
Jun 22, 2010
3,947
306
1,670
Monument, CO
Here's an attempt to explain aliasing -- the frequency folding that happens whenever you sample a signal. As was discussed in the Sampling 101 thread, whenever you sample a signal at a rate of X samples/sec (X S/s), the highest output signal is < X/2, the Nyquist rate. That is, when sampling at fs, any frequency equal to or greater than fs/2 will be aliased to fall with the frequency band from 0 to < fs/2.

For CD-rate sampling at 44.1 kS/s, we can convert a signal no higher than 22.05 kHz, or aliasing will occur. If the ADC has sufficient bandwidth, it can capture a signal higher than that, but it will be folded back (aliased) into that 0 - 22.05 kHz region. If the ADC is perfect, the amplitude and phase will be unchanged, but the frequency will be reflected about the Nyquist frequency, 22.05 kHz. A picture may help:

20100807 aliasing .jpg


This picture shows a frequency (x) axis with the Nyquist frequency (fs/2), sampling frequency (fs), and third Nyquist frequency (3fs/2) indicated. There are four frequencies, A-D, shown as single tones (black spikes). I have also drawn blue triangles to help us see what happens as frequencies exceed Nyquist.

Signal A is in the first Nyquist band (baseband) and is not affected. If we apply this as an input to an ADC, or output to a DAC, it will come out just as we intended (assuming we have no other errors).

Signal B is just over the first Nyquist frequency and so is aliased back to baseband, as shown by the dotted line and new frequency in red. If we apply this input to an ADC (or DAC), it is folded across the triangle (aliased) back to the first Nyquist band.

Signal C is above the sampling frequency, in the third Nyquist band (third region from the left 0 Hz point). Note the slope of the triangle; we can draw a line from this signal all the way to baseband, where we see a very high frequency appears now as relatively low-frequency output from the ADC (or DAC).

Signal D, up in the fourth Nyquist band, is a little more interesting. Note the slope of the triangle is down instead of up, so we must first reflect it about the 3fs/2 Nyquist point to generate the (dashed red) intermediate signal, and then it is easy to translate to baseband. Think of picking up that high triangle and putting it down on top of the green "good" baseband triangle. Again, a very high signal is converted to a low one as a result.

IF our ADC (or DAC) is perfect and has infinite bandwidth (or at least more than enough for these examples), then the tones above Nyquist are perfectly recreated in baseband except that their original frequency content is lost. To prevent this from happening, and perhaps more importantly to ensure only baseband signals are converted, an anti-alias filter must be placed before the ADC to prevent higher-frequency signals from reaching its input. Any higher-frequency signals that are converted will be aliased to baseband, where we cannot tell if they are part of the music or some noise that got coupled in and converted because the ADC does not know any better.

A special note about DACs is that, although they cannot be fed a signal above Nyquist and properly recreate it, their output can contain higher-frequency content as the output of a DAC is after the sampling point. So, a filter is usually used at a DAC’s output to prevent high-frequency noise from blasting through the rest of the system, which in audio means saving our tweeters!

HTH – Don
 
Last edited:

DonH50

Member Sponsor & WBF Technical Expert
Jun 22, 2010
3,947
306
1,670
Monument, CO
"Folding" is the term used because the higher frequency is aliased, or "folded", around the Nyquist frequency back to some place in baseband (i.e. a lower frequency). Hey, I don't invent this stuff, just try to define it! :) - Don
 

amirm

Banned
Apr 2, 2010
15,813
37
0
Seattle, WA
herefore, if a waveform comes in violating nyquist at a higher frequency, then we can not sample it twice each cycle, but we still sample it at our highest sampling rate and thus whatever "points" we sample are reconstructed.
In reality, that never happens. Audio equipment will always pre-filter to the Nyquist limit so the Analot to Digital converter doesn't see those higher frequencies (ideally that is).
 

amirm

Banned
Apr 2, 2010
15,813
37
0
Seattle, WA
And advance note :): when content ins synthetically created, it can exceed the response of the system. Good example is the video equiv. of square wave. You can have a totally white pixel next to a black pixel. This cannot be captured in real life but a computer faithfully creates it as you are seeing in this very screen. In the old days of analog monitors, this cause lots of problems when we output the signal. Today, our displays are "digital" in that respect so they are able to reproduce such "impossible" signals.
 

DonH50

Member Sponsor & WBF Technical Expert
Jun 22, 2010
3,947
306
1,670
Monument, CO
And it happens in audio, too, at the output of our DACs. That was one of the problems with a lot of early units: DACs putting out way more bandwidth (and all sorts of switching artifacts) than the buffers/drivers could handle, and the resulting distortion. I'm not sure where we stand vis-a-vie that today. I commented in the sampling thread on this issue.

Relating to another Don'ism, another case of the computer doing what we tell it, not what we want! :) - Don
 

DonH50

Member Sponsor & WBF Technical Expert
Jun 22, 2010
3,947
306
1,670
Monument, CO
I don't know what Amir is using, but I'll toss this out:

A Nyquist ADC operating at 44.1 kS/s requires an extremely steep filter if you want to capture 20 kHz and yet attenuate everything over Nyquist (22 kHz) to below the resolution threshold (say 98 dB). Even if such a high-order filter is realizable, the in-band phase shift is likely to be very high from all the poles (and zeros); that was one of the issues with early CDs. Oversampling ADCs, such as delta-sigma designs, sample well above that (perhaps 32 - 64x) and thus a much gentler (lower-order) filter slope is needed, with much less in-band degradation. That is one of their advantages.
 

About us

  • What’s Best Forum is THE forum for high end audio, product reviews, advice and sharing experiences on the best of everything else. This is THE place where audiophiles and audio companies discuss vintage, contemporary and new audio products, music servers, music streamers, computer audio, digital-to-analog converters, turntables, phono stages, cartridges, reel-to-reel tape machines, speakers, headphones and tube and solid-state amplification. Founded in 2010 What’s Best Forum invites intelligent and courteous people of all interests and backgrounds to describe and discuss the best of everything. From beginners to life-long hobbyists to industry professionals, we enjoy learning about new things and meeting new people, and participating in spirited debates.

Quick Navigation

User Menu

Steve Williams
Site Founder | Site Owner | Administrator
Ron Resnick
Site Co-Owner | Administrator
Julian (The Fixer)
Website Build | Marketing Managersing