<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><<a href="mailto:rburnett@richieburnett.co.uk">rburnett@richieburnett.co.uk</a>> skrev:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can set the maximum time-step of the simulation to something like <br>
2us and save the WAV file at a high sample rate like 192kHz.  Then load <br>
that into an audio editor, band-limit to 20kHz and resample to 48kHz <br>
before saving.  I find that gives better results for simulations that <br>
exhibit an inherently "high-pass" response like hi-hats, etc.  </blockquote></div></div><div dir="auto"><br></div><div dir="auto">Thanks for mentioning this, it gives better results. The piecewise linear signals produced by the simulations are good enough for simulation precision, but not for audio where errors need to be smaller by several orders of magnitude. What's worse, the errors above Nyquist folds down into audible aliasing.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">(Another <br>
thing that helps is to follow the circuit being simulated with a basic <br>
1st or 2nd-order 20kHz low-pass RC filter before writing the waveform <br>
out to a WAV file.  This curtails some of the ultrasonic stuff so it <br>
aliases less in the WAV file.)<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Good idea, perhaps one should tailor a little handy WAV output amp to be included in all simulations... An ideal op-amp, some ideal caps and noiseless resistors building up a 2nd-order LPF, and some simple way of setting the level in the application. The omission of a level setting in the WAV output command is one of the silliest limitations of LTspice, and it wouldn't surprise me if there's no antialiasing built into it either.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Good VA has a lot in common with Spice simulations, but it has to be a <br>
bit cleverer to render in real-time and to handle things like <br>
non-linearities and discontinuities in a way that doesn't result in <br>
unacceptable levels of aliasing in the final audio output.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Indeed! :-)</div><div dir="auto"><br></div><div dir="auto">/mr</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>