zhujun134
Junior Member
Offline
Posts: 13
|
hi,everyone I am designing a 5 CIFF delat sigma modulator,and i meet some problem when i go to simulation of circuit.There is my simulation situation: input signal:sinusoidal signal:magnitude:1V,frequency:9.46KHZ;samoling clock:2.5MHz;Vdd=5V.and the circuit is full deffrential construction. i do the spectrum analysis to the output in candence.in the psd window,i set the time from 50.2u to 3327u,the sampling number is 8192;it just 31 cycles of input signal. the hanning window number is also 8192;then i got a good result of psd. but i got a bad result when i exported to matlab,i used the same spectrum analysis situation:i used the fuction of calcSNR in matlab.it is as follow: function [snrdB,ptotdB,psigdB,pnoisedB] = calcSNR(vout,f,fBL,fBH,w,N) fBL=ceil(fBL);% fBL: Base-band lower limit frequency bins fBH=ceil(fBH);% fBH: Base-band upper limit frequency bins signal=(N/sum(w))*sinusx(vout(1:N).*w,f,N); % Extracts sinusoidal signal noise=vout(1:N)-signal; % Extracts noise components stot=((abs(fft((vout(1:N).*w)'))).^2); % Bitstream PSD ssignal=(abs(fft((signal(1:N).*w)'))).^2; % Signal PSD snoise=(abs(fft((noise(1:N).*w)'))).^2; % Noise PSD
pwsignal=sum(ssignal(fBL:fBH)); % Signal power pwnoise=sum(snoise(fBL:fBH)); % Noise power
snr=pwsignal/pwnoise; snrdB=dbp(snr); norm=sum(stot(1:N/2))/sum(vout(1:N).^2)*N; % PSD normalization if nargout > 1 ptot=stot/norm; ptotdB=dbp(ptot); end
if nargout > 2 psig=ssignal/norm; psigdB=dbp(psig); end
if nargout > 3 pnoise=snoise/norm; pnoisedB=dbp(pnoise); end
can you give me some advice?thank you!
|