Author Topic: Class D explained  (Read 12551 times)

Offline Shonver

  • Trade Count: (+7)
  • AVForums Veteran
  • *****
  • Posts: 9,551
  • Criss-cross rhythms that explode with happiness
    • Elipse (under construction)
Class D explained
« on: July 01, 2013, 05:41:26 AM »
There has been a lot of discussion and questions asked on the forum about Class D amplifiers. Here is the lowdown, posted by a local authority on the technology, Pierre Watts. Pierre hasn't posted here for a long time (these posts data back to 2006). I'm re-posting his content here, as it seems to have gotten lost over time.

Original posts here:

Class D explained, Part I
Class D explained, Part II
« Last Edit: July 01, 2013, 05:44:03 AM by Shonver »
________________

DON'T PANIC
Capie

Offline Shonver

  • Trade Count: (+7)
  • AVForums Veteran
  • *****
  • Posts: 9,551
  • Criss-cross rhythms that explode with happiness
    • Elipse (under construction)
Class D explained, Part I
« Reply #1 on: July 01, 2013, 05:42:00 AM »
Since there seems to be confusion over the various types of Class-D amplifiers and their operating principles, I've cobbled together a VERY basic explanation of them and how the different philosophies of a holistic system instead of the individual components coincide or differ.

Firstly, it should be noted that no class-D amp, or any amp for that matter, is "digital" in absolute terms. The "D" does not stand for digital. All class-D amps rely on pulse-width modulation techniques, that is purely analog. This is exactly the same principles used in switching power supplies typically found in low-cost high-power appications such as PC power supplies.

The basic concept of PWM is that of a DC-AC converter: a high-frequency carrier is used to modulate a reference input signal and recreate it by demodulation (merely a lowpass filter) at the output. PWM in basic terms means that any signal can be approximated by a series of square waves with varying widths. The ratio of high vs low state per wave period is called the duty cycle. 100% duty cycle would mean a continuous high, 0% a continuous low, and 50% that the wave is high and low for half the time of the period respectively. A simple practical explanation of how this can be advantageous is to explain the influence of an analog voltmeter. If you would connect a SPDT toggle switch to the meter that switches between -5V and 5VDC, the meter will jump to the corresponding value when the switch is toggled. However, what would happen if the switch is toggled very fast at equal intervals; faster than the needle's reaction time? The needle will remain fixed at 0V, or halfway between the two switching states. It is therefore easy to see that the duty cycle is in direct proportion to the eventual DC output - if the switch is connected to 5V for 90% of a period and to -5V for 10% (i.e. a 90% duty cycle), the DC output would be 90% of 5V added to 10% of -5V, i.e. 4V.

So, we know that we can create a varying DC output by switching between two DC levels at a fast, constant frequency and controlling the ratio of on vs off time per switching period. If we therefore use the instantaneous value of an analog audio signal to control the switch (and thus duty cycle), we will have a DC output that changes as the signal changes. It should be obvious that this will only be useful if this switching happens very fast, and common switching speeds are between 200 and 400kHz. So let's say we use a sine wave from a signal generator as our analog signal. Remember the analog signal isn't used by the switches directly; it's only used to CONTROL the duty cycle of the switches. When the sinewave crosses 0V, for that brief period the sinewave's instantaneous value is 0V. When it's at its positive peak, it's normalized value is 1V, and anything inbetween follows the same pattern. If the switches are switching very fast; much faster than the bandwidth of the input signal, the duty cycle of the produced squarewave would be 50% when the input signal crosses the 0V line, 100% when it's at it's positive peak and 0% at it's negative. If we now go back to the voltmeter example, it should be clear that the DC value at the output of the switches changes according to the analog signal controlling the switches. Since the switches operate at such high frequency however, the DC level changes very fast and actually "becomes" AC. We can therefore say that the low-frequency audio signal is "carried" by the higher-frequency squarewaves of rapidly changing width.

The method how this can be used for power amplifiers should now become evident. There is a low-level circuit that generates this varying duty cycle square waves according to the input signal (This is usually done by comparing the input signal to a sawtooth or triangle wave). This "pulse-train" is typically between -5V and 5V. These square waves are then used to drive the gates of two MOSFETs. The MOSFET's can also be seen as switches, driven by the earlier switches described. A useful practical example would be to use a small relay's output to drive a larger relay. The one MOSFET has its drain connected to the positive power supply rail; let's assume 40VDC, and its source to a reference point. The other MOSFET has its drain connected to this reference point and its source to the negative voltage rail of -40VDC. This is therefore just a higher-voltage copy of the same principle depicted earlier - the reference point (the speaker) is literally connected to the DC rails for _very_ short periods.

So we can now replace the voltmeter needle with the speaker motor. When the amplifier is fed with a 0V input signal (silence), the speaker is actually connected to + and -40VDC at a rate of e.g. 400 000 times per second, but the connection to +40V is for the same duration per switching period as the -40VDC, and thus the cone stands still and no power is dissipated. If the ratio of one rail to the other is higher (higher duty cycle), the cone would move in or out correspondingly, and therefore be a representation of the actual input signal. This method is also the reason why efficiency is so good in class-D amps - the only losses is in the MOSFET's themselves. In an ideal environment 100% should be obtainable. After copper and switching losses has been factored in, this figure usually drops to around 90% that is still damn good compared to normal analog amps. Controlling the volume is also very simple - just change the power supply voltage! Indeed so, many integrated class-D amps' volume control really is just an adjustable power supply.

Even though the switching frequency is far above the audible range, demodulation (lowpassing to remove the carrier/switching frequency) is actually implicit and implemented to a certain degree by the woofer voice coil inductance. However, the high-frequency energy that has to pass to the speaker along the speaker cable is then actually a high-power broadcast antenna, and it can also heat up a tweeter voice coil in certain instances. To combat this, a lowpass filter (usually just a series inductor and shunt capacitor) is used between the output stage and the speaker. This filter is the subject of great debate. Too high and too much ripple current can pass through and EMI increases. Too low and the audible bandwidth is affected. To make things worse, the filter has a resonant peak, and that peak usually is somewhere in the audioband. The DC resistance of the choke is also an important consideration regarding efficiency and power delivery, so usually a ferrite-core inductor with very thick wire is used. And lastly, this filter interacts with the loudspeaker and its crossover. Post-filter feedback as used in some amps help a lot here.

It should also be noted that the MOSFET's are always switching complementary - when one is turned on, the other is turned off. This should be obvious, as the output should only be connected to one DC rail at a time. If something goes wrong that causes both to turn on at the same time, well... the power supply rails are in effect shorted out, leading to catastrophic failure of the MOSFET's and often the speaker too.

Obviously, this technology has some serious issues that need to be addressed before it can be considered safe and suitable for audio. The four most challenging design problems for class-D amps are
1) to get the pulse widths as accurate as possible
2) to have the MOSFET's switching as fast as possible, i.e. to limit the time elapsing from giving the gate signal until the FET has actually connected the voltage rail to the load
3) to prevent simultaneous switching of the FET's
4) to implement overcurrent protection - because the FET's switch so fast, this is extremely difficult to implement fool-proof, and on high-current power supplies such as one we've built for Eskom, this stage often is the most challenging.

All class-D amplifiers operate on the described principle. Some are slightly different. The output stage described is a half-bridge type that switches between two opposite voltage rails. Another type known as full-bridge is the same, but with twice the MOSFET's and driving the speaker between the two output sets instead of to ground. This should sound famaliar and is exactly the same principle used when bridging an analog amplifier. These two versions of output stages are common to all class-D amps irrespective of how the preceding circuitry works for generating the PWM signal driving the FET's.

The most basic form of class-D amps is called Naturally Sampled PWM. It generates the pulse-widths by using a comparator and a ramp generator (sawtooth or triangle wave operating at the switching frequency), and compares the value of the ramp with the incoming audio signal. This is how most class-D amps worked until recently, and it's still a cheap and simple solution for car audio and other high-power low cost and low fidelity applications. The precision of the ramp generator is critical to the success of the amp, and they depend on an equally critical clock.

A newer type is more complex, but it uses feedback and is called a free-oscillating/self-resonant design. This is a much better method and eliminates the need for a ramp generator and thus a clock by constantly ensuring oscillation using feedback and adjusting the swiching frequency accordingly. The feedback is also useful to address the effects of the lowpass filter used to remove the carrier. This is the approach followed by the ZapPulse, Tripath and Hypex amplifiers, all highly successful designs. The Hypex ones in particular are excellent value almost irrespective of cost, with superb specifications.

[Continued in part two, needed due to max message length]
________________

DON'T PANIC
Capie

Offline Shonver

  • Trade Count: (+7)
  • AVForums Veteran
  • *****
  • Posts: 9,551
  • Criss-cross rhythms that explode with happiness
    • Elipse (under construction)
Class D explained, Part II
« Reply #2 on: July 01, 2013, 05:43:24 AM »
[Continued from Part 1]

The last method is the so-called "digital amplifier". This is actually a misleading name and it should ideally be renamed. The full name is Uniformly Sampled PWM. This is the technique used by TacT in their amplifiers, and also my research group.  
The basic principle is to keep the audio in the digital domain, and instead of comparing the reference sawtooth/triangle waveform to the continuous analog signal to produce the PWM, it is now compared to the digital samples. The ramp generator is now a digital counter that resets when it reaches its top value. It should be obvious then that the resolution of the sample that is being compared should match the resolution (or increments) of the counter. So, it should be perfect and much more accurate than the analog version, plus we are spared of using any DAC or having to convert to analog at any stage. Where it actually becomes analog is a philosophical matter, but the most popular agreement is when it is converted to PWM.

There is a catch however. One needs to switch at an integer multiple of the sample rate, and a frequency of 384kHz is commonly used nowadays - 2x 192kHz. The need for a sample rate converter is pretty much mandatory, as it would be difficult to adjust the whole scheme according to the incoming sample rate, especially 44.1kHz since it would need a frequency of 352.8kHz. Converting everything to a single static sample rate is much easier. That is not the problem though. The problem is the speed of the clocks needed. If we want to retain 24-bit precision, the counter needs to step in 24-bit increments per switching period. So, for 24bit counter resolution and a switching frequency of 384kHz, the clock speed of the counter needs to be 384 x 2^24 kHz - that is 6400GHz, an impossible figure. The fastest possible clock speeds in modern DSP's and FPGA's is around 500MHz, allowing 10bits. It should be noted however, that none of the current 24-bit DAC's can really deliver 24-bit resolution. That would mean an analog Dynamic Range of 145dB that has never been achieved. Do not confuse analog DR with digital DR, the two are definitely not the same!

If we simply discard the other least significant 14 bits and just connect a straight line between the samples (linear interpolation), the sonic result will be terrible with high baseband distortion. The technique used to address this is called polyphase interpolation, or attempting to reconstruct the original continuous analog signal and where it would estimate to have crossed the sawtooth, and is called Pseudo-Natural PWM. This is a mathematical nightmare to perform in real-time. In an attempt to use the rest of the 14 bits, noise shaping is usually used (this is a bit difficult to explain, but the idea is to shift noise to a higher inaudible frequency). TacT uses a special DSP from TI to do all this. We use an FPGA to do so in software with much greater flexibility, but also much more work since everything has to be created from scratch and not merely accessing registers on the DSP. In theory and simulation this technique is capable of 160dB Dynamic Range, but would require tolerances and several other factors that are impossible to achieve in practise - even a slight increase in temperature for example (there are masses of other factors too) can have a profound effect on DR of this level. A more realistic figure is around 110dB. Whether humans can hear this amount of DR is besides the point (they cannot; ears aren't nearly sensitive enough plus we have to keep in mind that ambient noise levels is easily in the region of 40dB), it is for measurements and AES articles.

If we look at the concept holistically, both the analog and digital camps have valid arguments and I don't blindly advocate the latter just because it's the method I'm doing my research on. I believe in horses for courses, and for the end application we have in mind, it is a more practical and flexible approach.

Let's start at the CD player. The DAC of the CD player does most of the techniques that I've described for the digital amp: modulation (usually delta-sigma), interpolation and noise shaping, followed by demodulation using lowpass filters with opamps or whatever at its output. The resulting analog output is very low in noise and distortion. For standard PWM amplifiers, this analog signal is then subject to the amplifier, be it standard analog or class-D with PWM generation and switching stage.

For digital we start at the same place. The digital signals are now sent to the DSP or FPGA, which generates the PWM opposed to delta-signa modulation. If we also add the same opamps lowpass filters to demodulate the PWM into a low-level signal, we have a normal DAC. So one could argue that the digital amp is bascially just a power DAC, and that's also one of the other names for them. Instead of low-level demodulation and analog amplification, we use analog amplification (well some sort of it) and high-level demodulation. The opamp-based lowpass filters that are used between the DAC and the pre/power amp is now replaced by the LC lowpass filter between the amp and the speaker. So it really is just a different approach and cannot be seen as being "digital".

Another drawback of the digital method is that feedback is very difficult to achieve. It works well by leaving it out, such as TacT also did, but the effect of non-ideal power supply and the lowpass filter can be a problem. One method to do feedback is with an ADC to convert the analog output back to digital, and that opens up a whole new can of worms. It does work if done correctly, even though at a much higher complexity level.

Even though I think that a high-end source and well-designed normal class-D amp may have a sonic edge over the digital approach, the latter has a few important advantages:
1) Cost. For analog the quality of the source, and thus its DAC, has a major influence on the quality of what comes out of the amp. GIGO. With the digital method and decent jitter attennuation techniques, the quality of the source becomes much less critical.
2) Flexibility. Any digital application such as filters, crossovers, EQ, room correction et al can easily interface with it without having to use ADC's and DAC's all over the place. Simpler design and shorter signal path. When using an FPGA instead of a DSP the advantages become even more: with a DSP you're bound to what it can do or not. An FPGA is just a giant testbench with a certain capacity. The code on it can be adapted to implement all the features mentioned without any change to the hardware. The TacT amps' digital crossovers and room EQ hardware are separate DSP boards that have to bought in addition. With FPGA the necessary software can merely be loaded. If available logic cells are limited, some of the functions can be removed to make room for others.
3) Application for multiple speakers. In the light of home automation and large-scale professional audio applications, the following makes a lot of sense: Digitally active hybrid speakers. It has already been discussed at great length at the last AES convention to use the speakers' magnet assembly as heatsink for class-D modules. Each drive unit has its own amp, digital crossover and Wifi receiver. Each speaker is then assigned an IP address from a remote hosting console, and thus every speaker can be controlled remotely by only giving it local mains power. This is very useful for example in multiroom home automation: apply this technology to all the in-wall and in-ceiling speakers, throughout the house (where power cables are abundant and easy to access), and it becomes very simple to control what speaker should do what. Simply bring a new speaker home, give it power, assign an IP and you're ready to go. Compare that to the current method used by Clipsal or Crestron of using a distribution system such as RS485 to merely control basic analog amplifiers feeding all the speakers connected by long runs of speaker cable. Bulky and inefficient, cables (signal, speaker and control) running all over the place. Of course this approach could be used with other amps too, but then they would need expensive and space-consuming DAC's as well, that would ultimately raise cost and limit performance since there won't be space for a super-serious DAC per drive unit.

So there is my (admittedly not well formatted; I wrote it in less than two hours in the insomniac night hours :015: ) explanation of the working of PWM audio, the three variations of class-D amps using it and the advantages and disadvantages they have to offer. Hope it provides a better insight to some of the people here.
________________

DON'T PANIC
Capie

Offline Andresound

  • Commercial Member
  • Trade Count: (+1)
  • ***
  • Posts: 117
Re: Class D explained
« Reply #3 on: October 30, 2014, 12:08:57 PM »
I am running a pair of NCORE mono blocks (class D) and they are flipping awsome!!

Offline Timber_MG

  • Trade Count: (+2)
  • AVForums Veteran
  • *****
  • Posts: 6,254
Re: Class D explained
« Reply #4 on: October 30, 2014, 02:27:06 PM »
I am running a pair of NCORE mono blocks (class D) and they are flipping awsome!!

I am looking exactly at these to drive my bass horns.

Offline Andresound

  • Commercial Member
  • Trade Count: (+1)
  • ***
  • Posts: 117
Re: Class D explained
« Reply #5 on: November 04, 2014, 03:30:50 PM »
might be a bit of overkill!!! The standard HYPEX modules will do the trick for bass!

Offline reactor_sa

  • Trade Count: (+6)
  • AVForums Veteran
  • *****
  • Posts: 1,231
Re: Class D explained
« Reply #6 on: November 04, 2014, 05:05:14 PM »

But how does it sound?? :p

I tried class D rotel, good for movies, not pleasant for music. My expensive experience....

Offline Rodney_gold

  • Trade Count: (+13)
  • AVForums Veteran
  • *****
  • Posts: 7,807
Re: Class D explained
« Reply #7 on: November 05, 2014, 08:49:47 AM »
I tried the Rotel 250w 1572 on my Kef LS50's , granted , I didnt have any other amp to compare it to , but it sounded pretty good to me.. no artefacts etc.
Im using a sort of class D (its not Class D as we know it) to power my giya G1's - a Devialet .. I have heard that amp and it's really superb.
Hopefully Devialet might allow the technology to trickle down to less expensive amp only modules..
Roon/tidal > SBT>DIRAC ddrc 22 > 2x Devialet D premiers>  Vivid audio Giya G1's ..fully treated room

Offline kamikazi

  • Trade Count: (+17)
  • AVForums Veteran
  • *****
  • Posts: 5,921
Re: Class D explained
« Reply #8 on: November 05, 2014, 01:02:40 PM »
I reckon Class D is continuously evolving and just because one manufacturer perhaps made a less than sterling effort doesn't invalidate the entire idea. Personally I'm a big fan of Devialet's hybrid strategy of combining Class A and D topologies and it seems like a lot of manufacturers are doing stirling work in implementation.

Offline Andresound

  • Commercial Member
  • Trade Count: (+1)
  • ***
  • Posts: 117
Re: Class D explained
« Reply #9 on: November 07, 2014, 07:50:54 AM »
Rotel Class D is ICE amp based I believe. IMO, Bruno's Hypex are the best sounding.

Offline kamikazi

  • Trade Count: (+17)
  • AVForums Veteran
  • *****
  • Posts: 5,921
Re: Class D explained
« Reply #10 on: November 07, 2014, 09:21:55 AM »
I've heard pretty good things about the new ICE based amps used in products by Wyred4Sound like the mINT and mAMP. Hypex does seem like the class leaders though.

I think Rotel gave it a half hearted effort, got criticised for how it sounded, panicked and went back to what they always did e.g rebadging and refining old designs, slap on a new model number with a new chassis. If you look at the criticism they took, maybe Rotel's typical customer aren't looking for anything new or innovative. Just good sound at an attainable price. I don't think Rotel is a particularly innovative or creative company.

NAD is a good example of modern Hi-Fi with interesting designs and products through utilising the benefits of Class D amplification in different ways. Wyred4Sound did a lot of experimentation with Class D power supply designs when using ICE modules and found it an important ingredient of how these amplifiers can sound.

Offline Rodney_gold

  • Trade Count: (+13)
  • AVForums Veteran
  • *****
  • Posts: 7,807
Re: Class D explained
« Reply #11 on: November 07, 2014, 10:19:52 AM »
Problem with class D , is that you dont have the Behemoth effect , any normal 250w amp will have a big box , lots of weight etc.. class D seems puny compared .. so you get a lot less weight and heft for your money :)
I really like the low heat and slim form factor of class D.
Roon/tidal > SBT>DIRAC ddrc 22 > 2x Devialet D premiers>  Vivid audio Giya G1's ..fully treated room

Offline Andresound

  • Commercial Member
  • Trade Count: (+1)
  • ***
  • Posts: 117
Re: Class D explained
« Reply #12 on: November 07, 2014, 10:41:55 AM »
NAD 's new high end offering features HYPEX Ncore design. Awsome :2thumbs:

Offline vangelis

  • Trade Count: (0)
  • AVForums Member
  • *
  • Posts: 11
Re: Class D explained
« Reply #13 on: February 23, 2015, 08:28:18 PM »
 :thumbs:
Daniel