Julian18
Full Member level 3
Hello there:
I am constructing a naive quantizer using matlab, with LSB=1. The output waveform seems good. but when I calculate the total quantization noise power, I fail to get a number that is around 1/12= 0.0833, on the contrary i always get 1/6=1.672. I know I must have done something very silly, so plz help me out there.
the matlab code is listed below as
Thanks
I am constructing a naive quantizer using matlab, with LSB=1. The output waveform seems good. but when I calculate the total quantization noise power, I fail to get a number that is around 1/12= 0.0833, on the contrary i always get 1/6=1.672. I know I must have done something very silly, so plz help me out there.
the matlab code is listed below as
below shown are the quantization waveform and its spectrumclear x y ref;
N=8192*4;
ref=[-3.5:2.5];
x=rand(1,N)*8-4.5;
for i=1:N
y(i)=sum(x(i)>ref);QN(i)=y(i)-4-x(i);end
%QN=y-4-x;
s=abs(fft(QN));
s=s(1:end/2)/N*2;
sum(s.^2)
Thanks
Last edited: