# Frequency of a single sample in a digital signal and aliasing

I'm involved with digital audio synthesis. I know that if I create a raw non band-limited waveform it would contain frequencies above Nyquist thus violating the Nyquist Shannon theorem and the signal will contain aliased components. So I wonder if I can also create aliasing by other means, like a "click" from a fast envelope or a single sample in a digital stream. So what is the frequency of a single sample (is it sample rate/1 ?) and does such clicks alias in the frequency domain?

A single sample being non-zero is known as an impulse. The effect in the discrete frequency domain depends upon where it is within a the frame. The DFT will give you the coefficients required to reproduce whatever finite signal is withing the sample frame. It is misleading, even erroneous, to say the signal is composed of those frequencies. This can only be said about periodic signal for which the sampling frame is a whole number of periods. Recall that the DFT and inverse DFT are basically the same, except for a sign change in the exponent. When you have a pure tone with a whole integer frequency in the sample frame, the result is a single spike in the DFT at the bin corresponding to that frequency. So when you have a single spike, or impulse, in the signal domain, the result will be a DFT with the bin values being the same as a pure complex tone.

"Alias" is a different concept entirely. It has to do with the sampling of tones higher than the Nyquist frequency appearing to be tones of a lower frequency. The easiest way to envision what alias frequency will look like is to imagine the bins of the DFT arranged along the unit circle. The Nyquist bin will occur at $\pi$ radians. Any alias frequency has to appear somewhere on the circle. It may be beyond $\pi$, or even beyond multiple times around the circle. The frequency it will appear to be (for real valued signals) will be the frequency associated with the bin number of the first half of the circle that has the same projection onto the horizontal axis.

I would recommend that you read my blog articles (link on my profile page) from the start to get a perspective on this material.

Hope this helps.

Ced

• Thanks yes I will check your articles, I also try to read Lyons' "Understanding DSP" Thanks again.
– user17127
Mar 26 '18 at 17:08
• @John Am, Lyons also has a blog there with way more articles than I've written on a much broader range of topics. Well worth reading. I also want to point out that if you are synthesizing signals in the digital domain, it is impossible for you to create tones above the Nyquist frequency. Mar 26 '18 at 17:38
• "it is impossible for you to create tones above the Nyquist frequency" Yes? I think I miss something here. But the "raw" oscillator is created in the digital domain and contains harmonics above the Nyquist and creates plenty of aliasing. Can you elaborate on your last point? Are non band-limited oscillators created in the digital domain but contain components above Nyquist?
– user17127
Mar 26 '18 at 17:45
• @John Am, When you lay down your output values into a discrete array, no matter how you generate them, you can not encode multiple waveforms in the space between two adjacent samples. There are no values there to hold them. Mar 26 '18 at 18:04
• @JohnAm I think the reason you see the Aliasing is because you are representing a saw wave with a non-integer wavelength. This introduces error, as you have to start a new cycle at the nearest sample time, which will inherently be incorrect to some degree. I think this is equivalent to downsampling a "perfect" saw wave using some method, which will lintroduce some level of aliasing. If you are simply starting a new wave cycle whenever your phasor exceeds 2*pi, I guess this would be equivalent to downsampling using zero-order-hold. I think that's where your aliasing is coming from. Mar 27 '18 at 13:04

A single non-zero sample contains all frequencies.

In DSP, this non-zero sample is called a Dirac delta, noted as $\delta[n]$, which is 1 for $n=0$ and 0 elsewhere.

The Fourier transform of the delta is 1 for all frequencies:

If your digital signal is a delta: $x[n] = \delta[n]$, then the Fourier transform is $X(e^{j\theta}) = 1$.

$\theta$ denotes frequency in the digital domain, where $\theta = 2\pi$ corresponds to the sampling frequency.

A single sample requires an infinite (or greater?) time till the next sample, thus has an infinite period, or a sample rate of zero. That sample allows perfect reconstruction of a baseband signal bandlimited to half the sample rate, or 0 Hz, or DC.