spec: generate a Fourier transform vectorGeneral Form
spec start_frequency stop_frequency frequency_step vector
Calculates a new vector containing the Fourier transform of the input vector.
This vector should be the output of a transient analysis. This command takes
note of the following shell variables which can be set using the
set command:
Variable |
Type |
Description |
specwindow |
String |
Specifies the windowing function. Possible values are:
none
hanning or
cosine
rectangular
hamming
triangle or
bartlet
blackman
gaussian
If this variable is not defined, the
hanning window is used. |
specwindoworder |
Number |
Specifies the window order for the
gaussian window only. | Note that the
time axis of the input vector should be linearised first by using the
linearize command because Spice does not produce a linear time axis
for transient analyses. After using the
spec command, the spectrum can be displayed by plotting the magnitude
of the resultant vector. For instance, after a transient analysis resulting in
transient vector
v(1), the spectrum can be plotted with the following commands:
linearize 1us
spec 10Hz 100kHz 5kHz v(1)
plot mag(v(1)) |