[sdiy] PWM or DAC better for audio out?
nvawter at media.mit.edu
Thu Jun 2 19:51:04 CEST 2011
On Jun 2, 2011, at 12:54 PM, Olivier Gillet wrote:
> Which brings me to another thing that is not cool with PWM : you need
> to double the modulation frequency for every bit of resolution you
> add. To get 16-bits, 44.1kHz audio with naive PWM, you would have to
> work at close to 3 GHz. To get good resolutions, try sigma-delta
> modulation instead...
yup, in the popular AVR platforms (arduino, etc.), clock freq of 20 MHz
so one can make a table of max pwm freq vs. bits. eg.
sample rate Fs = Fc/2^b where Fc=20 MHz, and b = # of bits, e.g. 8-16
so as you can see, 8-bits makes Fs=78kHz, which is great, really.
but 9 bit quickly drops to 39KHz, which is audio range
then 10-bit makes Fs~=20kHz, so, sub audio range.
and it just gets worse from there.
16-bit PWM @ 20MHz, only results in 305 Hz! or 150 max freq!!!
If you really know what you are doing, you can run 8-bits at 78KHz,
and use a multiple-order sigma-delta DAC in *software* and perhaps get
1-3 extra bits out of it. I have turned 12-bit codecs into 16 this
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
More information about the Synth-diy