PDA

View Full Version : SNR calculation in SDtoolbox


lxx.helen
06-05-2008, 11:57 AM
I'm trying to do run some simulation of ideal/noisy ADCs in MATLA
SIMULINK. So I downloded the SDtoolbox fro
http://www.mathworks.com/matlabcentral/fileexchange.
But I can not understand it's algorithm of calculating SNR from th
modulator's output bitstream. the codes for extracting signal from the ra
output data are

sinx=sin(2*pi*f*[1:n]);
cosx=cos(2*pi*f*[1:n]);
in=in(1:n);
a1=2*sinx.*in;
a=sum(a1)/n;
b1=2*cosx.*in;
b=sum(b1)/n;
outx=a.*sinx + b.*cosx

It is explained that b is the real part of DFT ,a is the imaginary part
And the signal is reconstructed in time domain with outx. I can'
understand why a1 and b1 have the factor 2 while computing DFT. And wh
outx is performing the reconstruction of signal in time domain...

thank you very much...

DigitalSignal
06-06-2008, 03:01 AM
It is a bit odd. The factor 2 might come from so called the transform
from single sided power spectrum to double-sided. But I am not sure
why they are doing the reconstruction of signal into time domain. The
SNR computation does not need it.

James
www.go-ci.com