FOURIER command

## 2.19 `FOURIER` command

### 2.19.1 Syntax

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

### 2.19.2 Purpose

Performs a nonlinear time domain (transient) analysis, but displays the results in the frequency domain.
Start, stop, and stepsize are frequencies.

### 2.19.3 Comments

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.
Actually, 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.
See also: `Transient` command.

### 2.19.4 Options

`>` file
  Send results of analysis to file.
`>>` file
  Append results to file.
`Cold`
  Zero initial conditions. Cold start from power-up.
`Quiet`
  Suppress console output.
`SKip` count
  Force at least count internal transient time steps for each one used.
`STiff`
  Use a different integration method, that will suppress overshoot when the step size is too small.
`TEmperature` degrees
  Temperature, degrees C.
`TRACe` n
  Show extended information during solution. Must be followed by one of the following:
  `Off`
    No extended trace information (default, override .opt)
  `Warnings`
    Show extended warnings
  `Alltime`
    Show all accepted internal time steps.
  `Rejected`
    Show all internal time steps including rejected steps.
  `Iterations`
    Show every iteration.
  `Verbose`
    Show extended diagnostics.

### 2.19.5 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.
`fourier Cold`
  Restart at time = 0. This will show the spectrum of the power-on transient.