• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Digital (Audio) Aliasing

amirm

Founder/Admin
Staff Member
CFO (Chief Fun Officer)
Joined
Feb 13, 2016
Messages
44,971
Likes
244,923
Location
Seattle Area
Author: our resident expert, DonH50

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:

upload_2017-9-12_21-37-11.png

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
 

danadam

Major Contributor
Joined
Jan 20, 2017
Messages
1,057
Likes
1,616
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.

What would be the source of this higher-frequency content?
 

danadam

Major Contributor
Joined
Jan 20, 2017
Messages
1,057
Likes
1,616
Just found the answer in the other article:
It is important to note that, while a DAC cannot be driven by a signal >= Fs/2, it can produce output signals higher than that. In fact, the signals from Fs/2 will be replicated at all multiples of Fs/2, producing a wide range of output signals. It is probably easiest to think of this as the opposite of aliasing in an ADC; at the output of a DAC, images occur at multiples of Fs/2. There are of course other less desirable outputs, also broadband, such as glitches, ringing, distortion, clock feed through, and other spurious products.
 
OP
amirm

amirm

Founder/Admin
Staff Member
CFO (Chief Fun Officer)
Joined
Feb 13, 2016
Messages
44,971
Likes
244,923
Location
Seattle Area
Indeed it is routine to see spurious response outside of the sampling bandwidth in the form of noise and lack of the ability of the reconstruction filter to suppress them. Here is an example from my AVR Tests: https://audiosciencereview.com/forum/index.php?threads/a-deep-dive-into-hdmi-audio-performance.56/

index.php


The sampling rate is 48 Khz so there should be nothing above 24 Khz but of course we see plenty. The source signal is 12 Khz squarewave so has odd harmonics going to infinity and those show up if not suppressed 100%.
 

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
8,020
Likes
16,956
Location
Monument, CO
One thing to note is that my original article explains a Nyquist (conventional) DAC, not one using a delta-sigma modulator. The noise shaping of the latter is partly why you see such a large rise in the noise floor in Amir's picture above. Since delta-sigma DACs are ubiquitous these days, you will notice that most all DAC results have that rising noise floor in addition to the signal images. Normally an anti-image filter at the DAC's output is used to suppress both out-of-band images and noise.
 

Blumlein 88

Grand Contributor
Forum Donor
Joined
Feb 23, 2016
Messages
21,214
Likes
38,576
Hope this helps rather than confuses. Results from a 24/96 DAC signal recorded by a 24/192 ADC. So the FFT graph covers 0-96 khz.

The green is high level white noise in a 24/96 khz file. It lets you see the shape of the reconstruction filter.

Red is a snapshot of a slow sweep when the sweep frequency was near 40 khz.

The white dotted line is near 48 khz. or the nyquist frequency of the 96 khz sample format.

You see a reflection of that 40 khz sweep near 56 khz. Reduced in level by the reconstruction filter.

48khz -40 khz is an 8 khz difference. The reflection is 48khz plus 8 khz or 56 khz. The portion from 48-96 khz in this graph is a reverse reflection of the 0-48 khz portion. So the images are reflected around the nyquist frequency of 48 khz as Don has explained.

Ignore the spikes at 31 and 62 khz as they are idle tones in the ADC. The rising noise floor above 55 khz is due to this being a sigma delta DAC.

Also there is a reflection of the sweep tone at 8 khz. though at a low level of -115 db.

Thanks to Don for taking the time to write these articles. If my contribution is confusing rather than helpful let me know and I will delete it. Or Amir can delete it.

96 k filter and imaging.png
 

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
8,020
Likes
16,956
Location
Monument, CO
Great addition; clearly shows how the filter works to suppress images and the rising noise floor.

One of the articles does address delta-sigma converters.
 
Top Bottom