Mon, 09/21/2009 - 15:33 — AdrianFreed
This table-based digital audio oscillator implementation illustrates a few useful techniques on 8-bit microprocessors
such as the Atmel parts supported by the Arduino/Wiring IDE.
A timer is used to establish the sample rate clock and PWM is used to output an 8-bit signal.
Human hearing has impressive frequency precision so accumulation is done on 32-bit integers.
The code is a lesson in how to used fixed point representations and careful sizing of tables as powers of 2.
This reduces the computational cost of the inner loop of the oscillator to a single 8-bit multiply, table lookup and