[sdiy] PWM or DAC better for audio out?
Tom Wiltshire
tom at electricdruid.net
Thu Jun 2 19:12:07 CEST 2011
On 2 Jun 2011, at 17:54, Olivier Gillet wrote:
> Tom's post makes me realize that the denomination "PWM frequency"
> might be confusing in my post.
>
> If you generate digital sample at 10 MHz, with a resolution of 8 bits,
> your effective sample rate is 39kHz (256 digital values are output for
> every 8-bit value) ; you can output audio up to 19.5kHz. But the dirty
> peak in the spectrum (the "square wave at rest problem") is at 39kHz,
> not 10 MHz.
Olivier makes a good point - this does indeed get confused quite often.
When I was talking about "PWM frequency" I was referring to what Olivier calls the "effective sample rate" above - e.g. the rate at which you can stick samples out. The actual PWM hardware will be clocked much faster - 256x for 8bit, 1024x for 10-bit etc.
I call it the "PWM frequency" because if you feed the raw output (unfiltered) to your oscilloscope, what you see is a variable-width pulse wave at the given frequency. You don't see the clock frequency, even if that's ultimately what's driving everything.
T.
More information about the Synth-diy
mailing list