What is different between this question and the following ?
http://www.designers-guide.org/Forum/YaBB.pl?num=1237382023/0#0I don't use thd() function in calculator.
I wrote method of evaluation of THD in the following as Ocean Script.
http://www.designers-guide.org/Forum/YaBB.pl?num=1237208147/1#1What is "
IIM3" ?
Did you read answers to your questions surely ?
http://www.designers-guide.org/Forum/YaBB.pl?num=1237208368/1#1http://www.designers-guide.org/Forum/YaBB.pl?num=1237293628/1#1Read documentations.Your usage of thd() is wrong.
david wrote on Mar 18th, 2009, 6:29am:Please tell me how to get THD values using spectre (cadence simulator).......I am using calculator as shown in attachment.
Please let me know what mistake i am doing..........than you!!!
Enter ocnHelp 'thd in CIW. Then read messages.
Quote:thd( o_waveform n_from n_to x_num ) => o_waveform/n_thdValue/nil
Description
Computes the absolute value of the total harmonic distortion of the input waveform.
The accuracy of this function depends on how you set certain simulator options and analysis parameters.
The computation uses the dft command and takes the same arguments.
Assume the dft function returns the complex components f0, f1…
(where f0 is the DC component, f1 is the component at frequency 1/(to - from)) then the total harmonic distortion is computed as
Arguments
o_waveform Waveformobject representing simulation results that can be displayed as a series of points on a grid.
(A waveform object identifier looks like this: drwave:XXXXX.)
n_from Starting value for the computation.
n_to Ending value for the computation
x_num Number of timepoints. If x_num is not a power of 2, it is forced to be the next higher power of 2.
Value Returned
o_waveform Returns a waveform representing the absolute value of the total harmonic distortion if the input argument is a family of waveforms.
n_thdValue Returns the absolute value of the total harmonic distortion of the input waveform.
nil Returns nil and an error message otherwise.
Example
plot( thd( v( "/net8" ) 10u 20m 64 "rectangular" ) )
Computes the absolute value of the discrete Fourier transform, fast Fourier transform, of the waveform representing the voltage of "/net8".
The computation is done from 10u to 20m with 64 timepoints.
The resulting waveform is plotted.