# How does the quantization error generate noise?

I'm learning about sampling and DSP on my own. I have a hard time to understand how the quantization error results in noise. I think I miss a fundamental understanding but can't tell what it is. So how does the quantization error generate noise?

• It's more distortion than noise. It depends on the signal, and is not random. – endolith Jul 15 '12 at 20:48
• endolith, I think what I don't understand is how the error results in frequencies. – Jan Deinhard Jul 15 '12 at 21:04
• distortion always produces additional frequencies. if you distort a sine wave, it becomes a different repetitive waveform. any repetitive waveform other than a sine wave is made up of multiple frequencies. – endolith Jul 15 '12 at 22:58
• As @endolith has mentioned, let us assume you have a very bad ADC, such that you give it a pure tone, but get a signal that looks like a sine but has big steps in it. (So now your signal looks like a staircase that is going up and down with the original sine.) Now, you know intuitively that a step is composed of many frequencies. This is how an ADC will add frequencies as you are asking. It is a non-linear operation btw. If it was linear, you could not make new frequencies, only superimpose many of them together. – Spacey Jul 16 '12 at 14:33
• Another remark: A nice interpretation is given by Yannis Tsividis in ICASSP 2004: Quantization is a hard nonlinearity and generates an "infinite number of harmonics". The sampling process folds all of them down. For sufficiently complex signals, these "downfolded harmonics" look like a white noise floor. – divB Sep 12 '18 at 21:19

Suppose I have a multitone signal (six carriers, at ±1/1000, ±2/1000 and ±7/1000 of sampling frequency)

x = (1:1000);
wave = sin(x/1000*2*pi) + sin(x/1000*2*pi*2) + sin(x/1000*2*pi*7);


which is quantized using a 14-bit ADC

wave_quant = round(wave * 16384) / 16384;


The difference

wave_qnoise = wave_quant - wave;


gives the quantization error The corresponding spectrum

wave_qnoise_freq = mag(fftshift(fft(wave_qnoise)) / sqrt(1000)); shows the generated noise floor across the entire spectrum.

This assumes that the quantization error does not introduce a bias. If the ADC always chooses the lower value

wave_quant_biased = floor(wave * 16384) / 16384;


we get a quantization error that is no longer centered around zero

wave_qnoise_biased = wave_quant_biased - wave; which has a definite spike in the FFT in the DC bin

wave_qnoise_biased_freq = mag(fftshift(fft(wave_qnoise_biased)) / sqrt(1000)); This becomes a real problem with e.g. Quadrature Amplitude Modulation, where a DC offset in the demodulated signal corresponds to a sine wave at the demodulation frequency.

• This is very great thank you for your help. this way i have explored the distortion related to the quantization. – user3314 Nov 20 '12 at 6:37
• Hi, this answer is not helpful, but it's hard to articulate why. I think you did not take enough time to explain things approachably. It feels like you're just showing off what you know rather than taking the time to teach. How can this be better next time? – Andy Ray Apr 19 at 5:09

"Noise" in this context refers to anything unwanted added to the signal, it doesn't necessarily mean it is gaussian noise, white noise, or any random well-described process.

In the context of quantization, it is a purely algebraic argument. One can view quantization as the addition of an unwanted signal ("noise") equal to... the difference between the original signal and the quantized signal. Note that this quantification noise is not random, and is correlated with the input signal. For example, if a signal is periodic, the quantization noise introduced when quantizing it will be periodic too.

• I think I understood how the quantization causes the error itself. What puzzles me is how it generates frequency. My understanding is: "Unwanted signal" means unwanted frequencies. Suppose I sample a pure sinusoidal signal. Then the quantization error introduces "overtones". I suppose the overtones originate from the "staircase" shape of the sampled signal. Is that correct? – Jan Deinhard Jul 15 '12 at 20:44
• @FairDinkumThinkum: yes, if you distort a pure sine wave, you will get harmonic distortion, which produces new frequencies at multiples of your sine wave's frequency. en.wikipedia.org/wiki/Distortion#Harmonic_distortion – endolith Jul 15 '12 at 22:59
• Is it accurate to say that the "noise" is just the added delta between the source signal and the output signal due to quantization? – Andy Ray Apr 19 at 5:10
• @AndyRay, basically yes. In some applications we're also interested in additional things, e.g. when we work with GPS signals which are very faint and need to be mathematically reconstructed, we need to know if the noise has any properties that would cause the algorithm to go wrong, e.g. a DC offset or subharmonics of the sampling frequency. – Simon Richter Apr 19 at 9:58

To expand on what pichenettes said, consider if you have an audio signal that is being digitized by a D-to-A converter that only has a resolution of 0.01 volt. If, at some particular instant in time, the audio signal is at 7.3269 volts, that will be either rounded to 7.33 volts or truncated to 7.32 volts (depending on the design of the converter). In the first case you've added "noise" of 7.33-7.3269 volts, or 0.0031 volt. In the second case you've added "noise" of 7.32-7.3269 volts, or -0.0069 volt.

Of course, there is additional noise added due to the fact that the converter is most certainly not infinitely accurate, and probably has an accuracy on par with its precision.

Here is a more basic explanation to get the fundamental point across.