3. Transient simulators
In a transient analysis, the circuit behaviour is simulated at discrete time-steps. The user can control the start time (), stop time () and the time-step () used in the analysis. The continuous-time derivatives in the circuit have to be approximated in the discrete-time transient simulation. The way this approximation is performed is referred to as the integration method, which can be chosen by the user as well.
These 4 parameters (, , and the integration method) have to be set by the user. Once the time-domain waveforms are calculated by the simulator, they can be transformed to the frequency domain in a post-processing step.
Choosing the time-step
Both a fixed and variable time-step can be used in most commercially available transient simulators. Since we’d like to calculate the spectrum of the signals with the Fast Fourier Transform (FFT), the time samples have to be equally spaced in time. This equal spacing is automatically obtained when a fixed time-step is used in the transient simulation. We will always use a fixed time-step in our time-domain simulations. If a variable time-step is used, the data can be interpolated to the fixed grid in time, but this will introduce interpolation errors. Alternatively, the simulator can be forced to simulate every time-point on an equally-spaced time-grid while the underlying time-step is still left free to take smaller steps when needed [1].
The fixed time step in a transient analysis is chosen such that the highest significant harmonic generated in the circuit can be represented in the simulation. The sample frequency should be at least to allow proper sampling of all harmonics without aliasing. To prevent spectral leakage when calculating the spectra using the FFT, the sample frequency should be chosen as an integer multiple of the frequency resolution.
It can happen that the corresponding time step cannot be represented by a finite amount of digits. An of , for example, will result in a time-step of . Rounding errors in the simulator can then introduce weird effects. Increasing to yields a nicer of which can easily be written correctly to the netlist.
Choosing the start and stop-time
At least one period of the multisine should be simulated, so should be larger than . Due to the initial conditions present in the circuit, a transient will be present in the signal. The simulation should be run long enough to allow the transient to damp out such that the circuit reaches steady-state. The length of the transient depends on the quality factors of possible resonances in the circuit, so it should be checked carefully whether transient is still present in the signals. This can be done by inspecting the obtained spectrum for leakage, or by subtracting the final period from the previous ones as is shown in Figure 3.1. To create that figure, a transient simulation with periods was run. The final period was subtracted from the three previous periods and the logarithm of the norm of the remainder of that subtraction is plotted. From such a plot, it can be concluded that the circuit reaches steady-state after periods of the multisine, so should be set to periods of the multisine.
Figure 3.1 Result of subtracting the final period in a transient simulation from the previous ones. It is clear that the circuit reaches steady-state after 1.5 periods.
The start time of the simulator controls when the simulated points are returned to the user. Internally, the simulation starts always at , but to limit the amount of data stored to disc, the start time can be set. The transient from the initial conditions to steady-state contains a lot of information about the circuit behaviour, so our simulations always use .
Choosing the integration method
It is best to set the integration method of the transient analysis to trapezoidal [3]. Unlike other integration methods, trapezoidal integration doesn’t introduce artificial damping into the circuit. Trapezoidal integration still introduces frequency warping in the circuit. With frequency warping, it is as if the circuit is being simulated at different frequencies as the ones specified in the multisine. The relation between the original frequencies and the warped frequencies is known and given by
If, for example, a single tone at a frequency of is applied to a bandpass filter and the whole circuit is simulated with a sample frequency of , the original frequency is warped to . If the bandpass filter has a narrow band around , it can happen that the tone is filtered out, while it should not have been. To overcome this issue, a larger sample frequency should be used, or the warping should be taken into account properly on beforehand.
Transforming to the frequency domain
Once the simulation has been performed over several periods of the multisine with a fixed time-step, the last period of the time domain signals can be used to obtain the spectrum using the FFT. It is best to normalise the FFT such that the magnitude of a frequency line corresponds to the peak value of each corresponding tone in the spectrum.
To be able to compare the transient analysis results with the harmonic balance results, only the positive frequencies are saved, but are multiplied by to maintain the power in the signal.