A receiver for receiving a signal, the receiver comprising: a local oscillator arranged to deliver an in-phase local oscillator signal and a quadrature local oscillator signal; an in-phase signal path having a mixer arranged to mix the signal received by the receiver with the in-phase local oscillator signal to deliver an in-phase signal, and an analogue-to-digital converter arranged to convert the in-phase signal to a digital in-phase signal; a quadrature signal path having a mixer arranged to mix the signal received by the receiver with the quadrature local oscillator signal to deliver a quadrature signal, and an analogue-to-digital converter arranged to convert the quadrature signal to a digital quadrature signal; a compensation stage arranged to deliver a compensated digital in-phase signal and a compensated digital quadrature signal by applying compensation coefficients to the digital in-phase signal and the digital quadrature signal; and a compensation coefficient generator arranged to generate the compensation coefficients by iteratively updating them using a relative gradient of the compensated digital in-phase signal and the compensated digital quadrature signal, and a step parameter, wherein the relative gradient is an indication of correlation or gain mismatch; wherein the compensation stage is arranged to adjust the magnitude of the step parameter based on the relative gradient of the compensated digital in-phase signal and the compensated digital quadrature signal; and wherein the compensation stage is arranged to adjust the magnitude of the step parameter based on the rate of change of the compensation coefficients. a local oscillator arranged to deliver an in-phase local oscillator signal and a quadrature local oscillator signal; an in-phase signal path having a mixer arranged to mix the signal received by the receiver with the in-phase local oscillator signal to deliver an in-phase signal, and an analogue-to-digital converter arranged to convert the in-phase signal to a digital in-phase signal; a quadrature signal path having a mixer arranged to mix the signal received by the receiver with the quadrature local oscillator signal to deliver a quadrature signal, and an analogue-to-digital converter arranged to convert the quadrature signal to a digital quadrature signal; a compensation stage arranged to deliver a compensated digital in-phase signal and a compensated digital quadrature signal by applying compensation coefficients to the digital in-phase signal and the digital quadrature signal; and a compensation coefficient generator arranged to generate the compensation coefficients by iteratively updating them using a relative gradient of the compensated digital in-phase signal and the compensated digital quadrature signal, and a step parameter, wherein the relative gradient is an indication of correlation or gain mismatch; wherein the compensation stage is arranged to adjust the magnitude of the step parameter based on the relative gradient of the compensated digital in-phase signal and the compensated digital quadrature signal; and wherein the compensation stage is arranged to adjust the magnitude of the step parameter based on the rate of change of the compensation coefficients.