A method for dead time compensation in a Class-D amplifier, the Class-D amplifier comprising an input terminal for receiving a pulse modulated input signal, a power output stage having two switches, such as MOSFETs, an output switching node and a driver block configured to control said switches, wherein said method comprises: receiving a pulse modulated input signal at the input terminal, said pulse modulated input signal comprising pulses with falling flanks corresponding to a falling level transition and rising flanks corresponding to a rising level transition; measuring a falling level transition delay from a time when a request for a falling level transition is provided to the driver block to a time when a corresponding transition occurs at the output switching node; and measuring a rising level transition delay from a time when a request for a rising level transition is provided to the driver block to a time when a corresponding transition occurs at the output switching node; characterized by: upon reception, at the amplifier input terminal, of a rising level transition, adding a function of the immediately previous falling level transition delay to the pulse modulated input signal, thereby providing a compensated rising level transition signal; and upon reception, at the amplifier input terminal, of a falling level transition, adding a function of the immediately previous rising level transition delay to the pulse modulated input signal, thereby providing a compensated falling level transition signal, wherein the function of the immediately previous falling level transition delay is the measured immediately previous falling level transition delay subtracted by a minimum falling level transition delay, and wherein said function of the immediately previous rising level transition delay is the measured immediately previous rising level transition delay subtracted by a minimum rising level transition delay. receiving a pulse modulated input signal at the input terminal, said pulse modulated input signal comprising pulses with falling flanks corresponding to a falling level transition and rising flanks corresponding to a rising level transition; measuring a falling level transition delay from a time when a request for a falling level transition is provided to the driver block to a time when a corresponding transition occurs at the output switching node; and measuring a rising level transition delay from a time when a request for a rising level transition is provided to the driver block to a time when a corresponding transition occurs at the output switching node; characterized by: upon reception, at the amplifier input terminal, of a rising level transition, adding a function of the immediately previous falling level transition delay to the pulse modulated input signal, thereby providing a compensated rising level transition signal; and upon reception, at the amplifier input terminal, of a falling level transition, adding a function of the immediately previous rising level transition delay to the pulse modulated input signal, thereby providing a compensated falling level transition signal, upon reception, at the amplifier input terminal, of a rising level transition, adding a function of the immediately previous falling level transition delay to the pulse modulated input signal, thereby providing a compensated rising level transition signal; and upon reception, at the amplifier input terminal, of a falling level transition, adding a function of the immediately previous rising level transition delay to the pulse modulated input signal, thereby providing a compensated falling level transition signal, wherein the function of the immediately previous falling level transition delay is the measured immediately previous falling level transition delay subtracted by a minimum falling level transition delay, and wherein said function of the immediately previous rising level transition delay is the measured immediately previous rising level transition delay subtracted by a minimum rising level transition delay.