spec: generate a Fourier transform vector
General 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 example, after a transient analysis resulting in transient vector v(1), the spectrum can be plotted with the following commands:
linearize
spec 10 100000 5000 v(1)
plot mag(v(1))
|