PCM to PWM conversion 101 - diyAudio
Go Back   Home > Forums > Amplifiers > Class D

Class D Switching Power Amplifiers and Power D/A conversion

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 29th January 2012, 01:28 AM   #1
percy is offline percy  United States
diyAudio Member
 
Join Date: Apr 2004
Location: MN
Default PCM to PWM conversion 101

Hi,
I would like to learn more about PCM to PWM conversion. The theory and implementation basics. Old fundamentals, New developments/improvments/ideas. Any good links or books I can check out ?
Thanks.
  Reply With Quote
Old 29th January 2012, 08:57 PM   #2
benb is offline benb  United States
diyAudio Member
 
Join Date: Apr 2010
Looks like 95 views and no responses. I kinda wonder about this myself, so I'll start this off. I googled:
PCM to PWM conversion - Google Search
The first hit is an older diyaudio thread.

Just thinking offhand, it might work better to convert not to PWM, but rather to a single-bit high-bit-rate (in the MHz range) "PCM", as used in the first stage of many sigma-delta converters. This makes the output quantized (the output always switches on a clock transition) just like DSD, but this might have a substantially higher switching frequency than Class D generally uses, causing some problems with output device switching speeds.

The volume would be controlled while in PCM (because I don't think it's readily doable as a 1 bit signal) - just multiply by a constant. With a 24-bit volume control word and a 24-bit PCM signal, the result is 48 bits which can probably be chopped (do bit reduction) back down to the 24 most significant bits without (much) audible damage, though it would be easy enough to add low-level dithering noise before the chop. If the source is 16 bits, make that 16 bits the most significant bits in a 24 bit word, then proceed as described.

Thesedays the faster 32-bit processors or microcontrollers (such as the latest ARM chips) should be fast enough to do the needed DSP work at 24/96 or so, though dedicated DSP chips are cheap enough as well.
  Reply With Quote
Old 30th January 2012, 04:05 PM   #3
gmarsh is offline gmarsh  Canada
diyAudio Member
 
gmarsh's Avatar
 
Join Date: Apr 2004
Location: Halifax, NS, Canada
I've done this professionally for a high power broadcast application. Things you need to know...

Doing digital generation of traditional PWM (comparing a triangle wave to your input signal) while maintaining 'audiophile' quality requires a brutally high PWM sampling rate. Technically Fs * 2^16 or >2GHz for 44.1KHz audio.

Doing noise shaping, you can gain a few bits back in the audio frequency band and bring the PWM generation frequency down to a 'practical' level - eg, 500MHz using the DDR outputs of a FPGA running at 250MHz. You can also add more PWM output channels and sum their outputs together, gaining an extra bit every time you double the number of PWM outputs.

You're better off ditching classical PWM and making a delta sigma modulator, with some tricks added like dynamic hysteresis to keep the switching frequency in a good place.

But in the end, digitally generated PWM will be limited in performance by power supply rejection/pumping, thermal effects due to output stage Rds(on), etc... effects which will likely overwhelm time quantization noise. You need to either sample your power supply voltage at a high rate with low delay to do feed forward compensation, sample the power stage output and do NFB, again with a brutally low delay... or characterize the response of your system, build a model for everything and do precorrection.

Best chip to develop such a thing would be a FPGA. Something like a Xilinx Spartan3-200A, which can run at a couple hundred MHz and has plenty of available multiplier blocks inside.
  Reply With Quote
Old 30th January 2012, 04:08 PM   #4
gmarsh is offline gmarsh  Canada
diyAudio Member
 
gmarsh's Avatar
 
Join Date: Apr 2004
Location: Halifax, NS, Canada
For an example of something that works, there's plenty of literature out there for building a PCM to DSD encoder. Bruno Putzeys also designed a high power DSD DAC and has an IEEE paper on it. The two blocks put together should create something sensible.
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP !!!! final project about PCM-PWM convertser weizhao Digital Source 2 9th February 2007 11:03 AM
USB PCM to PWM? gevorg Class D 3 20th October 2006 11:15 AM
coding your own PCM to PWM converter? jwagnerhki Class D 2 15th November 2005 09:06 PM
PCM to PWM ?? jeapel Digital Source 1 18th July 2005 06:28 PM
PCM to DSD conversion liz Digital Source 6 2nd October 2003 08:53 AM


New To Site? Need Help?

All times are GMT. The time now is 03:47 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2