• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC Design
  3. How to obtain Discrete-Time (DT) response from a switched...

Stats

  • Locked Locked
  • Replies 52
  • Subscribers 127
  • Views 30964
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to obtain Discrete-Time (DT) response from a switched-cap (SC) circuit (integrator)?

bernd2700
bernd2700 over 3 years ago

Hello everybody!

Before I start my questions, first I have to cite from Mr. Ken Kundert’s excellent paper “sc-filters  -  Simulating with Cadence SpectreRF” the following: “Usually, with switched-capacitor circuits, designers are interested in the discrete-time behavior as switched-capacitor filters are embedded in sampled-data systems. SpectreRF is set up to report on the continuous-time behavior. As such, you must take steps to get the discrete-time behavior if that is what you need. The PNoise analysis does provide a built-in feature that can be invoked in order to determine the noise of a filter acting as a discrete-time system. Otherwise you will need to add a idealized sample-and-hold to your circuit.”

 

He wrote to me at forum “designers-guide.org/.../YaBB.pl” the following: “I'm afraid I have no experience with sampled PAC”, because this was implemented later. So I count on you, Cadence guys that hopefully YOU have an answer to me:

 

Q1: I thought (wrongly) I would obtain the DT response of a system if I specify the special option “SAMPLED” of SpectreRF Periodic-AC (PAC). This is not the case. So, if anyone please could tell me what to do to get the DT frequency response for the PAC analysis? (see graphs below)

 

Q2: Do YOU have an idea which feature can be invoked to obtain the DT system response in the PNoise analysis? As you see above, Ken Kundert indicated so, but did not say which feature. Once, he wrote to me: “I think they confused autonomous sampling (sample very T seconds) and triggered sampling (sample at a threshold crossing), and assumed that triggered sampling in PNoise was enough”.

Ad Q1:

You see an CT (Conttinuous-Time) analog Low-Pass-Filter (LPF) which is simulated with Cadence SpectreRF PAC _sampled and the result of it below.

Ok, this time, it's not a SC circuit, but this is not the topic. It rather is: How to obtain the Bode diagram of the _DT_ response of any circuit.

You can recognize the obtained spectrum is NOT symmetrical around half the sampling frequency fs/2, as I was expecting, but it still seems to show the CT response.

Many thanks in advance and best regards,

bernd2700

  • Cancel
Parents
  • SpiceMonkey
    SpiceMonkey over 3 years ago

    You have got the right DT bode plot.

    For time-averaged PAC, you have got a response looks like sinc function (green one, it looks right)
    For sampled PAC, you should get a replica response in every Fs frequecncy (blue one, it also looks right)

    The blue one seems not that accurate, if you change you frequncy display type, or try linear with smaller step, or logrithm with 100 points per decade, you will get a more accurate response: exact replica every fs and each has fs/2-symmetry .

    For CT circut, I think you could also get a sampled PAC: just place a vpulse without any connection,  then use vpulse's frequecy as pss-beat-frequency and use it's posedge as sampled event. (make sure your circuit is periodic or just simply set the input transient signal = zero).

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • bernd2700
    bernd2700 over 3 years ago in reply to SpiceMonkey

    Dear SpiceMonkey,

    Thank you for your reply!

    You write “For sampled PAC, you should get a replica response in every Fs frequecncy (blue one, it also looks right)”. Yes, you are exactly correct, I “SHOULD GET”, but I think I unfortunately “do NOT get” if I watch the blue curve. Why? Because a DT spectrum must be symmetrical around fs/2, and fs/2 in my case is 500 Hz. So I would have expected that the line is up at 0 dB again at fs = 1kHz in the Bode diagram, as it is also 0 dB for DC (here at e.g. 1 mHz since it’s a log plot). But it does NOT show 0 dB at fs = 1kHz. Instead, it goes further down with e.g. -20dB/dec, which, as a consequence, tells me, it is NOT the DT spectrum / response what I get but something else. Which simulator setup do I miss, or what I am doing wrong here? So, what to do, in order to obtain the Bode plot’s DT response, since Mr. Kundert perfectly has written in an article: “... you must understand upfront if you are interested in the CT or in the DT response of a system” => And yes, I am interested in the DT response and was thinking: This, I will get with the “PAC _sampled_” analysis at a specific (e.g. rising or falling) edge (every 1 ms), but as the Bode plot reveals, for me ( = not being symm. around fs/2) I still did NOT obtain the DT response.

    I even have 1000 points per decade, and from the below picture, you see, it is NOT symm. around fs/2 = 500 Hz, therefore your first sentence “You have got the right DT bode plot” confuses me.

    If you look at my schematic, it is exactly what I already did what you propose: I added a vpulse with 1kHz and used it for the PSS, see voltage “v1” and node “p1” there.

    Above Fig.: SpectreRF PAC sampled analysis, e.g. at rising edge (@ 500us): There is NO line going up to 0 dB again at fs=1kHz => No DT Bode plot!

    Thanks a lot so far and I am curious about your answer(s),

    bernd2700

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Frank Wiedmann
    Frank Wiedmann over 3 years ago in reply to bernd2700
    bernd2700 said:
    As a consequence, the PAC must sample the output with at least 200 kHz to properly fulfill Shannon (Nyquist).

    No, sampled PAC always samples with the PSS fundamental frequency. Of course it is possible to sample with a frequency that does not fulfill Shannon (Nyquist), you just have to deal with aliasing in this case. There are always many ways to interpret a sampled signal; sometimes knowledge about the frequency of the input signal helps with the correct interpretation. I already told you earlier:

    Frank Wiedmann said:
    The sampled PAC analysis only looks at the output at the input frequency (because I chose maxsideband=0 as a parameter) and only plots it at this frequency. The fact that the sampled output signal could also be interpreted as coming from different (aliased) frequencies is not taken into account here. If you also want to see the result at the aliased frequencies, you can set maxsideband to a larger value, which will give you copies of the result shifted by multiples of the pss fundamental frequency.

    bernd2700 said:
    And if I tell the PAC (or PSS in that case) “maxacfreq. = 100 kHz”, then I expected also comparable results.

    Setting maxacfreq too low will simply give you an inaccurate PAC result. The maxacfreq parameter of the PSS analysis limits the maximum timestep, so that high frequencies in the following small-signal analyses (PAC, PXF, etc.) can be represented with the required accuracy.

    bernd2700 said:
    So I will change now my procedure for the zero-stuffing method

    I am not sure if it is very useful to invest a lot of effort into these "zero-stuffing" experiments. As I told you:

    Frank Wiedmann said:
    You only needed to do the "zero-stuffing" because in your transient analysis, you were sampling the output with a higher frequency than the frequency of the sample-and-hold (which is not possible in sampled PAC).
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • bernd2700
    bernd2700 over 3 years ago in reply to Frank Wiedmann

    Dear Frank,

     

    Yes, obviously I have a lack of understanding the PAC, and as a consequence, you unfortunately have to tell me: “I already have written you this and that”. But, believe me, it is NOT because I haven’t read all your messages carefully!

     

    So, I dare to summarize what you have said so far in my own words now, how I can imagine the PAC sampled is working. Please have a look:

    If I want to know what is the output amplitude at e.g. 4559 Hz for testcase A) ( = the circuit with the “Ideal S&H” only), I simply inject a sinusoid of only this frequency, run a transient analysis (with setting “maxstep” equal “1/maxacfreq”) until to be in steady-state condition. Then basically should I have the same accuracy as the PAC receives, correct? Subsequently, over the Cadence calculator’s function “sample”, I sample the output with my PSS fundamental frequency with 1kHz e.g. on every rising edge of the PSS clock source “V0”, and then measure the amplitude result by doing “(max-min)/2”. Correct? Then, I think, I have fulfilled your statements: I sample only once per fundamental PSS period, just at the right edge (to also have the phase correct), and I will get aliased components as well.

    ==> What is NOT clear to me, is the following: This “(max-min)/2” takes place in Time-Domain (TD). But you also write “The sampled PAC analysis only looks at the output at the input frequency”. So how the PAC can distinguish this, if something comes from an aliased frequency or not, if the operation is done in TD??

    And obviously, I got the results of -0.19 dB (so the straight 0 dB line) by doing “(max-min)/2” for the “PAC sampled, rising EDGE”, to be more precisely.

    ==> How can I imagine then / what does PAC internally do, in order to get from this “edge” to the “time averaged” option? I do not have to run it again, but only select this option of the already calculated results.

     

    Why I am asking this? Because without having understood how the PAC works, I think, it will be hard to find a valid procedure, that will then produce the same (or at least similar + understood limitations) results as the PAC itself. At the end, I want to tell my AC analysis over MT: “Please give me the equivalent result of PAC sampled rising edge” or “now please for time averaged”. Of course, for every DUT, exactly the same procedure shall hold true (Not: For circuit A do zero-stuffing, for circuit B another thing to get the same results as PAC option X). I have the feeling that I am near, but not still there: I think, I could reproduce all the PAC results of all options ("edge", "time avg.") of all the 3 test-circuits (DUTs), but I had to apply different procedures (1x DFT + zero-stuffing, and 1x DFT without it, to be equivalent to the “PAC sampled rising edge”, for instance).

     

    Many thanks,

    bernd2700

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Frank Wiedmann
    Frank Wiedmann over 3 years ago in reply to bernd2700
    bernd2700 said:
    But you also write “The sampled PAC analysis only looks at the output at the input frequency”. So how the PAC can distinguish this, if something comes from an aliased frequency or not, if the operation is done in TD??

    More precisely, I should probably have said: "With maxsideband=0, the sampled PAC analysis interprets the output as a signal at the input frequency and also plots it at this frequency." Actually, the sampled PAC analysis does not run an additional time-domain simulation but uses the internal results of the time-domain PSS analysis.

    bernd2700 said:
    How can I imagine then / what does PAC internally do, in order to get from this “edge” to the “time averaged” option? I do not have to run it again, but only select this option of the already calculated results.

    When I look at the directory where Spectre saves its simulation results, I can see that when I run a sampled PAC analysis, Spectre also generates all the files for a normal PAC analysis. Probably, the corresponding calculations are either a prerequisite for the sampled PAC analysis or don't cause much additional computational effort (maybe Andrew or someone else from Cadence can comment on this). Fundamentally, however, normal PAC and sampled PAC are different analysis types and there is no direct way to generate one result from the other.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • bernd2700
    bernd2700 over 3 years ago in reply to Frank Wiedmann

    Dear Frank ( & Andrew),

     

    Yes, ok, that the PAC measures the amplitude and just plots it at the already known input frequency. => I am sorry, this was a stupid one, I don’t know, how it could not have been clear to me without your last add-on. But is the rest of my short summary so far ok at least, “how I can imagine the PAC sampled is working”?

    --------------

    However, an important stuff is the following: For case B) (= the SC-filter), you proposed to do zero-stuffing ( = only take every 10th sample and just REPLACE the others by “0”). This then was matching to the PAC sampled, option “ris. edge” perfectly (!!), because I also did herewith “ideal Dirac sampling” (but with additional unfiltered decimation by factor 10), see e.g. in below picture the black, red, orange columns “B”, “L”, and “V” for easier understanding. Subsequently, for comparison, I also did a zero-stuffing with up-sampling ( = higher fs). See the black, blue, green, and pink values. Herewith, I “suddenly” now match to the “PAC sampled, option “time averaged”. My “DT response” (see red line, left graph) is gone (see red line, right graph), even BEFORE it is flavored with the comb-filtering (right pic, cyan). And, moreover, if I do the “replacing zero-stuffing procedure” but with factor 5 or 20, I get again other results than the PAC (not shown, e.g. 2 "peaks" at only 2kHz and 4kHz instead). It just was “by chance” the factor 10 correct, but I mean, I cannot adapt my analysis each time to the DUT! The analysis process has to be stupidly every time the same, regardless which circuit I am analyzing with it! So:

    ==> What can I do, in order to match with the same procedure of any DUT to the same PAC option every time? Maybe my idea now is to sample even again e.g. a factor 10 higher and then do not look to the results from (fs/2)/10 until (fs/2) ?? (A sim. for that is running already, but it is running since some days now for just this little circuits.)

    I would like to can say: With doing “brute-force zero-stuffing” = a reasonable factor, say 10, for doing ideal Dirac sampling and thus replacing the rest with zeros, I always resemble from DC until “(fs/2)/10” the PAC sampled, option “(ris./fal.) edge”. And when I subsequently comb-filter it, I always resemble the PAC sampled, option “time avg.” So something like this I have in mind.

    (click to enlarge)

    Left: Orig & Zero-stuffed with same fs (“replace by 0”)        Right: Orig & Zero-stfd. w. higher fs (“up-sample”), shown to orig. fs/2

    --------------

    You write: “normal PAC and sampled PAC are different analysis types”. We previously said: “normal PAC = “PAC sampled, time avg.” (e.g. Andrew: Correct?). To be now more precise, we can re-write it into: “ ‘PAC sampled, time avg.’ and ‘PAC sampled, (ris. or fal.) edge’ are different analysis types”. You said, I can imagine the later to do “(min-max)/2” (see above for details) which perfectly worked.

    => How can I imagine the “PAC sampled, time avg.” to be working then?

    --------------

    Obviously, this thread has caught the interest of a lot of other people in the meantime, and so I say to you “Thanks so much for your help again”, it seems to be not only good for me...

    bernd2700

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Frank Wiedmann
    Frank Wiedmann over 3 years ago in reply to bernd2700
    bernd2700 said:
    For case B) (= the SC-filter), you proposed to do zero-stuffing ( = only take every 10th sample and just REPLACE the others by “0”).

    The factor 10 was because in your transient simulation, you were sampling at a 10x higher frequency than the frequency at which your sample-and-hold was running, so that you were getting 10 identical samples in a row each time.

    bernd2700 said:
    What can I do, in order to match with the same procedure of any DUT to the same PAC option every time?

    For the sampled PAC analysis, sample the result of the transient simulation at the same frequency as the PSS fundamental frequency (and at the same position in the PSS period as is specified by the setup for the sampled PAC analysis).

    bernd2700 said:
    How can I imagine the “PAC sampled, time avg.” to be working then?
    Frank Wiedmann said:
    This is just the nomal PAC analysis without any sampling, so you simply need to run an FFT on the output signal in order to get the result in the frequency domain.

    What is probably confusing you is that fact that this result is also available in the Direct Plot Form after a sampled PAC analysis. When you sample the output of the transient simulation at higher and higher frequencies, your result is simply getting closer and closer to a Fourier transform of the complete output signal (which in this case is the piecewise constant output of the sample-and-hold).

    Frank Wiedmann said:
    By the way, the normal PAC analysis with maxsideband=0 like in my example also only looks at the output signal at the input frequency. For a piecewise constant signal, there will be additional frequency components in the spectrum, possibly with much larger amplitudes.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • bernd2700
    bernd2700 over 3 years ago in reply to Frank Wiedmann

    Dear Frank,

     

    You wrote: “When you sample the output of the transient simulation at higher and higher frequencies, your result is simply getting closer and closer to a Fourier transform of the complete output signal (which in this case is the piecewise constant output of the sample-and-hold).”

    Ok, on the one side, it sounds very logical to me what you write, and I really get a more & more “complete output signal” ( = the ZOH effect for case A) ) with my normal MT AC analysis (as described in the Visio drawing somewhere above), so I see it perfectly matching to Cadence PAC sampled, time avg. option, just until higher & higher frequencies.

    On the other side, I thought, to as well match to the other option of the PAC sampled, namely e.g. “rising edge”, if sample high enough and therefore can even afford doing factor 10 “brute-force” zero stuffing then, I maybe also resemble “Ideal Dirac sampling”, so what you wrote once, this option of the PAC sampled does. And so, I thought, I also would get the frequency response of the DUT ( = a 0 dB straight line for testcase A ) , matching to PAC sampled e.g. ris. edge option at least until (fs/2)/10 = 5 kHz. (We have seen, that the DFT generally starts to become “effects” when getting close to its end (as also your sim. has shown), so let’s ignore  frequencies above this (fs/2)/10, and I fully would be satisfied with it.)

     

    You write: “For the sampled PAC analysis, sample the result of the transient simulation at the same frequency as the PSS fundamental frequency”

    Ok, first many thanks, Frank, for this important info!!

    It sounded great in the first seconds when reading this, but now, I think, what does this really mean for my testcase A) ? : In other words, what will not get clear in my mind now, is the following: As it seems to work also with the other “time avg.” option, is there as well an equivalent general way ( = without knowing exactly the DUTs behaviour!) to match to the PAC sampled, e.g. rising edge option, at least until (fs/2)/10 ? Or is it _theoretically_ maybe not possible at all, to solve for this option in general (e.g. sample 100 times higher and do 10x zero stuffing or I don’t know what)? It really would be a pity, because WITH knowing the DUT (= just doing exactly factor 10x zero-stuffing), I already saw, my AC MT matches even _perfectly_ to Cadence PAC sampled, rising edge results!

    If I put a higher PSS fund. freq. (e.g. 10kHz) than my highest DUT freq., here of the S&H circuit ( = 1kHz), the PAC reports just constantly “-6.4 kdB” for both options. But on the other hand, I need a significantly higher sampling rate for my MT AC analysis than 1kHz, because I can plot until fs/2 and maybe in addition do not look at frequencies from (fs/2)/10 ... fs/2. So, if I chose to “sample the result of the transient simulation at the same frequency as the PSS” to obtain the “same” results, and e.g. I chose it to be 100 Hz, then I can plot only until max. 50 Hz over my MT AC analysis without aliasing, giving really good results until maybe 5 Hz. But this is bad, if the DUTs frequency is already much higher with 1kHz in this case. (As a sim shows, for the PAC, it seems it does NOT make a difference, if I chose my clock source and thus the PSS fundamental frequency to be 1kHz or 100 Hz, I every time get the same 0dB straight line for testcase A) if I chose “ris. edge” option, or the comb filter effect if I chose “time avg.” option.)

    ==> Frank, what would you propose for this testcase A) to be able to somehow at least produce similar results with a general applied procedure over my MT AC analysis, say at least until 5 kHz, as the PAC sampled, “edge” option?

    You as an expert, it seems, of course you have the complete picture in your head, what in my case is good or bad to do in order to reach this? Also in the past, only _after_ explanation from you, the one or other thing got clear to me, and so also here: I would appreciate really a lot, if you could give me an advice for this case what to do. Possibly, I overlook something, again and again, but for me, it is at the moment: If to sample at the same freq. as PSS fund., and sample with 10kHz, the PAC is probably correct but no good (-6.4kdB). If sampling at 1 kHz or lower, the PAC has good results, but I cannot compare to it since I do not even see the complete freq. response of the DUT which is at 1 kHz. (I know now, PAC produces just 1 tone, but I already got perfect matching at least WITH knowing my DUT over my Multi-Tone!)

    (Besides I also tried to read again Mr. Kundert’s article above and in the internet to get some more insight about the PSS, but I couldn’t gain or bring down the info to answer my above question for this case.)

     

    You write: “This is just the nomal PAC analysis without any sampling, so you simply need to run an FFT on the output signal in order to get the result in the frequency domain.”

    Yes, of course, also here, I remembered your sentence, but I meant: What does this mean in the time-domain? So an equivalent formula or something like this “(max-min)&/2” as for the “PAC sampled, edge triggering”. By the way, for my MT AC analysis I always have to sample with the Cadence calc. cmd. “sample” (e.g. with 100kHz) to be able port the data to Matlab!

     

    Many, many thanks, Frank, for all the past answers, and of course now in advance! I am really happy that you are both: a) an expert person, & who is b) in addition willing to write back!

     

    bernd2700

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Frank Wiedmann
    Frank Wiedmann over 3 years ago in reply to bernd2700
    bernd2700 said:
    And so, I thought, I also would get the frequency response of the DUT ( = a 0 dB straight line for testcase A )

    You will only get this if you sample with the same frequency at which the sample-and-hold is running (which the sampled PAC analysis does automatically), otherwise you will get a sinc shape from the piecewise constant function. And if you want to see a repeating pattern in the frequency domain (that does not contain any additional information, however), you can put any number of zeros between every two "real" samples in order to model Dirac sampling.

    bernd2700 said:
    If I put a higher PSS fund. freq. (e.g. 10kHz) than my highest DUT freq., here of the S&H circuit ( = 1kHz), the PAC reports just constantly “-6.4 kdB” for both options.

    This is just nonsense, you cannot choose a PSS period that is smaller than the periodicity of the circuit (it's surprising that the PSS analysis converges at all in this case) and -6.4 kdB is simply Cadence's way of expressing 0 in dB.

    bernd2700 said:

    You write: “This is just the nomal PAC analysis without any sampling, so you simply need to run an FFT on the output signal in order to get the result in the frequency domain.”

    Yes, of course, also here, I remembered your sentence, but I meant: What does this mean in the time-domain?

    I'm afraid that there is no direct equivalent in the time domain. You need to transform the result into the frequency domain in order to compare it to the result of the normal PAC analysis.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • bernd2700
    bernd2700 over 3 years ago in reply to Frank Wiedmann

    Dear Frank,

     

    Higher PSS fund than circuit:

    Because of the result, it was clear that it is obviously nonsense, but what was not clear to me: _When_ will happen this nonsense results, I mean, which parameters need to be in which way to (not) happen. => Therefore I thank you very much for stating the “rule” behind that easily and clearly: “Never chose PSS period smaller than the periodicity of the circuit”.

    Side question: What is the difference if I chose PSS fund. 100 Hz or 1 kHz for testcase A), the “IdealS&H”? From looking at the overlaid Bode plots, I don’t see any. Or in other words: When, if at all, this becomes relevant (e.g. for this circuit)?

     

    Equiv. operation for normal PAC in TD:

    Also here, thank you for stating this clearly, because otherwise I never know: Is there maybe any, or is there not? And exactly this important info you find nowhere else written (at least I didn’t find it).

     

    Constant 0 dB straight line for testcase A) for PAC sampled “ris. edge”:

    You write: “You will only get this if you sample with the same frequency at which the sample-and-hold is running (which the sampled PAC analysis does automatically)”.

    Again here, thanks for this clear statement, Frank! However, here the things are not so clear anymore to me, because:

    First, just for safety to repeat: The PAC is giving me a constant 0 dB line, regardless if I chose its fund. freq. to be 100 Hz or 1kHz (the S&H’s update rate is given with 1kHz).

    Now, I just repeat a former question & answers:

    Q.:) “What can I do, in order to match with the same procedure of any DUT to the same PAC option every time?”

    A.:) “For the sampled PAC analysis, sample the result of the transient simulation at the same frequency as the PSS fundamental frequency (and at the same position in the PSS period as is specified by the setup for the sampled PAC analysis)”

    And:

    “The sampled analyses of Spectre always sample exactly once per period (as given by the PSS fundamental frequency). You only needed to do the "zero-stuffing" because in your transient analysis, you were sampling the output with a higher frequency than the frequency of the sample-and-hold (which is not possible in sampled PAC).”

     

    So, let’s assume I follow your answer, and I sample with the same freq. as the PSS fund., let’s chose e.g. 100 Hz, so doing “sample(v("/Vo_sh" ?result "tran") 0 ‘stoptime’ "linear" 0.01)”.

    With the PAC itself, it’s nevertheless possible to plot the Bode diagram until the frequency I want (e.g. up to 100 kHz). However, if I don’t overlook something, with my MT AC analysis, if I follow the “restrictions” from above ( = use same freq.), the sinusoidal input stimuli can therefore go up to max. 50 Hz in this case to not get aliasing (because in contrast to PAC I put many of them at the same time) and I can plot the results also only until max. 50 Hz, where I see nothing how the DUT behaves around its period of 1ms. What I remember, is: Doing multiple MT AC analyses, each for every Nyquist band, so one from 0..50Hz, the 2nd from 50..100 Hz, until the frequency I want. I hope there is another doable way (because doing 100 MT analyses to see up to e.g. 5kHz I cannot reasonably do), or don’t I have a chance over my MT AC analsyis for comparing to PAC sampled edge option in a general way? Modelling ideal Dirac sampling with 10x higher fs and subsequent brute-force zero-stuffing did not work out for my DUT “purely analog RC-LPF”.

    So what I am not able at the moment to answer from my knowledge point of view, is: Do I search for a “good combination” where there cannot be one from theory, or _is_ there a solution and I just haven’t found it yet?

    With “solution”, I mean, I would like to as well be able to set up a general rule for the PAC sampled (ris./fal. edge), as I already did successfully for the “time avg.” option: Here, the rule / solution for my MT AC analysis to match to Cadence is, I discovered, simply: Sample with fs = 10 times as fast as I want to really compare the results to Cadence and just “forget” the last decade, so e.g. (I like examples:) Sample testcase A) with fs=100 kHz, and look at the results only until (fs/2)/10 = 5 kHz and I will automatically get a nice matching to Cadence PAC sampled time avg. until at least 5kHz, maybe even 10 kHz, time avg. option (see right picture with the dark yellow added curve 17 days ago). And this rule seems to ALWAYS work with ANY DUT.

     

    Thanks a lot,

    bernd2700

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Frank Wiedmann
    Frank Wiedmann over 3 years ago in reply to bernd2700
    bernd2700 said:
    The PAC is giving me a constant 0 dB line, regardless if I chose its fund. freq. to be 100 Hz or 1kHz (the S&H’s update rate is given with 1kHz).

    You can of course choose the PSS period to be a multiple of the circuit period, but this usually only has disadvantages, so nobody is doing it.

    bernd2700 said:
    Doing multiple MT AC analyses, each for every Nyquist band, so one from 0..50Hz, the 2nd from 50..100 Hz, until the frequency I want. I hope there is another doable way (because doing 100 MT analyses to see up to e.g. 5kHz I cannot reasonably do), or don’t I have a chance over my MT AC analsyis for comparing to PAC sampled edge option in a general way?

    In general, you don't have a chance because you cannot distinguish between aliased signals from different Nyquist bands after sampling. The only workaround that I can see would be to choose the input frequencies in the different Nyquist bands in such a way that there is no aliasing between them and then assign them to their (unique) original frequency for plotting.

    For example, if you sample with 1 kHz and have input frequencies of 200 Hz, 400 Hz, 600 Hz and 800 Hz, this will not work because 200 Hz will alias with 800 Hz and 400 Hz will alias with 600 Hz and you will not be able to distinguish them. However, if you set the input frequencies at 250 Hz, 450 Hz, 650 Hz and 850 Hz, you will be able to uniquely identify all frequencies because you know that there is no input signal at 150 Hz or 350 Hz.

    And just as a reminder:

    Frank Wiedmann said:
    And of course this method will only work for a linear circuit.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • bernd2700
    bernd2700 over 3 years ago in reply to Frank Wiedmann

    Yes, thanks, clear & thanks for the example (Did I say, I like examples?!).

    However, this ("linear") should be exactly the same with the PAC, because also this should be only for linear systems (In addition, as I have written somewhere above, for my MT AC analysis over transient, I have to wait for steady-state condition to match to the PAC perfectly.). I will write a summary...

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • bernd2700
    bernd2700 over 3 years ago in reply to Frank Wiedmann

    Yes, thanks, clear & thanks for the example (Did I say, I like examples?!).

    However, this ("linear") should be exactly the same with the PAC, because also this should be only for linear systems (In addition, as I have written somewhere above, for my MT AC analysis over transient, I have to wait for steady-state condition to match to the PAC perfectly.). I will write a summary...

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • bernd2700
    bernd2700 over 3 years ago in reply to bernd2700

    Dear Frank, dear all,

     

    Ok, also thanks for stating this that clearly ( = that there isn’t really the chance for properly modelling PAC sampled, edge triggered (ris./fal.) option). I think this closes then this forum thread.

    I have written here a summary for me and for all the other readers as well, for the most important points made, as follows:

    (I try to be as accurate as possible, nevertheless I would wish to ask you, Frank, to read through it and - in case – give a corrective action please, if you find any irregularities. Or also add something, if I forgot an important point made.)

     

    ================

    ||   S U M M A R Y :   ||

    ================

     

    CT or DT answer of a circuit:

    The original topic was: “How to obtain Discrete-Time (DT) response from a switched-cap (SC) circuit (integrator)?”

    My whole question started based on Mr. Ken Kundert’s paper “sc-filters  -  Simulating with Cadence SpectreRF”: In there, he basically wrote: “... you must understand upfront if you are interested in the Continuous-Time (CT) or in the Discrete-Time (DT) response of a system.”

    Following this, I originally thought, the user can freely chose through the analysis type (e.g. by chosing “Normal PAC” or “PAC sampled”, if he/she is interested in the CT or DT behaviour of the DUT ( = circuit). This turned out to be wrong, as Frank correctly has written: “If the circuit isn’t DT, you won’t get a DT response” – as simulations with the testcase / Device-Under-Test “purely analog RC-LPF” have proven.

    Most probably, Ken Kundert meant in his article: If you have for instance any purely CT circuit (e.g. this RC-LPF) and want to see its DT response (because e.g. it will get sampled at a later stage by someone else, so by a subsequent, additional CIRCUIT), you as well will have to introduce additional steps if you also want to see what will this DT behavior look like at the end (so you will have to MODIFY your CIRCUIT, e.g. install an additional “Ideal S&H” block). But in any case, you will have to do changes to your circuit, to see a DT for a purely CT DUT, like the RC-LPF, because a CT circuit does not have a DT answer!

    Frank said: “And if you want to see a repeating pattern in the frequency domain (that does not contain any additional information, however), you can put any number of zeros between every two "real" samples in order to model Dirac sampling”.

     

    Cadence PSS and PAC analsyes:

    There are several options to either chose:

        1) “Normal PAC”

        2) “PAC sampled” ...

        2a) ... selectable option “time averaged”

        2b) ... selectable option “edge” triggered (rising or falling) , “autonomous” sampling

    A personal statement from Ken Kundert is: Do not confuse “autonomous sampling (sample very T seconds) and triggered sampling (sample at a threshold crossing)”. The “PAC sampled” of course, uses “autonomous sampling (sample very T seconds)”.

    Frank made the following important statements about Cadence’s Spectre RF “PSS” and “PAC” analyses:

    *) 1) = 2a)  , so this means: “Normal PAC” yields the same analysis result as “PAC sampled”, option “time averaged”.

    *) “Fundamentally, however, normal PAC and sampled PAC are different analysis types and there is no direct way to generate one result from the other.”

    *) From another thread: “Sampled PAC analysis in Spectre performs ideal Dirac sampling”.

    *) If one can see a repeating pattern with multiple of fs in the Bode plot: “The repetition in the frequency domain comes from the circuit, not from the sampled PAC analysis by itself.”

    *) How can I imagine, the PAC sampled, “edge (ris./fal.)“ is working? => “Conceptually, you can get the amplitude of the result of a sampled PAC analysis result in the following way: Apply a sine with the frequency of interest at the input (with an amplitude that is still within the linear range of the circuit), then note all the values of the output signal at the sampling timepoints (given by the threshold crossings of the sampling signal). The difference between the maximum and the minimum of these values is twice the output amplitude (because you are measuring peak-to-peak).”  => So one has to do “(max-min)/2”, and I also add the following remark: Be sure that the transient sim. is long enough to has reached steady-state condition in order to really match to the PAC sampled, ris./fal. edge analysis.

    *) How can I imagine the “PAC sampled, time avg.” to be working then? => “This is just the nomal PAC analysis without any sampling, so you simply need to run an FFT on the output signal in order to get the result in the frequency domain.“ However, “there is no direct equivalent in the time domain. You need to transform the result into the frequency domain in order to compare it to the result of the normal PAC analysis.”

    *) “The sampled analyses of Spectre always sample exactly once per period (as given by the PSS fundamental frequency).”

    *) “The sampled PAC analysis only looks at the output at the input frequency (because I chose maxsideband=0 as a parameter) and only plots it at this frequency. The fact that the sampled output signal could also be interpreted as coming from different (aliased) frequencies is not taken into account here. If you also want to see the result at the aliased frequencies, you can set maxsideband to a larger value, which will give you copies of the result shifted by multiples of the pss fundamental frequency.”

    *) “sampled PAC always samples with the PSS fundamental frequency. Of course it is possible to sample with a frequency that does not fulfill Shannon (Nyquist), you just have to deal with aliasing in this case.”

    *) “you cannot choose a PSS period that is smaller than the periodicity of the circuit”.

    *) “You can of course choose the PSS period to be a multiple of the circuit period, but this usually only has disadvantages, so nobody is doing it.”

     

    How to model the Cadence PSS and PAC analyses themselves

    Then, I would have liked to “reproduce” the two PAC sampled options 2a) and 2b) over a Multi-Tone analysis (That was: Generating Multi-Sinusoids with Matlab, use that as input stimulus for a Cadence transient simulation and import back the data to Matlab again) and tried to compare this to Cadence PAC with the following 3 test-circuits (DUTs):

    *) A purely analog RC-LPF

    *) An “Ideal Sample & Hold” from Ken Kundert

    *) A Switched-Cap lossy integrator = SC. Low-Pass-Filter

    It always was very nicely and “easily” possible to match to Cadence PAC for option “time avg.” for 3 all test-cases (at least sometimes then with higher sampling rate & then forget last frequencies or max. decade when getting close to fs/2), so just to blindly apply the AC-analysis-over-MT-procedure without knowing the DUT (circuit).

    For the PAC, option “edge” (ris./fal.), this is different. A perfect match can be possible if you KNOW your circuit (DUT), but unfortunately GENERALLY it is NOT easily possible to find a comparable procedure which can be applied blindly to any DUT. The reason is that Cadence PAC does sampling with the PSS fundamental frequency (clock e.g. set to 1 kHz) , which can only be equal or lower than the operating frequencies of the DUT (e.g. 1 kHz), and thus, if there is aliasing ( = if the Bode plot at higher frequencies is requested, e.g. at 100 kHz), it does not matter, because it injects only 1 sinusoid at a time, knowing of course its input frequency and thus be able to plot the output amplitude also it at this frequency).

    However, to be able to reproduce the PAC:

    Q.: “What can I do, in order to match with the same procedure of any DUT to the same PAC option every time?”

    A.: “For the sampled PAC analysis, sample the result of the transient simulation at the same frequency as the PSS fundamental frequency (and at the same position in the PSS period as is specified by the setup for the sampled PAC analysis).”

    Thus, for my MT AC analysis, as there are more tones at a time, to be comparable to the Cadence PAC sampled “edge” option, I had to stay with the sampling freq. equal or below the DUTs operating frequencies (e.g. 1 kHz), to not create aliasing and therefore to be able to distinguish them blindly for any case. But then of course I can only plot until up to fs/2 (e.g. 500 Hz) which is (much) smaller than the DUTs freq., resulting in only seeing a (small) part of the Bode plot compared to Cadence PAC. So the comparison is of limited use. And if doing a work-around and choosing the input tones in a wise way (as Frank proposed in his above example = to be able to distinguish between the orig. input and aliased frequencies), nevertheless you again have to exactly know your DUT (its operating freq., e.g. 1 kHz), so again no general valid procedure unfortunately.

     

    As said, I hope, I above summarized all the important points made & again, I want to explicitly express my gratitude to Frank Wiedmann, for all his valuable inputs!

     

    Have fun,

    bernd2700

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Frank Wiedmann
    Frank Wiedmann over 3 years ago in reply to bernd2700
    bernd2700 said:
    A personal statement from Ken Kundert is: Do not confuse “autonomous sampling (sample very T seconds) and triggered sampling (sample at a threshold crossing)”. The “PAC sampled” of course, uses “autonomous sampling (sample very T seconds)”.

    In my example from the beginning of this discussion, the timepoint for sampling is given by the rising zero crossing of the voltage at the smp node. However, for this ideal circuit with a piecewise constant output, it does not really matter at which point of the PSS period the sampling is done (it does matter when you have a real sample-and-hold with settling behavior).

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information