ronw6wo?wrote, "
this is my first attempt to model FT behaviour".
Here are some tips.
(1) ?To get finer frequency resolution in the FFT results, you need to use longer simulation times. ?The two are directly related.
For 100 Hz frequency resolution, the total time interval of the waveform data that is sent to the FFT must be 1/100Hz = 0.01 seconds = 10 ms. ?But to examine discrete components that are 100 Hz apart, you might want the frequency resolution to be at least twice as good as that (if not more) ... so simulate for 20 ms if not 40 ms or more. ?Then you can see the dips between the components too. ?Otherwise it tends to look like a big blob and it's hard to tell one component from the next.
(2) ?The "Number of data point samples in time" and the total time interval determine the upper frequency limit of the FFT. ?If the FFT doesn't go up high enough in frequency to show the components you want to see, repeat the FFT with more data point samples in time. ?Hopefully you have simulated with fine enough time steps so that the FFT isn't using fake data (see later, about "Tstep" and "plotwinsize").
An FFT works best when the number of data point samples is a power of 2 (hence LTspice starts with a default of 262144 data points), but I believe LTspice's algorithm does not require a power of 2. ?Just the same, I'd go with the power of 2 in case it impairs accuracy not to use it.
When in doubt, click "Reset to Default Values" at the bottom of the FFT dialog window, then use the up/down arrows to try other powers-of-two.
(3) ?LTspice's FFT display has a truly annoying characteristic when you zoom in to see the individual components of the FFT: ?Each component looks like an arch. ?I think that happens because LTspice does a linear interpolation between the points, BEFORE it computes a logarithm to turn it into Decibels for display. ?Hence you end up with those deceptive arch-like bumps. ?(Note: LTspice's developer says this is actually intentional. ?Not a bug. ?Could've fooled me.)
The apparent "width" of those bumps means nothing and does not imply a width of the components present! ?The tip of each bump is the ONLY thing that matters. ?The sides of the bumps are meaningless.
You can highlight the individual FFT components (right-click in the FFT window, then "Mark Data Points"), and then LTspice draws little dots at the actual FFT components. ?The curves between the dots are interpolations, not real data, and should be ignored. ?Be aware that turning on the display of those data point dots can make LTspice VERY slow and unresponsive when there are a very large number of data points on your screen. ?But this is the only way to see what's really there when your FFT's resolution is 100 Hz and you need to see frequency components every 100 Hz.
(4) ?Many things affect the apparent accuracy of the FFT results, i.e., the "noise floor" of the FFT plot, the appearance of extraneous signal components, etc.
Most important is to simulate (and send to the FFT) an integral number of cycles. ?If you have multiple known components present, use an integral number of cycles of ALL of them, if you can. ?In Helmut's example, the time interval (20 ms) is a multiple of both 10.0000 MHz and 10.0001 MHz.
Here's why.
The time-domain simulation generates a bunch of data points running from t=0 to t=Tstop = Stop Time. ?Think of turning that into a continuous waveform, by repeating that interval indefinitely. ?This is effectively what the output of the FFT represents. ?When you "splice" the waveform at t=0 to the waveform at t=Tstop, is it continuous, or is there a "glitch" at the splice? ?If there's a glitch, the waveform effectively has a modulation applied to it, which shows up in the spectrum as unwanted sidebands around everything and an increased noise floor.
In the FFT dialog box, the "Time range to include" controls the amount of waveform sent to the FFT. ?Normally one would "Use Extent of Simulation Data". ?A case where you might not do that, is when the simulation includes a start-up transient, and you want to include only the steady-state waveform after that transient has died. ?Make sure the time range you include, has the integral number of cycles, even if the total simulation time does not.
Simulating over many cycles seems to work better than simulating fewer cycles. ?I think it allows mathematical errors to average out better, and this reduces the FFT's noise floor and spurious components in the display.
When it is impossible to simulate for an integral number of cycles of all components, that's when one of the Windowing functions is used. ?My understanding is that they force the pre-FFT, time-domain data to fall somewhat gracefully to zero at t=0 and at t=Tstop. ?Thus, a nasty glitch is avoided when you "splice" the ends together. ?Instead, a gentler modulation is applied to your signal, so it still causes sidebands to appear in the output spectrum.
(5) ?It helps to turn off waveform compression in the time-domain data:
.options plotwinsize=0
Also, make Tstep (Maximum Timestep) as small as practical. ?The less interpolation between data points that the FFT needs to do, the better.
(6) ?Enabling double precision may also help:
.options numdgt=15
Regards,
Andy