a digital sound generator
A digital
sound generator can be built with some simple equations below. They
are suitable for beeing used in a 8-bit microcontroller unit with
assembler. lt produces a cosinus sine wave with 10% even and odd
harmonics. The circuit converts a cyclic 8-bit phase into a
symmetric 16-bit waveform using mirroring and a polynomial function.
The multiplications and subtractions shape the curve; a sine table
(ROM/LUT) is not required. It also can be transformed into a digital
circuit.

This
circuit uses an adder a multiplier and a substractor.
The
circuit generates a digital, symmetrical waveform with a 16-bit
output value from an 8-bit counter. The 8-bit counter cycles
through the values 0 to 255. The current counter value is
temporarily stored and then inverted, resulting in a triangular
sequence ranging from 0 to 127 and back to 0 from the ascending
count sequence. From this value, the equation C = 2P + 1 generates a
sequence of odd values from 1 to 255 and back. C is then squared: Q
= C². Two terms are formed from this result: 3Q and R = QC / C ×
128. Subtraction provides E. This value lies approximately between 3
and 65533. By subsequently subtracting 32768, the signal is shifted
by the midpoint of the value range. The output thus lies
approximately within the signed 16-bit range from −32765 to +32765.
It was tested
in a Lattice PLD together with a programmable EEPROM for the multiplication.
It can easily be changed to e.g. Verilog language or also VHDL (VLSI
Hardware Description Language).
Conclusion and Summary
Simple equations can be used to produce
sound in microprocessor applications and programmable logical devices.
|