Re: PWM -> Audio
- From: John Larkin <jjlarkin@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 09 Dec 2007 10:28:22 -0800
On Sun, 09 Dec 2007 04:23:56 -0800, JosephKK
<joseph_barrett@xxxxxxxxxxxxx> wrote:
John Larkin jjlarkin@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx posted to
sci.electronics.design:
On Thu, 6 Dec 2007 06:53:24 -0800 (PST), Silvar Beitel
<silverbeetle@xxxxxxxxxxxx> wrote:
Recently there were some comments in another thread about
microcontroller audio output techniques. (I can't find them now -
having to use Google Groups sucks - my otherwise reliable ISP
discontinued supporting a dedicated news server), and it leads me to
ponder a bit on what the best way to do this is.
On a prototype, using 8-bit audio (voice) data sampled at 8 kHz to
drive a PWM output, I just brute-forced the audio output path: A
multistage active LP filter (4 kHz corner freq) and a simple PA to
drive the earphones/speaker. I'd like to do something
smarter/better/ cheaper on the next iteration.
Some options:
1) Multiply the PWM rate by N, reusing the data N times (or perhaps
interpolating), cut down on the active filtering required. However,
significantly upping the rate chews up processor cycles and
increases
power. Enough to matter? I dunno yet.
2) Make a charge pump out of a tristateable output and internal
counters, drive it using differential data, and feed an external
integrator. The sampling frequency component at the output would be
significantly less compared to the PWM output and thus could result
in savings in the filtering circuitry.
3) Implement the "traditional" class-D LC filter output.
4) Just try to get the PWM frequency as high as the rest of the
system will allow and then drive the earphones/speaker directly,
using the
speaker/headphones as part of the filter. Certainly cheap, but what
about emissions, especially out of probably non-shielded headphone
cords?
I haven't thought this all out, but am asking the group for input
because I'm sure some of you have already done this thinking for
me :-) So, what have you done / would you do?
(P.S. The National LM48511 looks interesting. Have any of you used
it?)
We often use delta-sigma instead of pwm to make 1-bit dac outputs.
But that's usually in an fpga, where computation is cheap. D-S
doesn't have the constant-frequency pwm carrier frequency issue.
It would take a periodic process, doing roughly a dozen lines of
assembly code - depending on the machine - to bit-bang a port pin in
delta-sigma mode.
John
You have me curious here, are you feeding a traditional CVSD chip with
that or are you somehow using it directly (just shoved into a
filter)? In either case what is the bit bang rate, and the effective
audio bandwidth.
You just lowpass the pin out of the fpga, usually just with one r-c.
We mostly use this for things like trimming offsets or vcxo's, where
the clock rate is huge compared to the filter cutoff, like 40 MHz
clocks and 100 Hz filters. But there are lots of audio "1=bit" dacs,
and I seem to recall they work at 2.8 MHz or something like that.
Lately people are going to multibit delta-sigma for better
performance, but that needs a few-bit dac. This sort of blurs with the
trick of dithering a dac to more bits.
D-S has the advantage that you don't have the pwm fundamental
frequency screaming at you, and you can get very high resolution
without being trapped by the clock/pwm ratio. The cost is a slightly
elevated noise floor and a bit of distortion, and some more logic.
John
.
- Follow-Ups:
- Re: PWM -> Audio
- From: Vladimir Vassilevsky
- Re: PWM -> Audio
- References:
- PWM -> Audio
- From: Silvar Beitel
- Re: PWM -> Audio
- From: John Larkin
- Re: PWM -> Audio
- From: JosephKK
- PWM -> Audio
- Prev by Date: Re: Color in Datasheets
- Next by Date: Re: Who is Jesus?
- Previous by thread: Re: PWM -> Audio
- Next by thread: Re: PWM -> Audio
- Index(es):
Relevant Pages
|