<div dir="ltr">On Sun, 15 Jul 2018 at 00:45, Richie Burnett <<a href="mailto:rburnett@richieburnett.co.uk">rburnett@richieburnett.co.uk</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">...-Richie, <br>
<br>
Ps, I would encourage you to read up about BLIT, MinBLEP, polyBLEP, etc, if your're interested in digital synthesis of classic analog waveforms with reduced aliasing. These algorithms solve the problem of aliasing a more elegantly than just increasing the sample rate. They are a lot more efficient than simply burning CPU cycles by oversampling, which turns out to be a relatively poor method of achieving the end result. Papers by Tim Stilton and Eli Brandt are a good place to start.<br>
<br>
Sent from my Xperia SP on O2<br><br></blockquote><div><br></div><div>If you want to use BLEP then stick with Linear Phase BLEP, it's easy to handle DC offset accumulation with frequency changes. There is another method which is probably better in this case: DPW. The basic idea is you integrate the desired waveform and generate this directly using a trivial non-bandlimited method, you then use numerical differentiation to recover the desired waveform. For example for a sawtooth you need a parabolic waveform, which you can easily generate by squaring your phase accumulator as follows...</div><div><br></div><div>init:</div><div>phase = 0</div><div>prb = 0</div><div>inc = freq/samplerate</div><div>incinv = 1.0/inc</div><div><br></div><div>tick:</div><div>phase += inc</div><div>if (phase >= 0.5) phase -= 1.0</div><div>prbz = prb</div><div>prb = phase*phase</div><div>saw = (prb - prbz)*incinv</div><div><br></div><div>This can also be applied reduce aliasing in waveshapers, but it does introduce low pass filtering of 1/2 + 1/2 z^-1, which delays the input by half a sample. Thanks to Antti Huovilainen for putting me onto this method :)</div><div><br></div><div>Cheers,</div><div><br></div><div>Andy</div><div><br></div><div><br></div></div></div>