[sdiy] Wavetables
Scott Nordlund
gsn10 at hotmail.com
Sat Jan 22 07:51:33 CET 2011
> 1) The actual sampling issue is where I get out of my depth. (My math
> ain't good. Really ain't good.) Assuming that I need to cover the
> (slightly limited*) frequency range provided by MIDI note numbers, the
> system needs to be able to produce waveforms from 27.5Hz to 4186Hz. As
> the waveform being output is actually a set of steps, as far as I can
> see, the quality of the waveform will get WORSE as frequency DECREASES
> (even with a capacitor on the output of the DAC.)
How are you clocking this? You can either use a variable sample rate
(VCO or programmable divider driven by a very high frequency clock) or
fixed sample rate (phase accumulator). A fixed sample rate is much more
sensible if you're doing more than one or two oscillators, but will
alias since it resamples the waveform. Variable sample rate won't, but
if you're using a divider it will have worse pitch resolution at higher
pitches.
I think you'll find the image frequencies resulting from non-ideal
reconstruction to be desirable. If you perfectly filter out everything
above Nyquist, the result is very boring. Another option is to use
multisamples. This can also mean that your clock source doesn't have
be adjustable over such a wide range.
> So, taking 27.5Hz as the worst-case scenario, what is a sensible number
> of samples per cycle required to produce a reasonable quality
> sine/triangle/sawtooth waveform? (Being the value of n I mentioned a
> paragraph or three back.)
Your waveform can correctly represent n/2 harmonics for n samples.
Above this the spectrum will be inverted and repeated. Historically 128
or 256 has been reasonable. Very low resolution waveforms are too buzzy.
It may be useful to reduce this resolution, which you can do by switching
off address bits.
More information about the Synth-diy
mailing list