Re: Low-pass filter and amp design



mjt@xxxxxxx wrote:

I'm seeking some advise on designing a low-pass filter and amp circuit.
 Unfortunately I've never been trained in electronics, so I'm learning
things as I need to!

My application is portable, battery based.  The battery is rated as
9.6v and there will be a regulated supply at +5v for the CMOS area.
I'm looking to generate an audio signal from a PIC (or similar) using
PWM.  The digital side I'm fine with, its the analogue side I don't
know.  I need to clean up the PWM signal and output it to a speaker at
reasonable volume.

I have the following objectives:

 * Minimise power usage where possible
 * Have a shut-down signal that puts the audio circuit in to standby
 * Keep the component count as low as possible
 * It has to be cheap

The audio quality doesn't have to be hifi level, a reasonable quality
is fine.  I've looked at loads of possible circuits, but I can't find
anything concrete on how to calculate values to filter at the right
frequency.  Incidentally I expect the sample rate to be around 9Khz,
therefore a cut-off at 4.5Khz would be best.  The modulation frequency
from the PWM is going to be around 36Khz.  These aren't fixed figures
just yet, because I need to do a bit more research on the chip
capabilities.  If possible I'll run it on a higher PWM frequency, but
these values are good indicators for the end design.

Thanks in advance for any help given!

Michael

A filter cut off of 4.5kHz is not the right choice for a sampling rate of 9kHz. It may be fine for your PWM frequency, but if you try to generate audio at close to 4.5kHz you'll hear significant aliasing.

You have to ask yourself: What is the highest frequency that I'm going to play, and what's an acceptable amount of aliasing? That, plus the sampling rate, will tell you the order of the filter you'll need. I'd probably choose a 3kHz filter because it's standard telephone-quality. You can, if you're clever, get a 3-pole filter with a single amplifying element. If you're a beginner just find a cookbook 2-pole audio filter and use that; if it's not enough filtering then cascade two of them.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
.



Relevant Pages

  • Re: PWM -> Audio
    ... using 8-bit audio data sampled at 8 kHz to ... Multiply the PWM rate by N, reusing the data N times (or perhaps ... Implement the "traditional" class-D LC filter output. ... We often use delta-sigma instead of pwm to make 1-bit dac outputs. ...
    (sci.electronics.design)
  • Re: PWM -> Audio Output
    ... The audio output works but the quality is not quite there. ... I've discovered that I can remove these artifacts by changing the PWM ... My PWM output feeds through a first order RC filter which is set to cut ... The poppiness is an absolutely sonically repeatable sound that can ...
    (comp.arch.embedded)
  • Re: Low-pass filter and amp design
    ... My application is portable, battery based. ... I'm looking to generate an audio signal from a PIC using ... I need to clean up the PWM signal and output it to a speaker at ... Wescott Design Services ...
    (sci.electronics.design)
  • Re: Simple PWM volume controller. Could it work?
    ... >> pass filter, to get rid of the high frequency component, and that's ... scaled by the PWM ratio. ... >> potentiometer that gives 0 V on the PWM output, no audio is getting ... A better switch than the ancient 4066 ...
    (sci.electronics.components)