"fourier" command

Purpose

Performs a nonlinear time domain (transient) analysis, but displays the results in the frequency domain.

Syntax

`fourier start stop stepsize {options ...} `

Start, stop, and stepsize are frequencies.

This command is slightly different and more flexible than the SPICE counterpart. SPICE always gives you the fundamental and 9 harmonics. Gnucap will do the same if you only specify one frequency. SPICE has the probes on the same line. Gnucap requires you to specify the probes with the print command.

SPICE uses the last piece of a transient that was already done. Gnucap does its own transient analysis, continuing from where the most recent one left off, and choosing the step size to match the Fourier Transform to be done. Because of this the Gnucap Fourier analysis is much more accurate than SPICE.

The nodes to look at must have been previously selected by the print or plot command.

Three parameters are normally needed for a Fourier analysis: start frequency, stop frequency and step size, in this order.

If the start frequency is omitted it is assumed to be 0. The two remaining parameters are stop and step, such that stop > step.

If only one frequency is specified, it is assumed to be step size, which is equivalent to the fundamental frequency. The start frequency is zero and the stop frequency is set according the harmonics option (from the options command. The default is 9 harmonics.

If two frequencies are specified, they are stop and step. The order doesn't matter since stop is always larger than step.

This command does a nonlinear time domain analysis, then performs a Fourier transform on the data to get the frequency data. The transient analysis parameters (start, stop, step) are determined by the program as necessary to produce the desired spectral results. The internal time steps are selected to match the Fourier points, so there is no interpolation done.

The underlying transient analysis begins where the previous one left off. If you specify the “cold” option, it begins at time = 0. Often repeating a run will improve the accuracy by giving more time for initial transients to settle out.

Options

Sweep control

 dtmax time The maximum internal time step. (Default = stepsize/skip) dtmin time The minimum internal time step. (Default = option dtmin) Time cannot be resolved closer than this. dtratio number The minimum internal time step, as a ratio. (Default = option dtratio) This is the maximum number of internal time steps for every requested step. skip count Force at least count internal transient time steps for each one displayed. If the output is a table or ASCII plot, the extra steps are hidden, unless the trace option specifies to print them.

Input / Output

 > file Send results of analysis to file. » file Append results to file. noplot Suppress plotting. plot Graphic output, when plotting is normally off. quiet Suppress console output.
 trace off No extended trace information. trace warnings Show extended warnings. trace alltime Show all accepted internal time steps. trace rejected Show all internal time steps including rejected steps. trace iterations Show every iteration. trace verbose Show extended diagnostics.

Other

 dtemp degrees Temperature offset, degrees C. Add this number to the temperature from the options command. temperature degrees Temperature, degrees C. cold Zero initial conditions. Cold start from power-up. uic Use initial conditions. Do not do an initial DC analysis. Instead, use the values specified with the IC = options on the various elements, and set everything else to zero.

Examples

`fourier 1Meg`

Analyze the spectrum assuming a fundamental frequency of 1 mHz. Use the harmonics option to determine how many harmonics (usually 9) to display.

`fourier 40 20K 20`

Analyze the spectrum from 40 Hz to 20 kHz in 20 Hz steps. This will result in a transient analysis with 25 micro-second steps. (1 / 40k). It will run for .05 second. (1 / 20).

`fourier 0 20K 20`

Similar to the previous example, but show the DC and 20 Hz terms, also.

`fourier`

No parameters mean use the same ones as the last time. In this case: from 0 to 20 kHz, in 20 Hz steps.

`fourier skip 10`

Do 10 transient steps internally for every step that is used. In this case it means to internally step at 2.5 micro-second, or 10 steps for every one actually used.