The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Simulators >> Circuit Simulators >> Help Regarding DFT Calculation using Cadence Calculator https://designers-guide.org/forum/YaBB.pl?num=1245144421 Message started by saket on Jun 16th, 2009, 2:27am |
Title: Help Regarding DFT Calculation using Cadence Calculator Post by saket on Jun 16th, 2009, 2:27am Hi, I am trying to plot the DFT of an all Verilog A model of a sigma delta modulator. The problem arises when I try to plot the DFT. I do understand the concept of coherent sampling and this is how I have chosen my DFT output. Input frequency:523.681640625 KHz for Sampling Frequency (Fs) 260 MHz # of samples = 16384 and No of input cycles = 33 Now I use a zvcvs at the output of the ADC and I set the delay time = 10.8/Fs (0.8 for output to settle) The problem arises when I try to plot the DFT for different start points and corresponding end points (viz 19.8/Fs or 100.8/Fs) and I get different results for different start points. Sometimes the DFT output is flat at low frequencies whereas in some cases I see proper noise shaping (due to Sigma Delta Mod behavior). Can anybody explain why this is occuring? I have set the spectre tran sim accuracy to "moderate" and my max step is 50 pS. Any help will be greatly appreciated. Thanks! |
Title: Re: Help Regarding DFT Calculation using Cadence Calculator Post by currant on Jun 16th, 2009, 5:21am Hi, saket. Did You set strobperiod=1/260M? Although, I think, it is essential to begin DFT after end of all transients. Show Your DFT statement. Best regards. |
Title: Re: Help Regarding DFT Calculation using Cadence Calculator Post by sheldon on Jun 16th, 2009, 7:08am Saket, You did not mention the window function that you are using for the DFT. It sounds like you are using the Rectangular window, try using the Hann window function. You will manually need to set the window to Hanning by editing the window type in the calculator. There is more discussion about this topic in, "Understanding Delta- Sigma Data Converters", R. Schrier and Gabor Temes, Appendix A, Spectral Estimation Best Regards, Sheldon |
Title: Re: Help Regarding DFT Calculation using Cadence Calculator Post by pancho_hideboo on Jun 16th, 2009, 7:23am The following might be helpful. http://www.designers-guide.org/Forum/YaBB.pl?num=1213204643 |
Title: Re: Help Regarding DFT Calculation using Cadence Calculator Post by saket on Jun 16th, 2009, 9:40pm Thanks all for the responses! Currant: I am using a zvcvs at the output. Hence there is no need to set strobing. It's an all Verilog A model that I am using, hence the transients are also quite small i.e the output settles within 10 clock cycles. Sheldon: Much thanks. Haven't tried the Hann window yet. Will try it and see if that makes a difference. pancho_hideboo: Thanks! |
Title: Re: Help Regarding DFT Calculation using Cadence Calculator Post by saket on Jun 16th, 2009, 10:35pm Sheldon: I can't find the Hann Window function in my Cadence Calculator. There are a bunch of windows available, but no Hann window! |
Title: Re: Help Regarding DFT Calculation using Cadence Calculator Post by pancho_hideboo on Jun 16th, 2009, 11:51pm saket wrote on Jun 16th, 2009, 10:35pm:
And also you can express almost all windows including "Hanning" by using "Kaiser" with smoothing factor. http://en.wikipedia.org/wiki/Window_function |
Title: Re: Help Regarding DFT Calculation using Cadence Calculator Post by saket on Jun 17th, 2009, 5:07am pancho_hideboo: Thanks for the clarification. Now I need another one ;D The input signal in the Hanning window is spread over 3 bins. I'm assuming that in order to calculate the SNR, the signal power in all the 3 bins has to be added up. Is this a correct assumption? In a rectangular window, the signal power is spread over only one bin. These 2 values will be different if I were to add up the 3 bin values in the Hanning window option. Thanks in advance! |
Title: Re: Help Regarding DFT Calculation using Cadence Calculator Post by pancho_hideboo on Jun 17th, 2009, 6:06am saket wrote on Jun 17th, 2009, 5:07am:
Again see M-File of http://www.designers-guide.org/Forum/YaBB.pl?num=1213204643/8#8 The followings are extractions from them. Quote:
If you see "delsig/calculateSNR.m" and "delsig/hann.m" of http://www.mathworks.com/matlabcentral/fileexchange/19, you will be able to find out answer to your questions. The followings are extractions from "delsig/DSToolbox.pdf". Quote:
|
Title: Re: Help Regarding DFT Calculation using Cadence Calculator Post by saket on Jun 17th, 2009, 10:23pm function snr = calculateSNR(hwfft,f,nsig) % snr = calculateSNR(hwfft,f,nsig=1) Estimate the signal-to-noise ratio, % given the in-band bins of a (Hann-windowed) fft and % the location of the input signal (f>0). % For nsig=1, the input tone is contained in hwfft(f:f+2); % this range is appropriate for a Hann-windowed fft. % Each increment in nsig adds a bin to either side. % The SNR is expressed in dB. if nargin<3 nsig = 1; end signalBins = [f-nsig+1:f+nsig+1]; signalBins = signalBins(signalBins>0); signalBins = signalBins(signalBins<=length(hwfft)); s = norm(hwfft(signalBins)); % *4/(N*sqrt(3)) for true rms value; noiseBins = 1:length(hwfft); noiseBins(signalBins) = []; n = norm(hwfft(noiseBins)); if n==0 snr = Inf; else snr = dbv(s/n); end Hi pancho_hideboo, I can't understand the highlighted code! Please do explain what it means. It looks like the 3 signal bins are added together but I still need to confirm it. (I'm not that proficient with Matlab!) |
Title: Re: Help Regarding DFT Calculation using Cadence Calculator Post by pancho_hideboo on Jun 18th, 2009, 5:07am Array index starts from "1" in MATALB. It is not "0". So if I specify tone_bin(0<=tone_bin<=Nfft-1), it is located at tone_bin+1 of hwfft. saket wrote on Jun 17th, 2009, 10:23pm:
These use "Logical Indexing". Case-1 Quote:
Case-2 Quote:
Case-3 Quote:
|
Title: Re: Help Regarding DFT Calculation using Cadence Calculator Post by saket on Jun 18th, 2009, 10:51pm Thanks a ton, pancho_hideboo! You've been extremely helpful and patient with me :) Thanks once again! |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |