The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Simulators >> Circuit Simulators >> cadence fft problem
https://designers-guide.org/forum/YaBB.pl?num=1324341893

Message started by sapphire on Dec 19th, 2011, 4:44pm

Title: cadence fft problem
Post by sapphire on Dec 19th, 2011, 4:44pm

Hi,

I am trying to simulate the thermal noise of a simple RC filter. The resistor is 1K ohm and the capacitor is 1pF. So the noise BW is slightly more than 200MHz. In the transient noise setup, I choose Fmax=2GHz. I simulated for 1ms, with the strobe period=1m/1024.

For 1pF, the KT/C noise should be 64uV. From the fft spectrum, we can integrate the noise spectrum from DC to the nyquist rate, which should be equal to 64uV in theory. However, what I got is 81uV.

Then, I exported the data to matlab, and from there I calculated that the noise is 58uV, which is closer. But it's still not matching the estimate. My question is what may cause this difference and how to setup the simulationa and calculation correctly?

Sapphire

Attached is an ocean script that was used to calculate the cadence fft

Ttot=1m
fres=1/Ttot
fin=5000
sbin=round(fin/fres)
N=1024

fft=dft(VT("/vout"),0,Ttot,N,"Rectangular",1,1)

signal=abs(value(fft,fres*sbin,?histoDisplay nil ,?noOfHistoBins 1))**2

totpow=0
bin=1
while( (bin<=N/2)
totpow=totpow+abs(value(fft,fres*bin,?histoDisplay nil ,?noOfHistoBins 1 ))**2
bin=bin+1
)

thermal_noise=sqrt(totpow-signal)

printf("thermal noise voltage=%f \n" thermal_noise)

Title: Re: cadence fft problem
Post by Geoffrey_Coram on Dec 20th, 2011, 5:56am

You got 81uV for one sample path, by which I mean one set of pseudo-random numbers picked by the simulator to approximate the noise at the set of timepoints.  If you flip a coin 100 times in a row, you probably won't get exactly 50 heads and 50 tails.

If you pick a different seed for the random number generator, you will probably get a different number.  If you run for longer than 1ms, you'll get a different number.

Title: Re: cadence fft problem
Post by sapphire on Dec 20th, 2011, 11:49am

I might find the possible reasons. It seems like there will be interpolation error. In transient simulation, we usually set the strobe period as T/N. T is the sampling window, and N is the DFT point. Then, when doing DFT, cadence will always default the N to 2's power. For example, if we set N=1000, it will change it to 1024. But if we use 1024 to set the strobe period, the total number in the sampling window T is 1025. So there is always finite amount of interpolation error when doing DFT in Cadence. When I export the data to Matlab, it gives more accurate data. One solution is to set the strobe period to very tiny number such as 1ns, but that will affect the simulation time.

From the Matlab DFT analysis, it also seems like there will be 10% mismatch when set the FMAX to 10 times the noise bandwidth, and the error will be only 1% when the FMAX is 100 times the NBW.

Please confirm.  Thanks.

Title: Re: cadence fft problem
Post by Geoffrey_Coram on Dec 20th, 2011, 12:47pm

The signal should be periodic, and the 0th sample should match the 1025th, so I don't think that's the issue.

Title: Re: cadence fft problem
Post by sapphire on Dec 20th, 2011, 1:40pm

No, in cadence we cannot do N=1025 DFT. If we do N=1024 point DFT, then the actual DFT sampling point will deviate from the simulation strobe points, and we got interpolation error.

Title: Re: cadence fft problem
Post by Geoffrey_Coram on Dec 21st, 2011, 11:39am

I wasn't suggesting you try a N=1025 DFT; I meant that

Quote:
the total number in the sampling window T is 1025

should not be relevant, because the fft algorithm should only use 1024 of those points, the first one should be equal to the last one.

You should look for a white paper or something on SourceLink for using the fft and strobe period.  I'm sure there's a way to eliminate the interpolation error.

Title: Re: cadence fft problem
Post by sapphire on Dec 22nd, 2011, 4:42pm

If the DFT algothrim is standard, then there should be no difference between cadence and matlab. But for the same output waveform, Matlab calcuates 58uV noise voltage, while Cadence calculates 81uV. I really want to figure out what causes the difference.

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.