I have reread your post and now I see that output signal will constantly change in the rhythm of the input signal.
How about the case that duty cycle change constantly?
For example, in this picture D changes constantly, say D = 20% only for one cycle, next cycle D =30% and next cycle D =40% ... then how can I calculate output voltage?
I think we should compute average voltage over each cycle, right?
hi anhnha,
This is the point I was trying explain in my post #5.
The pulse width reflects the instantaneous amplitude of the 'audio' signal that we wish to amplify in the 'D' class amplifier.
The Comparator output is a result of comparing the audio signal and the triangular 'sampling' frequency, which is a square wave of constant amplitude but with a varying pulse width.
This square wave is amplified in the 'D' class amplifier and is output as a square wave of greater amplitude.
To recover the amplified original audio signal the square wave signal is demodulated using a filter, usually a resistor/inductor capacitor network.
Consider the amplifier has to accept 'audio' over a range of 50Hz thru 10Khz, as shown at the highest audio frequency of 10KHz the triangular frequency would have to 100KHz.
ie: a ratio of 10 to 1.
As its only a 10:1 ratio, its not easy to 'faithfully' recreate the 10KHz audio signal due to the time constant constraints of the R/C demodulator
At lower frequencies the ratio becomes higher, so the audio signal will be closer to to original signal.
I realise you are seeking a mathematical solution, but I would say its important to bear in mind what is the purpose of the circuit.
Eric
This is an extract from your link.
The most basic way of creating the PWM signal is to use a high speed comparator ("C" in the b-diagram above) that compares a high frequency triangular wave with the audio input. This generates a series of pulses of which the duty cycle is directly proportional with the instantaneous value of the audio signal. The comparator then drives a MOS gate driver which in turn drives a pair of high-power switches (usually MOSFETs). This produces an amplified replica of the comparator's PWM signal. The output filter removes the high-frequency switching components of the PWM signal and recovers the audio information that the speaker can use.