On Fri, Feb 21, 2025 at 07:34 AM, Ryu wrote:
Hitherto I've used 1 or 2 per mille of the sine wave period, so the time step would be 1 usec or 2 usec
when testing with 1 kHz. From my tests I decided for myself that values exceeding 1% of the period
should best be avoided.
In my opinion, those are good choices.? I prefer to keep the timestep smaller than 1% of the period, and sometimes I make it 0.1% or smaller.? It depends on how low I want the artifacts to be, and how low I can make them.? Eventually, "diminishing returns" sets in and it's pointless to change it further, but each case is different and there are no general rules about that.? 0.1% might be overkill in one case, and insufficient in another.
?
Of course it's assumed that you disabled waveform compression.
?
I also tested time steps adjusted to the power of 2, e.g. 2**14 (interval / 16384).?
That
might help, but I am not aware that it actually does.? In my experience, keeping the time steps small is more important.
For the interval (t_stop - t_start) I usually take 16msec when testing with 1kHz
but I have also used values from 10msec to 48msec.
It is this parameter which I personally find most difficult to decide upon.
The one most important thing is that the interval MUST be an exact multiple of the signal's period.
?
If you don't make Tstop-Tstart equal to an exact multiple, then make sure that your FFT's time interval is set to an exact multiple.? You do not need to find the FFT over the whole simulated interval.
?
Whether it is 1 period or 100 periods, that might not make much difference when checking harmonics (via FFT or something similar).? But it does make a difference in the display of harmonics in LTspice's View > FFT, but I don't think it affects the numerical results that much.
?
Now this is assuming that each of your cycles looks like the next one.? If, for some reason, they are not, then you may want to re-consider this.
?
Also be aware of the interaction with the "Number of data point samples in time" in the FFT menu.? You have interaction between that number and the number of audio cycles you captured.
?
So, to sum it all up, I wonder if there is a guideline which values to use for the time step
and the interval for a certain test frequency when testing audio related circuits with sine waves.
Experiment!? Other than what I stated above and has been stated and re-stated several times already, my advice is to
experiment.? Don't be satisfied with one technique and the same settings every time.? Try things.? See what matters to your simulations.? It won't be the same every time.? Once you find what seems to work best in your situation, then it's OK to stick with that.? But in another simulation, the choices might not be the same.
?
Andy
?