Notes On Audio Output from an FPGA
2010 Robert Finch
One of the simplest and easiest ways to obtain audio output from an FPGA is to use a device called a delta-sigma DAC (digital to analogue converter). The delta-sigma DAC includes a pulse generating circuit in the FPGA connected with a single pin to an external low-pass RC filter. The power averaged from all the pulses controls the output voltage and hence waveform available from the DAC. The delta sigma DAC type converter is used in many devices like portable MP3 players and portable game systems. There is actually a delta-sigma DAC circuit that is somewhat more complex than a simple pulse generator. The delta sigma DAC needs to be clocked at a rate that doubles for each bit of resolution desired in the DAC output. It is usable with audio because audio is generally low frequency. For instance a 4Khz audio signal with eight bits resolutions requires a minimum clock frequency of : 4,000 * 256 or about 1,024,000 (1 MHz).
Benefits:
- small size, compact
- low pin count
- low cost
- good quality output
Drawbacks:
- delta sigma DACs need to operate at a significantly higher operating frequency than the audio output; possibly several orders of magnitude higher.
- noise is proportional to frequency, so they are possibly noisier than other circuits.
- higher frequency circuitry tends to use more power as well. The pulse width converters required flip-flop counters to transition
- the transducing device, typically a microphone, needs to have a high-input impedance or the audio quality will suffer significantly as the DAC becomes loaded and inaccurate
- it often requires an additional high-impedance buffer to interface to things like audio speakers or amplifiers.
Output Analog Circuit Diagram
I used a circuit like this combined with a high impedance 5W audio amplifier driving a speaker in order to use a FPGA based PSG. It worked great.
Another means to produce an analog signal from an FPGA is to use an ordinary DAC device.
I use the following for output on the Nexys board:
A serial DAC chip also has a low pin count similar to a delta-sigma DAC
Benefits:
- probably a higher frequency of sound generation
- a lower operating frequency
- possibly higher quality output - a DAC chip can reach 12 bits of output resolution, a delta-sigma circuit may not be able to match the capacity
- if you need ultrasonic generation, a delta-sigma DAC may not suffice.