[sdiy] Re: Digital oscillators [was: Active VCO temp compensation]

Tom Wiltshire tom at electricdruid.net
Mon Dec 22 18:26:50 CET 2008


On 22 Dec 2008, at 15:08, Seb Francis wrote:

> Tom Wiltshire wrote:
>>
>>
>> I've tried going the whole hog, but I have to say that I'm not yet  
>> entirely convinced by my wavetable oscillators. To really remove  
>> the aliasing completely is difficult and finishes up using up so  
>> many processor cycles that you can't do any of the interesting stuff.
>
> I'm curious, what approach are you using to get 'alias free'  
> oscillators?  Simply using a much higher internal sampling rate and  
> then a low pass FIR filter?  Or something more sophisticated than  
> this.  Which is the part that is burning most of the processor cycles?

Well, like Scott G. I've tried a few things, but the comment was  
referring to using bandlimited wavetables. Unlike Scott, I've done  
this with multiple tables, like the Korg DW series synths. The  
original DW synths used one table per octave for eight octaves, at 8- 
bit resolution and about 50KHz sample rate, IIRC.
I've improved this in a number of ways; tables every half-octave, 16- 
bit resolution, 62.5KHz sample rate and two oscillators running on  
the chip.

The problems come down to the amount of interpolation you need to do,  
and the calculation required to generate the various indexes for  
those interpolations. To reduce truncation or rounding noise from the  
table, you need to interpolate between wavetable samples. In order to  
smooth the transitions between wavetables, you should also  
interpolate between the two nearest wavetables for a given pitch.  
This makes three interps. On a 40MHz chip at 62.5KHz, that's just  
about too much. I could gain some time by using a single uP for a  
single oscillator, but then I wouldn't be able to do any digital FM,  
and anyway, I thought these modern uPs were supposed to be powerful.  
Korg didn't bother with any of these niceities, since they probably  
didn't have much choice back then.

In the end, I followed Korg and put the interesting stuff in (PWM  
implemented as a phase distortion function, and digital FM between  
the two oscs) and left out the interpolation. The tables are  
oversampled anyway, so table noise isn't too much of an issue, and  
having tables every half-octave minimises the audibility of  
transitions, except for certain FM waveforms.

I'm hoping to reduce this problem by only switching waveform tables  
at the zero crossings, which I haven't tried yet.

The experiment was far from being a failure, and in fact I'll  
probably use it in my synth design, but it did make me realise how  
tough a problem aliasing is. Even taking the "easy" route and  
avoiding it using bandlimited tables uses up far more time and memory  
than you'd have thought - should be easy, right? Just read the  
appropriate sample from the appropriate table and output it - Bingo!  
Alias-free waveform at arbitary frequency! Turns out the devil is in  
the details, as ever...

T.







More information about the Synth-diy mailing list