The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Simulators >> Circuit Simulators >> Difference between Strobe Period in Transient, Sample/Value Function in Cadence
https://designers-guide.org/forum/YaBB.pl?num=1588264661

Message started by repah on Apr 30th, 2020, 9:37am

Title: Difference between Strobe Period in Transient, Sample/Value Function in Cadence
Post by repah on Apr 30th, 2020, 9:37am

I want to run an FFT on a transient waveform.

What is the Difference between Strobe Period in Transient, Sample/Value Function in Cadence Calculator ?

Dont they all essentially sample the waveform at a particular sampling frequency ?

Title: Re: Difference between Strobe Period in Transient, Sample/Value Function in Cadence
Post by Ken Kundert on Apr 30th, 2020, 11:40am

For FFT there is a very important difference, and you want to use strobing.

Strobing does two things. First, it forces the simulator to place a time point at every strobe point. Second, it suppresses the output of the all points except the strobe points.  Of these two things, the sample function in the calculator only does the latter. It has no effect on the simulation itself as it is a post processing step, meaning that the simulator has already finished when it is run.

When the sample function goes to sample the waveform, it will find that the desired sample points do not line up with the available time points, and so it interpolates to compute the sample points. It uses piecewise linear interpolation, which is a first order interpolation, meaning that the resulting sampled waveform will exhibit second-order errors. This second order errors act as a noisy signal that corrupts the FFT results and can hide important small signals.

When running an FFT you should always use strobing. Having said that, it can be very difficult to get everything set up correctly. The problem is that the strobe points and the sample points should be coincident, which is tough to arrange.  It is a point of frustration for me that this not handled automatically by the design environment.

-Ken

Title: Re: Difference between Strobe Period in Transient, Sample/Value Function in Cadence
Post by repah on Apr 30th, 2020, 12:00pm

Hello, Ken.

Thank you for your response.

How would I set up a test bench or a simulation such that the strobe points and the sample points are coincident ?

Thank you.

Title: Re: Difference between Strobe Period in Transient, Sample/Value Function in Cadence
Post by Ken Kundert on Apr 30th, 2020, 12:11pm

As I said, it is very difficult, and I cannot explain all the details. Basically you have to figure out the needed sample period and specify that as the strobe period, then you need to set the strobe start time to adjust the timing of the strobe points to get them where you want them (if you system is clocked, you generally want you strobe points at the end of the clock cycle), then you adjust the FFT parameters to get the FFT sample points to line up with the strobe points, though this is less essential.

Also be aware that when you specify the number of points you want to the FFT in ADE, it always rounds up to the next power of two without comment.

-Ken

Title: Re: Difference between Strobe Period in Transient, Sample/Value Function in Cadence
Post by repah on Apr 30th, 2020, 9:14pm

Thank you again Ken for your response.

Just so I am clear - what is the difference between sample and value in the calculator ?

Are they the same function essentially ?

Title: Re: Difference between Strobe Period in Transient, Sample/Value Function in Cadence
Post by Ken Kundert on Apr 30th, 2020, 10:27pm

I have no idea.

Title: Re: Difference between Strobe Period in Transient, Sample/Value Function in Cadence
Post by sutapanaki on May 1st, 2020, 12:04pm

Hi Ken,

Can you please elaborate a bit on this

"It uses piecewise linear interpolation, which is a first order interpolation, meaning that the resulting sampled waveform will exhibit second-order errors."

Specifically on the second-order errors. Why are they second order?

Thanks

Title: Re: Difference between Strobe Period in Transient, Sample/Value Function in Cadence
Post by Ken Kundert on May 1st, 2020, 10:56pm

If you approximate a sine wave at a point with a polynomial (think Taylor series expansion), there will be terms at all orders, but they generally get smaller as the order increases. A piecewise linear approximation represents the sine wave at that point with a straight line. That is a first order approximation. However, the piecewise linear approximation does not include any of the higher order terms, the largest is assumed to be second order. Thus it is said to have second-order errors. Of course it also has third, fourth, fifth, ... order errors, but they are assumed to be smaller. If a piecewise quadratic interpolation was used, then it would accurately model the zero, first and second order terms but would have third-order error.

In otherwords, if you were to subtract a pure sine wave from a piecewise linear approximation of the sine wave, and looked at the terms of the Taylor series expansion of the difference at an interpolation point, then the difference would only include second-order terms and above. These are the error terms for the piecewise-linear approximation.

-Ken

Title: Re: Difference between Strobe Period in Transient, Sample/Value Function in Cadence
Post by sutapanaki on May 2nd, 2020, 2:09pm

Thanks, Ken

Title: Re: Difference between Strobe Period in Transient, Sample/Value Function in Cadence
Post by Andrew Beckett on May 11th, 2020, 11:57pm


Ken Kundert wrote on Apr 30th, 2020, 12:11pm:
Also be aware that when you specify the number of points you want to the FFT in ADE, it always rounds up to the next power of two without comment.

-Ken


Ken, this is no longer true. Since IC617/ICADV122 you can use any number of points in the DFT and it no longer silently rounds to a power of two - it uses the exact number of points you specified. The DFT library underneath was replaced with something much more modern and this really annoying limitation was removed (so it's been gone for 4.5 years). Of course, it doesn't make a big song and dance about it, so it's easy to have missed this improvement...


repah wrote on Apr 30th, 2020, 9:14pm:
Just so I am clear - what is the difference between sample and value in the calculator ?

Are they the same function essentially ?


The value function in the calculator merely returns the value at a specific x-value of the waveform, whereas the sample function returns a waveform of values at stepped timepoints. Both interpolate. That said, the value function has options to get a periodic value so the functions are a little muddied and can both achieve the same thing in certain cases. The sample function has the benefit that you specify the from and to values and the number of samples, whereas the value function can be given a time and a period to sample at.

Andrew

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