The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 16th, 2024, 9:47am
Pages: 1
Send Topic Print
question about PXF simulation in SpectreRF (Read 2531 times)
Allen Rock
New Member
*
Offline



Posts: 5

question about PXF simulation in SpectreRF
Oct 29th, 2012, 11:49am
 
After reading Ken Kundert's "Simulating Switched-Capacitor Filters with SpectreRF" and played with some PXF simulations, I have some question regarding the concept of k (as in Equation (33), f_in = k*f_clk+f_out) and sidebands. Allow me to illustrate my question by an example.

Assume that my circuit's f_clk is 100kHz, and I perform two PXF analyses. In the first analysis, I run my simulation from 1Hz to 4*100kHz (that is, 4 times clock frequency), with number of sideband set to 0; in the second analysis, I run my simulation from 1Hz to 100kHz, with number of sideband set to 3. It appears to me that in both cases, the "actual" f_in would be from 1Hz to 400kHz (in the second analysis, k varies from 0 to 3 while the sweep frequency varies from 1Hz to 100kHz, resulting in an overall sweep range of 1Hz to 400kHz.) So will the two analyses produce the same result? Of course, depending on how I set freqaxis, the results may be plotted differently, but physically, should the actual response be the same? If not, under what circumstances will they differ? Thanks a lot!
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: question about PXF simulation in SpectreRF
Reply #1 - Oct 29th, 2012, 3:23pm
 
No.

Consider fin=400kHz. In the first case (sideband = 0) you will be computing the transfer function from 400kHz at the input to 400KHz at the output. In the second (sideband = 3) you will be computing the transfer function for 400kHz at the input to 100kHz at the output.

Remember, fin = k*fclk+fout, so if you change k and keep fin fixed, fout must change.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
Allen Rock
New Member
*
Offline



Posts: 5

Re: question about PXF simulation in SpectreRF
Reply #2 - Oct 30th, 2012, 1:00pm
 
Thanks Ken for the reply. I understand the general idea of fin = k*fclk+fout, but I still have some confusion.

In current version of SpectreRF, PXF analysis has a "Specialized Analyses" option which can be set to "Sampled." If I understand it correctly, with this option, the simulator first samples the output at specific time points, resulting in discrete-time values, and then performs spectrum analysis on these samples. If I set this feature to sample at fclk, and fin=400kHz, what I get at the output is a set of sampled, discrete-time values spaced at time interval of 1/100kHz (i.e. 1/fclk.) Then how do I interpret this one set of sampled values as both a 400kHz signal (for k=0) and a 100kHz signal (for k=3)? Physically, this set of sampled values have one amplitude. Then how can the transfer functions for k=0 and k=3 be different?

Can I say that the implicit assumption behind fin = k*fclk+fout is that we do not do such sampling, and that the output signal is a continuous-time signal, so it has frequency components shifted from fin by integer multiples of fclk?
Back to top
 
 
View Profile   IP Logged
Allen Rock
New Member
*
Offline



Posts: 5

Re: question about PXF simulation in SpectreRF
Reply #3 - Oct 30th, 2012, 5:06pm
 
To illustrate my question, I simulated a simple sample-and-hold circuit twice, once with and once without setting "Sampled" for "Specialized Analyses."

In the first simulation run, there is no "Sampled" setting (the on-resistance of the switch is intentionally made large to give an RC corner frequency of 159kHz):

simulator lang=spectre
global 0
parameters VDD=1 TCLK=1/500k

R1 (vout1 0) capacitor c=10p
W0 (vin vout1 CK 0) relay vt1=510.00m vt2=490.00m ropen=1T rclosed=100K
V1 (CK 0) vsource type=pulse delay=10n val0=0 val1=VDD period=TCLK \
       rise=100.0p fall=100.0p width=TCLK/2-0.1n
V0 (vin 0) vsource dc=0 pacmag=1 type=dc
simulatorOptions options reltol=1e-3 vabstol=1e-6 iabstol=1e-12 temp=27 \
   tnom=27 scalem=1.0 scale=1.0 gmin=1e-12 rforce=1 maxnotes=5 maxwarns=5 \
   digits=5 cols=80 pivrel=1e-3 sensfile="../psf/sens.output" \
   checklimitdest=psf
pss  pss  fund=500K  harms=25  errpreset=conservative  tstab=10n
+    annotate=status
pxf  (  vout1  0  )  pxf  start=10  stop=10M  dec=1000
+    maxsideband=2  annotate=status  freqaxis=in



With the above netlist, the output is a continuous-time signal, and the result shows that each sideband does show different transfer function (please see the attachment -- I don't know how to put the image here.)

In the second run, I changed the PXF statement to do "Sampled" analysis:


pxf  (  vout1  0  )  pxf  crossingdirection=rise  thresholdvalue=0.5
+    sampleprobe=V1  ptvtype=sampled
 start=10  stop=10M  dec=1000
+    maxsideband=2  annotate=status  freqaxis=in


With this netlist, the output is supposed to be sampled, discrete-time signal, and the result shows that transfer function of all sidebands overlap each other if printed in one plot (please see attachment)
Back to top
 

comparison.png
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: question about PXF simulation in SpectreRF
Reply #4 - Oct 30th, 2012, 6:12pm
 
Quote:
Can I say that the implicit assumption behind fin = k*fclk+fout is that we do not do such sampling?

No, it is true regardless of the sampling.
Quote:
Then how can the transfer functions for k=0 and k=3 be different?

They are different transfer functions because the output frequency is different. However, they may have the same value (same magnitude and phase), as you would expect with a sampled system.

The interpretation of sampled PXF is that of traditional PXF applied to your original circuit with a sampler added to it. And it is not an ideal sampler. It is a sampler that uses the time points of the underlying PSS analysis, that is why the transfer functions tend to droop with frequency.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
Frank Wiedmann
Community Fellow
*****
Offline



Posts: 678
Munich, Germany
Re: question about PXF simulation in SpectreRF
Reply #5 - Oct 31st, 2012, 3:46am
 
For sampled pxf analysis, I have made the experience that the simulation is much faster if I choose a pxf frequency range from zero up to half of the pss fundamental frequency (50 kHz in the case discussed here) and use the maxsideband parameter of the pxf analysis to cover the required frequency range. The result is the same as for maxsideband=0 and a pxf sweep over the required frequency range (if the default freqaxis=absin is used). In order to avoid the numerical problems mentioned by Ken, it may be necessary to set the maxacfreq parameter of the pss analysis to a sufficiently large value.
Back to top
 
 
View Profile WWW   IP Logged
Allen Rock
New Member
*
Offline



Posts: 5

Re: question about PXF simulation in SpectreRF
Reply #6 - Oct 31st, 2012, 2:32pm
 
Thanks Ken and Frank for the replies. As Ken mentioned:

Quote:
The interpretation of sampled PXF is that of traditional PXF applied to your original circuit with a sampler added to it. And it is not an ideal sampler. It is a sampler that uses the time points of the underlying PSS analysis, that is why the transfer functions tend to droop with frequency.


I'd like to confirm my understanding here. Conceptually, the signal at the output of this added sampler is still considered a continuous-time signal (that is, vout(t)), not a discrete-time signal (i.e. vout[n]) as I originally thought. I understand that as a numerical tool, the simulator still needs to look at the continuous-time signal at specific time points for the purpose of computation, but that is an implementation issue; the signal itself is still a continuous-time signal. Is this correct?

Also, if this added sampler is not an ideal sampler, what kind of sampler is it, and how will it shape the output signal spectrum? Will it introduce any sinc-like characteristics at all? If drooping the only effect, how much drooping should I expect?





Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: question about PXF simulation in SpectreRF
Reply #7 - Oct 31st, 2012, 4:46pm
 
Yes, the output of the sampler is a continuous time signal, as expected by the PXF analysis.

You can think of the sampler as having a finite aperture time, just like a real sampler or sample and hold would have. In this case, I believe the aperture time would be the length of two time steps (assuming single step methods such as backward euler or trapezoidal). The aperture would be opening during the first time step and closing during the second. The details of aperture is affected by the time step sizes and methods. The resulting droop in the frequency domain would correspond roughly to a sincK function in the time domain, where K is at least one. Thus, the droop can be controlled most strongly by changing the time step, and to a lesser degree by changing the integration method.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
Allen Rock
New Member
*
Offline



Posts: 5

Re: question about PXF simulation in SpectreRF
Reply #8 - Nov 1st, 2012, 10:28am
 
I probably missed something here. If I configure the "Sampled" option in "Specialized Analyses" in such a way that PXF samples the output once per clock cycle (this can be easily done by triggering sampling on a clock edge), I would expect that (1) within one clock cycle, there are one track phase and one hold phase, and (2) the track interval and hold interval add up to a clock cycle time. If these time intervals are related to time steps, then within one clock cycle, very likely it will sample the output many times (assuming the time step is much smaller than clock cycle), which contradicts the configuration that it samples once per cycle.

I understand that the numerical method needs to "look at" the sampled signal at many points within the cycle to calculate the spectrum, with the interval between these points being the time step, but is that kind of "interval" the same as the sample interval/hold interval in a sample-and-hold situation?

So, is it correct to say that the sampler has a sample phase and hold phase, which add up to clock cycle time?
Back to top
 
 
View Profile   IP Logged
Frank Wiedmann
Community Fellow
*****
Offline



Posts: 678
Munich, Germany
Re: question about PXF simulation in SpectreRF
Reply #9 - Nov 6th, 2012, 6:26am
 
Personally, I like to look at sampled pxf analysis as ideal sampling. I think that this is probably a good approximation if the maxacfreq parameter of the pss analysis (which sets a maximum limit for the time step) is set to a large enough value.

I mostly use sampled pxf analysis to simulate the effect of power supply ripple onto the jitter of a signal. When I divide the sampled pxf result by the slope (= derivative) of the signal at the sampling point, I get a transfer function that maps power supply ripple to signal jitter as a function of frequency. I have verified such results with transient simulations on many occasions and they always matched very well.
Back to top
 
 
View Profile WWW   IP Logged
hiSkill_11
Community Member
***
Offline



Posts: 35

Re: question about PXF simulation in SpectreRF
Reply #10 - Mar 21st, 2013, 1:29am
 
Frank Wiedmann wrote on Nov 6th, 2012, 6:26am:
Personally, I like to look at sampled pxf analysis as ideal sampling. I think that this is probably a good approximation if the maxacfreq parameter of the pss analysis (which sets a maximum limit for the time step) is set to a large enough value.

I mostly use sampled pxf analysis to simulate the effect of power supply ripple onto the jitter of a signal. When I divide the sampled pxf result by the slope (= derivative) of the signal at the sampling point, I get a transfer function that maps power supply ripple to signal jitter as a function of frequency. I have verified such results with transient simulations on many occasions and they always matched very well.



Hi Frank,

Now I am using sampled pxf to analyze relaxation oscillator which has comparator(very non-linear component) in it to compare a referecne votage and a sawtooth wave derived from charging and discharging a capacitor. Does the pxf still work since there is a very non-linear component in circuit? The analyzed output signal may be delayed from the comparator output? Does the delay and heavy non-linear component make the pxf fail?

BTW, I encounter convergence problem when running pss on the relaxation oscillator.

Any comment would be highly appreciated.

Thx,
Winston
Back to top
 
 
View Profile   IP Logged
Frank Wiedmann
Community Fellow
*****
Offline



Posts: 678
Munich, Germany
Re: question about PXF simulation in SpectreRF
Reply #11 - Mar 21st, 2013, 1:57am
 
I see no reason why sampled pxf should not work in your case. You might want to try using the tstab parameter to improve pss convergence.
Back to top
 
 
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.