The invention is directed to a class D amplifier. According to the class D
amplifier, sound data applied to an input terminal is supplied through a
compensation circuit to a PWM circuit, from which a PWM signal is output.
The PWM signal is converted to an analog signal through a first low pass
filter, which is delivered to a speaker. On the other hand, the sound
data is delayed by a delay circuit, and is converted to an analog signal
by a digital to analog converter. The higher frequency components of the
data are removed by a second low pass filter, and the rest of the data is
furnished to a differential amplifier. The differential amplifier
amplifies a difference between an output of the first low pass filter and
an output of the second low pass filter, which is then supplied to an
analog to digital converter. The analog to digital converter converts an
output from the differential amplifier to digital data, which is then
supplied to the compensation circuit. By doing so, a compensation value
based on an output from the analog to digital converter is added to the
following PCM sound data that is applied to the input terminal.