Spice3f5

disto

Do an distortion analysis

General form

disto ( DEC | OCT | LIN ) n fstart fstop [f2overf1]

Do a small-signal distortion analysis of the current circuit, as a .DISTO line would. The arguments are the same as on the .DISTO line: the frequency sweep, and optionally f2overf1, the ratio of the second input frequency to the first for intermodulation analysis. The distortion inputs are set on the independent sources with DISTOF1 and DISTOF2; if no source has them, the analysis stops with the message doAnalyses: Unknown error code.

Without f2overf1, the analysis makes plots of the second and third harmonic distortion. With it, it makes plots of the intermodulation products at f1+f2, f1−f2 and 2f1−f2, the last of which is left as the current plot. Use setplot to move between them.

Examples

disto DEC 10 1kHz 100MHz
disto DEC 10 1kHz 100MHz 0.9

See also examples/diodisto.cir, a diode and resistor with a source that has both distortion inputs:

vcc 1 3 5v ac 0.001 sin(5 0.01 1000) distof1 0.01 distof2 0.01

All commands