PWM - accuracy??
Mar 19, 2006 at 6:47 PM Thread Starter

#### Regus

I started thinking about building a DAC and having read about Class D amplifiers such as lyngdorf and got to wondering what kind of frequency one would need...

Now digital audio comes in a variety of shapes of sizes 16 bit 44.1 kHz being the most common... now if i understand it correctly this means that 44100 times every second there are 65536 different possible voltage levels this would seem to mean that the PWM modulation frequency would need to be 44100 * 65536 = 2,890,137,600 or in other words nearly 2.9 GHz from what i have read Class D amplifiers don't operate anywhere even close to this frequency - i think the lyngdorf ones do 3 or 400 kHz.

This leads me to the conclusion that I am missing some important piece of information.

Now asuming about .5 MHz would is actually enough. I would find it interesting to experiment with something along the lines of a PIC and some MOSFETs and see if one could make anything soundlike with these.

So someone please tell me what the missing piece of information is.

Mar 19, 2006 at 8:17 PM

#### Shoewreck

Analog controlled class D amplifiers don't need such high switching frequencies - pulse widths form a continuous multitude, so the average voltage per cycle can be anywhere in between the minimum and maximum. Digitally controlled Class D amplifiers use many tricks (I've heard something about short time delays...), so that pulse widths form a bounded countable set of values, that's enough to reproduce even a 20-bit 44100Hz coded waveform (just like many "1-bit" DACs do)

Mar 20, 2006 at 1:38 AM

#### Regus

ok been reading left and right about oversampling, delta-sigma and so on and so forth. But I cannot escape the conclusion that oversampling seriously reduces the amount of information compared to a 16 bit 44.1 kHz PCM signal...

400 kHz seems to be the accepted switching frequency, and with that kind of precision you will only be able to produce around 9 discrete voltage levels for each sample at 44.1 kHz, compared to the 65536 that is contained in the PCM signal, this seems ridicolously low.

Now obviously there has to be more to the story than that seeing as oversampling dacs actually exist and are bought at non-trivial prices by people who do have a clue.

But so far it eludes me...

It could be interesting trying to build a hybrid dac though, with 255 resistors per channel and a PWM at around 11 MHz, and from what I read this should be possible if a somewhat tedious soldering experience

But I think I will shelve this project for a now and try a somewhat simpler aproach like a DDDAC1543 or something along those lines...

Mar 20, 2006 at 12:52 PM

#### Garbz

Let me assure you that oversampling most definitly does not reduce the information available. If it did would audio companies brag about it
I for one can't stand non-os DACs. Even when A/Bing oversampling vs non-os in the shanling cdplayers the oversampled option was always smoother and all around nicer to listen to.

Mar 20, 2006 at 4:43 PM

#### Regus

Well there is no doubt that oversampling works - that has been proven in pratice many a time - same goes for class D amplifiers.

However there is no way you can transfer full PCM information on a 400kHz 1 bit carrier, and even if you operate with a full bridge design and take full advantage of it you will have at most 54 descrete voltage levels per sample.

Now the contra question becomes how many voltage levels can you really produce with a NOS - in theory it is the full 65536 of course, but even with a 9 volts span that is less than 140 uV (micro volts) difference between the levels, while the chips might be able to do that in a lab I seriously doubt it can do so in a real world enviroment, you will need redicolously pure power at a source capable of handling shifiting currents with voltage fluctuaction far below 140 uV which is unlikely at best.

Exactly how many descrete voltage levels the NOS can realisticly produce I don't know.

There is also the whole filtering issue, where oversampling suposedly has far smaller requirnments which could make a difference too.

Now there are two interesting questions:
a) which of the two produce the most accurate results
b) which of the two produce the most pleasing results

And I have not heard enough equipment to even atempt an answer at either

I think I will experiment along the way, could be interesting to try a well renouned oversampling DAC chip, a TAS5010 in conjunction with a TAS5182, and a TDA154x setup and compare them.

I also think I will eventually try making a hybrid DAC; an 8 bit sgemented dac driven with an 11.2455 MHz PWM, I figure I could quite easily setup a piece of programmable logic to produce an 8 bit PWM signal from I2S, and a segmented dac should be able to handle that kind of frequency smoothly. Only problem is the tediousness of of soldering a total of 512 resistors