recently I meet a problem.

I generate a random Gaussian signal $x$ with mean $0$ in MATLAB. And use a $4$th lowpass Butterworth filter to acquire $x'$. Then I use the binary rounding quantization method to get the quantized signal $x''$. And I find that the Fourier spectrum (FFT) of $x''$ contains some high-frequency information. That means some energy leaks to high-frequency regions after quantization.

Also, I find the energy in high-frequency areas is related to the bandwidth of the filtered signal $x'$. When the bandwidth of the filtered signal $x'$ is relatively low, the energy of the high-frequency areas of the quantized signal $x''$ is also lower. I find that some historical references about the assumption of the whiteness for quantization noise. But it seems that this is not the case.

Do you all meet this question? Could anyone give me references for this problem? Thanks in advance!


1 Answer 1


I guess this probably just a mistake in your analysis code.

Quantization noise is white and for a noise signal it's uncorrelated to the original signal, so spectrum of the original noise doesn't matter.

I did repeat your steps and saw exactly what I expected: The quantization noise is white and the spectrum of the quantized signal follows the original signal at low frequencies and is white at high frequencies (since it's dominate by the quantization noise).

Potential errors in your code

  1. Clipping the signal
  2. Improper spectral estimation, i.e. wrong choice of window and/or overlap. Not windowing or properly during spectral analysis. Either window manually or just use PWELCH instead.

Here is a MATLAB code snippet that shows this

%% script to generate quantization noise
nFFT = 16384;
fs = 48000; % sample rate
fc = 4000;  % cut off for low pass filter

% create noise, filter, and normalize
x0 = randn(10*nFFT, 1); % 10 frames or so
[b,a] = butter(4,fc*2/fs);
x0 = filter(b,a,x0);
x0 = x0./max(abs(x0));

% quantize to 8 bit
xq = round(2.^7*x0)*2^(-7);

% calculate quantization noise
noiseSignal = xq-x0;
% power spectrum
yAll = [x0 xq noiseSignal];
psd = pwelch(yAll,hamming(nx));
freqAxis = fs*(0:nFFT/2)'/nx;
% graph
clf; figure;
title('Power Spectra');
ylabel('Level in dB');
xlabel('Frequency in Hz');
grid ('on');
  • $\begingroup$ It seems that you miss nx, what is the value? $\endgroup$ Jan 5, 2021 at 15:19
  • $\begingroup$ Should be fixed now $\endgroup$
    – Hilmar
    Jan 5, 2021 at 18:11
  • $\begingroup$ In your code, you use a variable named $nx$, in pwelch(yAll,hamming(nx)); but you do not give a definition of $nx$ $\endgroup$ Jan 6, 2021 at 2:35
  • $\begingroup$ @standerQiu nx is the length of hanning window for estimating the power spectral density, and you could choose a proper value by yourself. Windowing is necessary for the conventional power spectral estimation, or you will see spectral leakage, which leads to a spreading of frequency components. $\endgroup$
    – ZR Han
    Jan 6, 2021 at 5:44
  • $\begingroup$ I revise the nx to $nFFT, then I get the result successfully. I think there are some differences between your model and mine. I use binary $1/-1$ quantization, which is xq = sign(x0); And I detect the energy of the quantized signal in high-frequency areas: sum(psd(floor(length(psd)*4/5):end,2))/sum(psd(:,2)) ($20\%$ area). In this situation, I find that the energy increases with fc (cutoff frequency) $\endgroup$ Jan 6, 2021 at 6:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.