• 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 SKILL
  3. Variation in output amplitude calculated by DFT() for an...

Stats

  • Locked Locked
  • Replies 0
  • Subscribers 143
  • Views 13819
  • 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

Variation in output amplitude calculated by DFT() for an ideal sine voltage source

deelal
deelal over 9 years ago

Hi,


Summary of problem:
I'm working on calculating the dft of some signals in Cadence. If I plot the DFT of a signal, say from 1GHz to 9GHz, for the same input amplitude over all frequencies, I get a DFT magnitude that varies greatly (-6dBm at 1GHz, -40dBm at 5GHz etc.).  For the same number of sampled points, same input amplitude, I would expect the same output magnitude over the entire frequency range.

My test circuit: An ideal vsin component from analogLib (frequency FIN, amplitude AmpIN) in series with a resistor, R1.

Methodology: In order to calculate the DFT of the output, here's what I do:

1. Use a 2^n number of FFT sampled points (npts).

2. Set a sampling frequency (FS)

3. Determine FIN as FIN=(prime*FS)/npts. This ensures that there is no spectral leakage and I have a prime number of cycles in the waveform.


Here is my code:

primes = '(29 53 79 103 131 157 181 211 233) ;prime numbers determined for FIN from 1GHz-9GHz

;set variables for dft

npts=float(256)
FS=float(10G)
TS=float(1/FS)
x=4                                          ;choose the fifth frequency, 5GHz
prime=float(nth(x primes))
FIN=float((prime/npts)*FS)
TIN=float(1/FIN)

a=TIN*1e15 ;this is to round off TIN and set a precision value upto a set number of decimal placez
b=round(a)
TIN=b/1e15


t1=10*TIN                  ;where to start strobing from
t2=float(t1+npts*TS)  ;last point to be strobed

analysis('tran ?start 5*TIN ?stop t2+5*TS ?skipstart t1 ?skipstop t2 ?strobedelay TS/2 ?strobeperiod TS)
desVar(      "AmpIN" 1    )
desVar(      "FIN" FIN    )
desVar(      "R1" 100    )
envOption(
    'analysisOrder  list("tran")
)
temp( 27 )
run()

fftIN=dft(VT("/OUT") t1 t2 npts "Hanning" 1 1 )
plot(VT("/OUT"))
plot(db20(fftIN))

In the documentation for DFT, it is mentioned that there is a 'coherent gain factor' setting that allows one to 'get consistent results regardless of window type', however, I am not sure how to use this, since the documentation is not clear on usage.

Can anyone shed light on this? Is this variation in magnitude just because of the way DFT is calculated, or is there some setting that I am missing?

  • 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