• 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. PSD Calculation of a Pulse Train after a Transient Simu...

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 125
  • Views 17355
  • 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

PSD Calculation of a Pulse Train after a Transient Simulation

Shifang Ju
Shifang Ju over 5 years ago

Dear Community,

I performed a very simple PSD calculation for a periodic pulse train that is generated using Verilog-A modelling. The pulse train has fixed high voltage 1V and low voltage 0V, fixed duty cycle of 50%, and fixed frequency of 1s. I ran the Transient Noise simulation using ADE L for 1000s (usingt Transient Noise analysis in order to directly acquire ADE L -> result -> main form -> PSD once the simulation finishes). Below are the signal waveform and transient noise simulation setting: 

The PSD calculation expression is therefore: db10(psd(VT("/M") 1 993 198400 ?windowName "Rectangular" ?smooth 1 ?windowSize 12400 ?detrending "None" ?cohGain 1))

However, after calculation, I got the spectrum as shown below, which has the frequency-domain spikes with height 10.99dB at fundamental (1Hz) and 1.45dB at 3rd harmonic (3Hz) and so on, which is counter-intuitive. Because theoretically for a standard 50%-duty-cycle pulse train the PSD at fundamental should be 10log(Cn^2)=10log(0.3183^2) = -9.94dB and at 3rd harmonic 10log(0.1061^2) = -19.49dB, and so on.

Is there anything incorrect with my method of acquiring the power spectrum?

Also, I tried to perform the PSD calculation using the same method (but updated simulation time and sampling frequency, etc.) setting the 50%-duty-cycle pulse train frequency to 100Hz and 10kHz. But the frequency tones at all the harmonics are -20dB and -40dB lower throughout the spectrum compared with the 1Hz case. Why is that (should the heights at the corresponding harmonics not be the same for those three cases)?

Many thanks!

  • Cancel
  • ShawnLogan
    ShawnLogan over 5 years ago

    Dear Shifang Ju,

    Please correct me if I am not interpreting your expression correctly, but studying the arguments of your psd() function suggests you are using a start time of 1 s, a stop time of 993 seconds and requesting that the analysis be performed using 198400 time points with a window size of 12400. You are also using a rectangular window (i.e., none).

    db10(psd(VT("/M") 1 993 198400 ?windowName "Rectangular" ?smooth 1 ?windowSize 12400 ?detrending "None" ?cohGain 1))

    If this is correct, I am concerning that your result includes significant folding due to the sampling process. Although your analysis includes an integral number of periods (992), your command is requesting that the analysis use 198400 time points - which suggests the analysis should use 200 points per waveform period. However, your value for the window size, 12400, is not a power of 2. Hence the analysis will round up that value to the next highest power of 2 or 16384. I believe your value of 12400 will cause your observation window not to be periodic and result in misleading results since 16,384 * 1/200 sec = 81.92 seconds (i.e., 81.92 is not an integral number of 1 sec periods).

    Have you tried to setting the number of samples per period to be such that when multiplied by a power of 2, (i.e., 8192), the  time is an integral number of your 1 sec periods? I would also recommend that you set the strobeperiod transient analysis option to be exactly equal to the sample time to avoid any interpolation errors.

    Does this help at all?

    Shawn

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to ShawnLogan

    Shawn (and Shifang Ju),

    This isn't an issue of the number of sample points not being a power of two, nor is it going to be strobeperiod-related. The number of sample points in a DFT or PSD calculation has not needed to be a power of 2 since IC617 - prior to that the number of samples (total or in the rolling window) did get rounded to a power of 2, but that doesn't happen any more. Such an error would have been far more significant - here's the results of your expression in an IC616 release:

    Similarly, the strobeperiod is not going to be relevant here, because the interpolation error on the square wave is going to be zero - except at the rise/fall edges, maybe. If those edges are faster than 5ms then it's also going to have no effect there either. 

    I did a DFT of a similar square wave:

    dB20(dft(v("m" ?result 'tran) 1 993 198400 "Rectangular" 1 "default" 1.0 ))

    the first harmonic is -3.922dB and the third harmonic is -13.46dB (so the delta between the two harmonics is what you're seeing - i.e. 9.539dB). The 1st harmonic should be 20*log10(0.5*4/pi) (0.5 is the amplitude) which is -3.922dB (exactly what the results are from this) and the 3rd harmonic should be 20*log10(0.5*4/(3*pi))which is -13.46dB (again, matching)..

    I'm interested in where your theoretical figures come from. The absolute values depend upon the window size - if you double the window size to 24800, then they go up by 3.01dB, if you halve to 6200, then they go down by 3.01dB. The power is going to be dependent upon the number of windows, and also the number of cycles - the more cycles, the more power there is in the 1st harmonic. So I think your hand-calculation is wrong here...

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Shifang Ju
    Shifang Ju over 5 years ago in reply to Andrew Beckett

    Hi Andrew (and Shawn),

    I am using Version 6.1.8. 

    I tried to do the dB20(dft... mentioned, and got the same reading in dB as you do at 1st and 3rd harmonics. But I am interested in where comes the expressions: 20*log10(0.5*4/pi) (0.5 is the amplitude)  and 20*log10(0.5*4/(3*pi))?

    Also the my theoretical figures are derived from the equation for the PSD function of a standard 50%-duty-cycled PWM signal with fixed period of 1 and constant on-amplitude of 1:

     .

    This equation is the Equation (13) of the paper: Stankovic et al.: Analysis and synthesis of randomized modulation schemes for power converters: https://ieeexplore.ieee.org/document/471288 . In which the D is the duty cycle in %, and the coefficient '(sin(pi*f*D)/pi*f)^2' corresponds to Cn^2, where Cn is the Fourier series coefficient for nth harmonic of the standard square pulse train. Therefore, at DC the power intensity should be 10log(0.5^2)= -6.02dB; at 1st harmonic, 10log((sin(pi*1*D)/pi*1)^2)= -9.94dB; at 3nd harmonic, 10log((sin(pi*3*D)/pi*3)^2)= -19.49dB, and so on. (Also shown in Fig. 4, 'standard modulation' in the paper).

    However, these values are far away from the readings at 1st and 3rd harmonics in both your and my power spectrum (11dB at 1st harmonic and 1.5dB at 3rd harmonic). Could you please explain why and how to normalize the calculation in order to get the PSD that meets the theoreticals?

     

    Many thanks,

    Shifang

    • 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