• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

why sawtooth instead of square wave for class D amplifier?

Status
Not open for further replies.

mik3ca

Member
I ended up playing around with a couple mosfets, a LM393 comparator, NE555 timer, and other stuff and I made myself a decent amplifier, but the inputs I used for the comparator were a square wave running at about 1Mhz and the audio source itself via a capacitor. I also connected a resistor voltage divider to the same input and this divider made things work well. (example: I made the input at ultra low volume and can hear the same thing very loud at the output)

Now I'm curious. In my design, I used a square wave as an input to the comparator. On the web, the majority of the designs use a sawtooth or triangular wave input. I'm curious. Why is the triangular wave input preferred? What is the disadvantage with a square wave input?
 

Les Jones

Well-Known Member
Most Helpful Member
With a triangular wave connected to one input of the comparator and the audio connected to the other input the output of the comparator will be a PWM signal whose duty cycle represents the instantanious level of the audio signal. I don't see how it could work with a square wave input.

Les.
 

alec_t

Well-Known Member
Most Helpful Member
I don't see how it could work with a square wave input.
Perhaps parasitics / bandwidth-limitation caused some low-pass filtering whereby the edges got knocked off the square-wave so that it became an approximation of a triangular wave. That would result in crude PWM.
 

AnalogKid

Well-Known Member
Most Helpful Member
AN LM393 probably is slow enough internally to triangle-ize, or at least trapezoid-ize a 1 MHz input.

ak
 

kubeek

Well-Known Member
Most Helpful Member
In my opinion Les Jones is closest to the actual point being asked, but let´s see what mik3ca has to say about it.
 

MrAl

Well-Known Member
Most Helpful Member
Hi,

I agree that Les provided the answer, but the other suggestions that the LM393 device is too slow are also good. I would definitely look at that because the slew rate could actually be defeating the purpose of creating a class D amp in the first place because the output can not be a clean PWM and thus the efficiency of the amp will not approach a true class D amp so all is for nothing.
A quick rough efficiency measurement would show some problems.
 

crutschow

Well-Known Member
Most Helpful Member

AnalogKid

Well-Known Member
Most Helpful Member
I agree that Les provided the answer, but the other suggestions that the LM393 device is too slow are also good.
I think Les and I said the same thing. Due to a non-refreshed page, I did not see his post before I wrote mine.

ak
 

AnalogKid

Well-Known Member
Most Helpful Member
Correction to your correction :D
All designs use a triangle wave - a saw tooth would mean massive distortion - not the 100% of a square wave, but at least 50%.
Disagreement with your correction to his correction.

The only difference between saw and triangle waves is a faster leading edge. There still is a linear relationship between elapsed time into a wave cycle and the percentage of the total wave area under the curve. With a positive-going saw wave (narrow peak at the top) of 2 V p-p and incoming audio of 2 V p-p, both into a fast comparator, the range of output rectangular wave pulse widths still is 0% to 100% of the saw wave period (note - theoretically perfect comparator).

For low-distortion PWM, the pulse frequency should be much greater than the highest audio freq. In terms of instantaneous values, the comparator sees a fast periodic waveform (saw or tri) on one input, and a slowly varying DC level on the other. For an instantaneous audio waveform value of 1.5 V, the comparator output will be a 25/75 rectangular wave (or 75/25 depending on how the inverting and non-inverting inputs are assigned), for *either* carrier wave.

ak
 
Last edited:

alec_t

Well-Known Member
Most Helpful Member
All designs use a triangle wave - a saw tooth would mean massive distortion
LTspice thinks there is very little difference in distortion for the two wave shapes.
 

Attachments

Nigel Goodwin

Super Moderator
Most Helpful Member
The only difference between saw and triangle waves is a faster leading edge. There still is a linear relationship between elapsed time into a wave cycle and the percentage of the total wave area under the curve.
I would disagree, a sawtooth has near instantaneous transition in one direction, and a slow ramp in the other.

But regardless, all class-D amps (of this type) use triangle waves - why would you want to use something that would be inferior?.
 

crutschow

Well-Known Member
Most Helpful Member
Sure about that? A lot of them look like triangle-wave-based to me.

ak
Yes, I meant sawtooth or triangle. :oops:

And, just to be clear, we are talking about the internal modulator waveform, not the waveform out of the modulator (which is a PWM square-wave).
I think there may be some confusion on that point.
 

crutschow

Well-Known Member
Most Helpful Member
But regardless, all class-D amps (of this type) use triangle waves - why would you want to use something that would be inferior?.
How is a sawtooth inferior?
A critical factor in the distortion generated by the PWM modulator is the linearity of the ramp of either the sawtooth or the triangle-wave.
If they both are equally linear, then they will produce equal output distortion.
 

AnalogKid

Well-Known Member
Most Helpful Member
I would disagree, a sawtooth has near instantaneous transition in one direction, and a slow ramp in the other.
Which is what I said
The only difference between saw and triangle waves is a faster leading edge.
To clarify, for waves of the same amplitude and frequency, a saw wave has a much faster leading edge. Mucho incredibly zoomy faster. But the area under both curves is the same, which is why the modulation noise is the same.
ak
 

ronsimpson

Well-Known Member
Most Helpful Member
A critical factor in the distortion generated by the PWM modulator is the linearity of the ramp of either the sawtooth or the triangle-wave.
Agree that a nice linear ramp is better but, I enclose the PWM in a feedback loop, (error amp) so this distortion should be removed.
 
Last edited:
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top