+ Post New Thread
Results 1 to 13 of 13
  1. #1
    Junior Member level 2
    Points: 119, Level: 1

    Join Date
    Jan 2017
    Posts
    24
    Helped
    0 / 0
    Points
    119
    Level
    1

    Difference between PSD ( power density spectrum ) and Spectrum measurement in Cadence

    Hello there,

    I am doing a transient analysis on a 3rd order SD modulator ( MASH topology ) and i want to plot the power spectrum of the quantization noise.

    Thing is, that i am confused on how to do that.
    My first try was sending the output sequence to Measurement tab---> Spectrum and ploting the curve.
    My second try was sending the output sequence to the calculator and using the psd() function , afterwards use db10() function and finally plotting.

    The 2 above mentioned curves have the same slope but a constant difference between them of about 40 dB ( e.g the first curve has peak at -20 dB and the second at -60 dB).

    Could you enlighten me as to which is the correct way?

    Thank you

  2. #2
    Junior Member level 2
    Points: 119, Level: 1

    Join Date
    Jan 2017
    Posts
    24
    Helped
    0 / 0
    Points
    119
    Level
    1

    Re: Difference between PSD ( power density spectrum ) and Spectrum measurement in Cad

    Use correct terminology.
    There is no tool Cadence.
    Must have exceeded the title length. It is in Virtuoso.

    You use db20( dfft() ) not db10( psd() ) there.
    However they have to be almost same if you use Cadence OCEAN functions.
    Yes, one plot is dB20(dfft()) that is generated automatically when i process the output sequence through the Measurement Tab--->Spectrum
    The second plot is dB10(psd()) and is generated if I send the output data to the calculator and use the psd() function.

    The 2 plots are far from same though, they have around 40 dB constant difference.



    •   Alt16th February 2017, 12:12

      advertising

        
       

  3. #3
    Advanced Member level 4
    Points: 9,300, Level: 23
    pancho_hideboo's Avatar
    Join Date
    Oct 2006
    Location
    Real Homeless
    Posts
    1,234
    Helped
    357 / 357
    Points
    9,300
    Level
    23

    Re: Difference between PSD ( power density spectrum ) and Spectrum measurement in Cad

    Use correct terminology.
    There is no tool Cadence.


    Surely answer my questions in your previous thread.
    MASH ( SD modulator) power spectrum dc term

    You use db20( dfft() ) not db10( psd() ) there.
    However they have to be almost same if you use Cadence OCEAN functions, if you set parameters correctly.

    http://www.designers-guide.org/Forum...1242749411/3#3

    Surely answer my questions in your previous thread.
    MASH ( SD modulator) power spectrum dc term

    Show us all results and their settings correctly with including the following.
    SciLab power spectral density of quantization noise
    Last edited by pancho_hideboo; 16th February 2017 at 12:28.



  4. #4
    Junior Member level 2
    Points: 119, Level: 1

    Join Date
    Jan 2017
    Posts
    24
    Helped
    0 / 0
    Points
    119
    Level
    1

    Re: Difference between PSD ( power density spectrum ) and Spectrum measurement in Cad

    I post again in case my previous posts weren't submitted correctly.
    For all the following plots , the number of accumulator bits are N=14 and the input fractional word is 2037.
    1) Scilab , using fft.
    scilab_fft.jpg

    2)Scilab, using pspect() function ( equivalent to periodogram function in Matlab )
    scilab_pspect.jpg

    3) Cadence Virtuoso, using fft() ( from Measurement tab---> Spectrum )
    virtuoso_fft.jpg

    4) Cadence Virtuoso, using psd() function ( from calculator )
    virtuoso_psd.jpg

    5) Ideal curve, plotted in Scilab
    ideal.jpg



    •   Alt16th February 2017, 14:13

      advertising

        
       

  5. #5
    Advanced Member level 4
    Points: 9,300, Level: 23
    pancho_hideboo's Avatar
    Join Date
    Oct 2006
    Location
    Real Homeless
    Posts
    1,234
    Helped
    357 / 357
    Points
    9,300
    Level
    23

    Re: Difference between PSD ( power density spectrum ) and Spectrum measurement in Cad

    Show us arguments of all functions.



  6. #6
    Junior Member level 2
    Points: 119, Level: 1

    Join Date
    Jan 2017
    Posts
    24
    Helped
    0 / 0
    Points
    119
    Level
    1

    Re: Difference between PSD ( power density spectrum ) and Spectrum measurement in Cad

    Ok, for all cases N=14 and input 2037 as before. Also sampling frequency is 1Ghz (10^9), let's call it Fs.

    "Cout" is the output carry sequence with range [-3,4] from the 3rd order SD modulator and length 2*2^(N+1)=65536 samples ( 2 full sequence cycles as with an odd input , max sequence 2^(N+1) is guaranteed).

    For SciLab:
    Frequency construction : f=Fs*(1:length/2)/length -- ( frequency vector from 0 to Fs/2)

    1) SciLab plot using fft()
    spectrum=abs(fft(Cout)/(length/2))
    spectrum=spectrum(1:length/2)^2
    plot2d("ln",f(1:length-1),10*log10(spectrum)) -- (argument "ln" means that the x axis is logarithmic and the y axis is normal )

    2) SciLab plot using pspect() function
    spectrum=pspect(length/2,length,'hn',Cout)
    plot2d("ln",f,10*log10(Cout(1:length)))

    The arguments in pspect() function are : offset of each data window,number of points in window, window type (here Hanning), sampled vector)

    3) Cadence Virtuoso using fft()
    Start time : x ns
    Stop time : (x + 2*length) ns
    sample count/Freq= 2*length -- ( same result if i chose "length" sample count , but the maximum frequency would be Fs/2 )
    Start/end Freq= 15.26k to 1G
    Window type : Rectangular -- ( little to no difference with Hanning)

    4) Cadence Virtuoso using psd()
    Start/Stop : Same as above
    Number of samples : 2*length
    Window : Hanning
    Smoothing factor : 1
    Windows size : 2*length
    Detrending Mode : Mean
    Coherent gain : default
    Coherent gain factor : 1

    5) Ideal curve
    spectrum= 1/(12*2^(N+1))* (2*sin(pi*f/Fs))^6 -- ( 3rd order SD modulator )
    plot2d("ln",f,10*log10(spectrum))



    •   Alt16th February 2017, 16:16

      advertising

        
       

  7. #7
    Advanced Member level 4
    Points: 9,300, Level: 23
    pancho_hideboo's Avatar
    Join Date
    Oct 2006
    Location
    Real Homeless
    Posts
    1,234
    Helped
    357 / 357
    Points
    9,300
    Level
    23

    Re: Difference between PSD ( power density spectrum ) and Spectrum measurement in Cad

    See MASH ( SD modulator) power spectrum dc term

    Sorry, I don't have Scilab, so I don't know definition of psd functions of Scilab correctly.



  8. #8
    Junior Member level 2
    Points: 119, Level: 1

    Join Date
    Jan 2017
    Posts
    24
    Helped
    0 / 0
    Points
    119
    Level
    1

    Re: Difference between PSD ( power density spectrum ) and Spectrum measurement in Cad

    Quote Originally Posted by pancho_hideboo View Post
    See MASH ( SD modulator) power spectrum dc term

    Sorry, I don't have Scilab, so I don't know definition of psd functions of Scilab correctly.
    http://https://searchcode.com/codesearch/view/25398262/

    This is the source code of pspect() function in SciLab ( that as far as i understand is the equivalent to psd())



  9. #9
    Advanced Member level 4
    Points: 9,300, Level: 23
    pancho_hideboo's Avatar
    Join Date
    Oct 2006
    Location
    Real Homeless
    Posts
    1,234
    Helped
    357 / 357
    Points
    9,300
    Level
    23

    Re: Difference between PSD ( power density spectrum ) and Spectrum measurement in Cad

    Quote Originally Posted by NikosTS View Post
    http://https://searchcode.com/codesearch/view/25398262/
    This is the source code of pspect() function in SciLab ( that as far as i understand is the equivalent to psd())
    Currently psd() is not recommended to use in MATLAB.

    https://jp.mathworks.com/matlabcentr...psd-and-pwelch
    http://www.designers-guide.org/Forum...1405235104/2#2

    pwelch() give dBV/Hz, on the other hand psd does not.
    Last edited by pancho_hideboo; 16th February 2017 at 17:12.



  10. #10
    Advanced Member level 4
    Points: 9,300, Level: 23
    pancho_hideboo's Avatar
    Join Date
    Oct 2006
    Location
    Real Homeless
    Posts
    1,234
    Helped
    357 / 357
    Points
    9,300
    Level
    23

    Re: Difference between PSD ( power density spectrum ) and Spectrum measurement in Cad

    Quote Originally Posted by NikosTS View Post
    .................................................. ......................................
    length 2*2^(N+1)=65536 samples ( 2 full sequence cycles as with an odd input , max sequence 2^(N+1) is guaranteed).
    .................................................. ......................................
    3) Cadence Virtuoso using fft()
    Start time : x ns
    Stop time : (x + 2*length) ns
    What value for them ?
    What is x ?
    What is x +. 2*length = x + 2*2*2^(N+1) = x + 2*65536 ?

    Surely consider.

    Start Time is x/fs ?
    Stop Time is (x + 2*length)/fs ?

    fs=1GHz
    Nfft=2*2^(Nbit+1)=2*2^(14+1)=2^16=65536
    Last edited by pancho_hideboo; 17th February 2017 at 14:02.



    •   Alt17th February 2017, 13:54

      advertising

        
       

  11. #11
    Junior Member level 2
    Points: 119, Level: 1

    Join Date
    Jan 2017
    Posts
    24
    Helped
    0 / 0
    Points
    119
    Level
    1

    Re: Difference between PSD ( power density spectrum ) and Spectrum measurement in Cad

    Quote Originally Posted by pancho_hideboo View Post
    What value for them ?
    What is x ?
    What is x +. 2*length = x + 2*2*2^(N+1) = x + 2*65536 ?

    Surely consider.
    For this simulation, x =2.125 ns approximately
    So start time is : 2.125n and
    stop time is : 2.125 + 2*2^15= (2.125 + 2*32768) ns



  12. #12
    Advanced Member level 4
    Points: 9,300, Level: 23
    pancho_hideboo's Avatar
    Join Date
    Oct 2006
    Location
    Real Homeless
    Posts
    1,234
    Helped
    357 / 357
    Points
    9,300
    Level
    23

    Re: Difference between PSD ( power density spectrum ) and Spectrum measurement in Cad

    Quote Originally Posted by NikosTS View Post
    For this simulation, x =2.125 ns approximately
    Wrong.
    It has to be x = 2.125.
    Quote Originally Posted by NikosTS View Post
    So start time is : 2.125n
    It shoud be start time is : x/fs=2.125n
    Quote Originally Posted by NikosTS View Post
    stop time is : 2.125 + 2*2^15= (2.125 + 2*32768) ns
    Wrong.
    It has to be stop time is : (2.125 + 2*2^15)/fs= (2.125 + 2*32768) ns

    You are mixing values regarding unitless and with unit.



  13. #13
    Junior Member level 2
    Points: 119, Level: 1

    Join Date
    Jan 2017
    Posts
    24
    Helped
    0 / 0
    Points
    119
    Level
    1

    Re: Difference between PSD ( power density spectrum ) and Spectrum measurement in Cad

    As you can see on the screenshot that i uploaded on the other thread, i have the correct values on the required fields.
    ( Start time : 2.125 ns
    Stop time : (2.215 + 2*2^15) ns )



+ Post New Thread
Please login
--[[ ]]--