A correction circuit (600) for correcting one or more errors in a digitized current
signal, wherein the digitized current
signal is a digital representation of an analog current
signal of a current flow through an
energy storage element (602), wherein the correction circuit (600) is configured to correct an offset error between the digitized current signal and the analog current signal by: a) comparing the digitized current signal with the analog current signal to determine the offset error by: i. detecting a first
time step when the digitized current signal crosses a first digital threshold; ii. detecting a second
time step when the analog current signal crosses a first analog threshold; iii. calculating a first duration between the first
time step and the second time step; iv. determining a first slope of at least one of the digitized current signal and the analog current signal; v.Multiplying the first duration by the first slope to determine the offset error; and b) correcting the digitized current signal using the determined offset error; and / or wherein the correction circuit (600) is configured to correct a relative
slope error between the digitized current signal and the analog current signal by: a) comparing the digitized current signal with the analog current signal to determine the relative
slope error by: i. detecting a first time step when the digitized current signal crosses a first digital threshold; ii. detecting a second time step when the analog current signal crosses a first analog threshold; iii. detecting a third time step when the digitized current signal crosses a second digital threshold; iv. detecting a fourth time step when the analog current signal crosses a second analog threshold; v.a) Calculate a first digital slope
delay between the first time step and the third time step; b) Calculate a first analog slope
delay between the second time step and the fourth time step; c) Divide the first analog slope
delay by the first digital slope delay to calculate a first delay parameter, then subtract one from the first delay parameter to determine the relative
slope error, and d) Correct the digitized current signal using the determined relative slope error.