Digital Sound & Music: Concepts, Applications, & Science, Chapter 6, last updated 6/25/2013
of look-up wavetables stored in contiguous memory locations. Each wavetable contains a list of
sample values constituting one cycle of a sinusoidal wave, as illustrated in Figure 6.48. Multiple
wavetables are stored so that waveforms of a wide range of frequencies can be generated.
1 0.0490676743274180
2 0.098017140329561
3 0.146730474455362

128 -2.449293598294706e-16
Figure 6.48 A wavetable in a table-lookup oscillator
With a table-lookup oscillator, a waveform is created by advancing a pointer through a
wavetable, reading the values, cycling back to the beginning of the table as necessary, and
outputting the sound wave accordingly.
With a table of N samples representing one cycle of a waveform and an assumed
sampling rate of r samples/s, you can generate a fundamental frequency of r/N Hz simply by
reading the values out of the table at the sampling rate. This entails stepping through the indexes
of the consecutive memory locations of the table. The wavetable in Figure 6.48 corresponds to a
fundamental frequency of .
Harmonics of the fundamental frequency of the wavetable can be created by skipping
values or inserting extra values in between those in the table. For example, you can output a
waveform with twice the frequency of the fundamental by reading out every other value in the
table. You can output a waveform with ½ the frequency of the fundamental by reading each
value twice, or by inserting values in between those in the table by interpolation.
The phase of the waveform can be varied by starting at an offset from the beginning of
the wavetable. To start at a phase offset of radians, you would start reading at index . For
example, to start at an offset of in the wavetable of Figure 6.48, you would start at index
To generate a waveform that is not a harmonic of the fundamental frequency, it's
necessary to add an increment to the consecutive indexes that are read out from the table. This
increment i depends on the desired frequency f, the table length N, and the sampling rate r,
defined by . For example, to generate a waveform with frequency 750 Hz using the
wavetable of Figure 6.48 and assuming a sampling rate of 48000 Hz, you would need an
increment of . We've chosen an example where the increment is an integer,
which is good because the indexes into the table have to be integers.
Previous Page Next Page