# What's the impact of aliasing in the time domain?

I've been studying digital audio and come across something I can't understand. There appears to be something like a consensus (among those capable of understanding such things) that the impact of aliasing on reconstructed time-domain signals is to ... smear(?) the timing. (Is that the right way to put it?) Here's a quote from a paper by Bob Stuart and Peter Craven, two prominent, respected figures in the audio industry: "Aliasing in the frequency domain is equivalent to the time-domain phenomenon of an impulse response that depends on where, relative to the sampling instants, the original stimulus was presented: see footnote 8." Footnote 8, which refers to a different passage in the article, says, "The complication is that because of the sampling, the total system is not time-translation invariant and so does not have a unique ‘impulse response’ – the response is slightly different according to the position of an original impulse relative to the sampling points."

I did some thinking, and some simple modeling, and came to the conclusion that the effect of aliasing on the reconstructed time-domain signal is to alter the amplitude in a quasi-random way. At the actual sampling instants, the deviation of the reconstructed signal from the original signal resulting from aliasing is zero: At precise sampling instants, aliasing has no effect. But in between those instants there are amplitude errors in the reconstructed signal. This is my conclusion from my own analysis. This is broadly true; I did not do an analysis specifically to determine the effect of aliasing on impulse response.

I cannot see how my conclusion--that of added amplitude noise superimposed on the time-domain signal as a result of aliasing--is equivalent to "the time-domain phenomenon of an impulse response that depends on where, relative to the sampling instants, the original stimulus was presented."

Insights anyone?

## 3 Answers

This may not fully answer your question, but for getting a feeling of aliasing, maybe a simple demonstration can be helpful...

Some initial setup:

import numpy as np
from matplotlib import pyplot as plt
sr = 44100
sig_len = 4096


So, it is well known, that time domain undersampling causes frequency domain aliasing.

# sine wav and its spectrum
t = np.arange(sig_len)
x = np.sin(2 * np.pi * 20000 * t / sr)
X = np.fft.rfft(x)

# undersampled sine wav and its spectrum
x_alias = x[::2]
X_alias = np.fft.rfft(x_alias)


Vice versa, frequency domain undersampling causes time domain aliasing. This can easily be seen when using an impulse signal.

# impulse and its spectrum
x = np.zeros(sig_len)
x[int(sig_len * 0.6)] = 1
X = np.fft.rfft(x)

# undersampled spectrum and its time signal
X_alias = X[::2]
x_alias = np.fft.irfft(X_alias)


I read Footnote 8,

"The complication is that because of the sampling, the total system is not time-translation invariant and so does not have a unique ‘impulse response’ – the response is slightly different according to the position of an original impulse relative to the sampling points."

as a cumbersome way of saying that aliasing corrputs an LTI system such that its response can no longer be trusted to be linear and time-invariant.

If I were to rephrase things informally, I'd say that:

When a signal is undersampled in the frequency domain or has inadequate frequency resolution (aka freq domain aliasing), its spectrum has overlapping tails.

That means that it is no longer possible to correctly reconstruct the time-domain signal. The spectrum tails do not go to zero, but are folded back. This inversion of the tails are what we know as aliasing and manifest themselves in the time-domain signal as impulse responses (a short-duration time-domain signal) that mix with the original signal.

These mixtures are perceived as distortion/roughness/etc. Their constructive/destructive effect give you your "quasi-random" amplitude modulations.

The magnitude & position of aliasing in the time domain is related to the degree of frequency domain undersampling. See https://ccrma.stanford.edu/~jos/sasp/Example_2_Time_Domain.html

Finally, regarding "time smearing", the impulsive (quickly rising) parts of a waveform contain many high-frequency harmonics that when undersampled in the frequency domain, fold back as described above. However, I wouldn't call this distortion smearing, in the transient-smearing, or pre-ringing sense.

Hope that helps!

• Has it really been this long since I started this conversation (and then abandoned it)? Hard to believe! I'd like to ask a question about this. In the dramatically under-sampled plot, the effect at low times is very clear: A peak near zero where there wasn't one before. But in the only slightly undersampled plot, I see no significant effect of undersampling. And in neither case do I see any impact on the shape of the actual impulse--no extra spreading or ringing or anything. – Jim Austin Jun 12 at 18:31

If a piece of music is sampled at 32,000 samples per second (Hz), any frequency components at or above 16,000 Hz (the Nyquist frequency for this sampling rate) will cause aliasing when the music is reproduced by a digital-to-analog converter (DAC).

What this means is that if the signal being sampled has a frequency component larger than 16KHz then when it is sampled at 32KHz, it will be convolved in the frequency domain in such a way that the images in the frequency domain will overlap with the baseband signal. The samples now contain unwanted frequency components.

Aliasing is usually used as a negative term to indicate this type of overlapping that occurs on an ADC if you don't filter out the frequencies above the Nyquist rate, but aliasing is really a general term for frequencies that are the sampling rate apart being identical to each other when in the digital domain because images of the signal are convolved at that spacing in the frequency domain when sampling (multiplying with a Dirac comb). This of course precipitates the negative effects described above, and also is the reason why imaging occurs when zero stuffing samples.

Imaging is a similar terminology issue where you could call the act of sampling imaging because it creates images in the frequency domain, but instead imaging is used to describe when these images become part of the actual signal that will come out of the DAC, which happens when you zero stuff without interpolating. This is similar to how aliasing can be used to describe how in the digital domain, because they are currently samples, higher frequencies alias with lower frequencies (which disappear when the signal becomes continuous again), but the term is only used when this tangibly alter the actual samples of the signal, by overlapping them, such that the signal that leaves the DAC will contain the overlapped parts.

The key with aliasing is that a set of samples of a signal always has higher frequency components than the actual signal (which are just images of the original signal), by virtue of having been multiplies with a Dirac comb, and if these frequency components overlap with the signal, which they will if you don't sample at the Nyquist rate, then you cannot recover the original signal because the power spectral density at an overlapped frequency is the result of an unknown addition of 2 different frequencies' power spectral densities, as the overlap is additive.