[sdiy] Digital oscillators [was: Active VCO temp compensation]
Seb Francis
seb at burnit.co.uk
Tue Dec 23 22:53:29 CET 2008
Thanks Antti and the others. This is great information.
Antti Huovilainen wrote:
> Since this question gets asked a lot, I'll list some of the common
> methods. Roughly from easy to hard. Oversampling here means proper
> oversampling with high quality lowpass filtering before decimating to
> target samplerate. Simply averaging N samples will not work.
>
> 1) Trivial saw with oversampling
> Pros: Easy, can do any waveshape, allows simple sync and FM
> Cons: Requires massive (64..256x) oversampling to sound good
>
This is what I had in mind to start with. I was going to try something
like 1MHz sampling rate, but you're saying that 3MHz+ is going to be
needed for a good sound. What do you mean by 'high quality' lowpass
filtering? ... Scott talked about a 511 tap FIR filter. This seems a
*lot* to implement on a dsPIC (which is what I'm using).
On my 4xD delay when I needed to halve the sampling frequency I used an
FIR with just 9 taps and was pretty happy with the results. I actually
quite liked the sound of the more gentle roll-off.
I guess if one is not too concerned about the very high frequency
harmonics then the low pass can start at a lower frequency and roll off
more gently, thus needing less taps. After all, many much loved analog
synths have decidedly limited bandwidths.
>
> 5b) BandLimited StEps (BLEP)
> For each oscillator reset, sum a bandlimited step with the trivial
> saw. The steps are precalculated and stored in a table (can be quite
> short when interpolation is used between two phases.
>
> Pros: Very good quality. No oversampling required. Can do bandlimited
> FM, PWM and sync. Probably the only method that can do audio rate PWM
> and sync.
> Cons: Requires a divide per cycle. Can be complicated: calculating
> required table entry is not trivial when using sync or pwm.
>
This sounds interesting. Am I understanding right that it would need a
separate table for each type of waveform discontinuity - so a pulse, up
saw, down saw could all use the same table for their transitions, but a
triangle wave would need a different table of steps? And presumably
this can't be applied to something like a sine, or complex waveforms?
In my case I want to have many oscillators, each slightly detuned, so I
guess the amount of maths is going to add up and there's going to be a
point where it becomes better to just using simple
oversampling/filtering/decimating.
Seb
More information about the Synth-diy
mailing list