Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Accurate transient setting for DFT and Spectrum in cadence

Status
Not open for further replies.

Junus2012

Advanced Member level 5
Joined
Jan 9, 2012
Messages
1,552
Helped
47
Reputation
98
Reaction score
53
Trophy points
1,328
Location
Italy
Activity points
15,235
Dear friends,

Few day I was in discussion on SNR which le me to this topic, suta has presented a method on how to link accurately the transient simulation to the DFT to get accurate signal conversion. I attached below his image to have further discussion on it please,

My question are

1. What Nstart actually mean and what is my limit on selecting it.

2. The stop time equation

3. The Strobperiod is 1/8*Fs in the suggested image, what about the Strobperiod = Signal period / Fs?

3. I couldn't understand the specified equations (From, To) in the functional panel of the DFT in calculator.

1.PNG

4. What are the equivalent setting if I would like to use the Spectrum from Cadence rather than DFT.

Thank you very much in advance
 
Last edited:
Ok Dear Suta, I will wait for your reply at your available time :)
 

Nstart defines the time you start collecting samples for the fft. The time actually is Ntstart/Fs. For example, if you run a 1024 points fft, the first point is at Ntstart/Fs. Said in other words, you collect Ntstart-1 points in the beginning that you don't use. This is done with the purpose of having some time in the beginning of your simulation to let things settle. If there are still things settling, it will affect your linearity results and they won't be correct. So, what you choose for Ntstart is up to you and the way your circuit settles. If it settles right away, then Ntstart can be 0.

The stop time equation similarly says that you end your sample collection and thus the end of the simulation Npts after Ntstart. That is, you simulate for Ntstart+Npts sample points, which converted to time is (Ntstart+Npts)/Fs.

The strobepewriod is not 1/8*Fs. It is 1/(8*Fs) which is 8 times smaller than you sampling period. When the simulator samples, it interpolates the signal between the points and this differs from the real waveform. It can be a source of non-linearity when you circuit is more linear than that interpolation.Maybe not a problem for you since your amplifier is not that linear. But it is good to have.

The expressions for "From" and "To" just follow the things I explained above for Ntstart and end time.

Now, that you know all that, I guess you can figure out yourself how to set cadence Spectrum measurement.
 
Dear Suta,

Thank you very much, I am understand now completely from your kind explanation the setting of the DFT. Once I have the signal in frequency domain I can then apply mathematical functions to find for example the SNR and so on. May be later I will have some inquiry about it. but now DFT is very clear.

Dear suta, I attached below the Spectrum setting from cadence, I will proceed with my signal = 2 MHz. to run the transient for spectrum I will not need to define the start or the end like the way we needed before for the DFT. Simply I will state the Stop time of the transient to 6 us for example. The only thing I must be careful about is to set the strobperiod to for example (1/(8*Fs)). Then I run the simulator and plot my signal in time domain and call the Spectrum for it.

In the Spectrum I will specify the start and the end by myself, I can look in to my signal and choose the start where it becomes settled. Say roughly from 1u instead of 0, the end time 6 us.

Now I move to Sample count which is the "Npts", I choose like 1024 or bigger (2048, 4096, 8192, etc), I think the higher number will consume more time but gives more accurate result.

The sampling frequency I should set it to the same value I set in the Strobperiod.

The Window type is mostly chosen rectangular.

There is Option called start/stop frequency beside letter "S", usually I press S and it fill the field automatically but I don't know the meaning of it.

Signal bins I also don't know what is it.

Sat peak level I leave it to 0

I usually select number of harmonics = 100.

The last but not the least, is the Analyses type in which gives two option, Signal and Noise analyses, what are the difference in between ? may be the Noise analyses is related to the transient + Noise ?

Thank you very much Suta


3.png
 

I don't normally use this Spectrum tool, so can't really help you with that. But perhaps you can find description in the Help.
 

Dear Suta,

Thank you again

I have a question please,

is the number of samples (Npts) is related to one period of signal or it is divided to the total number periods to be simulated.
What is the optimum number you think to have as a rule of thumb

Thank you
 

No, it doesn't work like this. If you supply a piece of your signal, a sine wave, to the FFT it actually makes it periodic and then takes the Fourier transform. So, it is extremely important that the transition from the piece of the signal (strat time to stop time) and its periodic repetitions be seamless and smooth. Otherwise, there will be a jump at the point of transition which will generate non-linearity. Imagine, your sine wave starts at 0V for the 1st sample and you continue collecting samples for the FFT until the sine wave reaches its peak after 1.5 periods. Then the periodization of the signal for the FFT will continue next with the 0V point because this is the beginning of the chunk of data that you gave the FFT algorithm. In this case you have huge jump with the size of the sine wave amplitude and a terrible non-linearity as a result. That's why you choose number of cycles (aka periods) of the sine wave, choose the number of points, usually powers of 2 and either choose the samplng frequency and get as a result the signal frequency, or the other way around. In this way you know you give the FFT integer number of cycles and the periodization is smooth. THis is all captured in the formulas I gave so far.
The number of sampling points 1024 or 2048, or 4096, etc will also define the level of your noise floor - either real noise or noise from computational accuracy. If, for example you don't see harmonics, it doesn't necessarily mean that they are not there, it means that they are buried in the noise floor, so you will have to put more sampling points to lower the noise floor and reveal the harmonics.
All this is for rectangular window. Other types of windows decrease the effects of discontinuities.
 
Last edited:
Dear Suta,
I don't know how to thank you,

I follow your procedure to find the right relationship between the number of cycles, signal frequency, sampling, frequency, and the number of sampling points.

Yes for sure increasing the number of samples as I understand from you will more accurately represent the signal, and as you said it will lead to reduce the noise floor at the time of conversion. The only penalty I will pay is the increasing in the sampling frequency which lead to increase only the simulation time. For the sake of accuracy I will accept it.

But may be my question was not clear as usual as I do :)

Actually what I wanted to say is like this, suppose if I have 200 cycle presented to DFT with Ntfs = 4096. Will the DFT give 4096 sample for every cycle or 4096 for the 200 cycle.
Why this is important, you already answered it, if he give the 4096 for the 200 cycle then I will not have good conversion and so on then I need to increase the number in this case,
if he give 4096 for each cycle then I will be happy

Please forgive me to make it long

Thank you very much once again
 

The number of samples are for the 200 cycles, using your numbers. But do you really need to use 200 cycles?
 
Thank you Suta,

For the transient + Noise I need such number to see the low frequency noise
 

Dear Suta

Do you think the setting in the picture below is necessary ? or it is better to leave it in default values. The author was also trying to find the DFT.

3.png
 

Most of the time conservative setting is enough. Yes, you can play with reltol and abstol, they can make it more accurate. I think it is all based on the needs. In any case, these things are assessed incrementally. You tighten the tolerances, see if it makes any change in the result. If it does, tighten more an so on until it doesn't matter anymore.

Where is the above picture from?
 
Dear Suta

Thank you for your reply

here is the complete file,

View attachment ECE483_THD.pdf

- - - Updated - - -

Dear Suta,

I have also found this conversation from internet answered by Cadence expert about the Strobperiod setting,

your setting is Strobperiode = 1/(8*Fs) or 1/(16*Fs), etc

his setting is little different as you see from the image

Strobperiode = signal time / Npts

and by the way I have read from Cadence manual that Rectangular window is only accurate for integer number of cycles, otherwise one have to use Hanning window

4.png
 

Yes, what the cadence guy says is totally correct. And pretty much matches what I was explaining to you all this time. His strobe period is signal time / Npts because he doesn't have any initial settling to wait for. And I think we discussed already that if you increase the number of samples, respectively use 1/(8*Fs) etc, you lower the noise floor further and reveal any hidden features.
Thanks for the pdf.
 
Dear Suta,

I should thank you for your excellent way of explaining the setting, now I am running the DFT perfectly.

Thank you once again
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top