This took me three days to figure out. Consider this simple circuit in LTspice:
Looks pretty innocent. The output is a 1V sine wave, as expected. Going to View->FFT, setting number of data points to 5000, Start Time 50u, End Time 100us. No filtering. This is the output:
An output like this does not quite make sense for a sine wave output and/or a weakly nonlinear system in which the harmonic should fall gently.
Now delete V6 and re-run. Voila, the spectrum makes more sense.
LTspice does not allow for "commenting out" certain blocks and does not even remember the parameters. So if I switch between sin and pulse input, I always have to recreate and memorize the entire parameter set. Hence it makes sense to place all the sources on the schematic and just connect the one with which I am working right now.
I have the suspicion that it has to do with the discrete-time timesteps which are enfored by merely placing a pulse source.
My question is:
- What did I do wrong?
- How can this be avoided? In other words, how can I trust the output of a transient analysis?
- Unfortunately LTspice seems so spartan: Are there any options to enfore a fixed sample step? Any options to resample the transient output such that it is suitable for a DFT?