Electronic – Audio PWM DAC filtering

audiodacfilterpwm

I have an msp430 synth project and can't decide on the output:

I get an 8 bit ~45kHz PWM output out of the chip which I'd like to use as an audio signal, but I am unsure whether

  • I can just stick an impulse amplifier on it and let it in a speaker through a decoupling capacitor
  • I should filter off the PWM frequency

So the question is – should I filter off the ~45kHz component of the signal before I let it into any audio output device (amplified speakers, headphones etc.).

I do know for a fact that it'll work either way, I'm just concerned about damaging any additional amplifiers following in the signal path and harming the speakers themselves. So I'd appreciate tips from someone with experience with this.

Best Answer

It depends.

If you want a line-level output for headphones, recording, other audio systems, yes you should filter off the 45kHz PWM component. I would suggest the "3rd order Sallen-Key low-pass filter" from your filter design page as a starting point. It ought to provide a clean enough signal to prevent damage to anything downstream.

But if you want to re-record this signal you may need to clean it up further : you can add 2nd-order Sallen-Key stages to make a 5th or 7th order filter, but a nice alternative would be the "twin-T notch filter" on that site, with the notch at 45 kHz.

If you want power output, take the raw PWM signal to a half-bridge to form a Class-D amplifier. Then I would recommend the R-L-C lowpass filter from that site with R = 4 or 8 ohms : in reality, your loudspeaker.