ddrplPssHarmThd
drplPssHarmThd(o_waveform x_harmonicNumber) =>x_THD/ nil
Description
Calculates the total harmonic distortion (THD) in percentage for each waveform of frequency sweep. This function is available only for single-tone harmonic balance (hb) and single-tone periodic steady-state (pss) analyses.
THD is expressed as a percentage and calculated using the following formula:

where V1 is the RMS value of the fundamental frequency voltage, and V2, V3, ..., Vn are the RMS values from second harmonic through last harmonic frequencies.
Arguments
|
Waveform or a family of waveforms. The |
|
Value Returned
Examples
Returns THD values for waveform vh at the specified harmonics 1 and 2. Note that vh represents the voltage across the net /IFp at all harmonics in the frequency domain of a single-tone harmonic balance analysis, hb.
openResults("./simulation/RFworkshop/mixer_testbench/maestro/results/maestro/ExplorerRun.0/psf/RFworkshop_mixer_testbench_1/psf")
; Opens simulation results of a single-tone hb analysis stored in the specified directory.
results()
;Lists the results available in the currently open results directory.
harmonicList(?resultsDir "./simulation/RFworkshop/mixer_testbench/maestro/results/maestro/ExplorerRun.0/psf/RFworkshop_mixer_testbench_1/psf" ?result "hb_fi")
;Returns a list of available harmonics for the specified result of the results directory.
selectResult('hb_fi)
;Selects the hb_fi result from the results directory.
outputs()
;Lists the outputs available in the selected result.
drplPssHarmThd(vh('hb "/IFp" nil) 1)
;Returns the THD value for waveform vh at the specified harmonic 1. Note that vh represents the voltage across the net /IFp at all harmonics in the frequency domain of a single-tone harmonic balance analysis, hb.
drplPssHarmThd(vh('hb "/IFp" nil) 2)
;Returns the THD value for waveform vh at the specified harmonic 2.
=>
"./simulation/RFworkshop/mixer_testbench/maestro/results/maestro/ExplorerRun.0/psf/RFworkshop_mixer_testbench_1/psf"
=>
(hb_td hb_fd hb_fi model instance
output designParamVals primitives subckts variables
)
=>
(0 1 2 3 4
5 6 7 8
)
=> stdobj@0x33f31e00
=>
("/LOn" "/LOp" "/IFn" "/IFp" "/RF"
"/VDDA1" "/VLO" "/VbiasLO" "/I19/net059" "I19.R2.R0.PLUSHEAD"
"I19.R2.R0.MINUSHEAD" "I19.R1.R0.PLUSHEAD" "I19.R1.R0.MINUSHEAD" "/PORT0/PLUS" "/PORT1/PLUS"
"/PORT3/PLUS" "/V0/PLUS" "/V3/PLUS" "/largeTone_harm_index"
)
=> 53.35389
=>202.5374
Return to top