A control system for an internal combustion engine comprising: a sensor configured to measure a rotational velocity of a rotating element connected to said engine and to provide an angular synchronous analog signal representing said rotational velocity, wherein rotation of the rotating element triggers the sensor and the trigger events occur at regular angular intervals; an analog-to-digital converter connected to said sensor to receive and convert said angular synchronous analog signal into a time continuous angular synchronous digital signal; a filtering module configured to receive and filter said digital signal using a continuous moving average anti aliasing filter using time-based sampling to form a filtered time continuous time synchronous digital signal, wherein the events in the time continuous time synchronous digital signal occur at regular time intervals, and wherein said filtering module comprises: an integrator configured to integrate said time continuous signal to form an integrated signal; a sampling module configured to continuously sample said integrated signal; an averaging module configured to form average values from the current sample S 0 and a previous sample S -2 being taken two samples before the current one, divided by the total sample time h*2, where h is the sample period; and an output module configured to form a time continuous output signal from said average values formed by said averaging module; and a control unit configured to form at least one time synchronous control signal based on said filtered digital signal, wherein said control signal is provided to an engine control system for controlling an engine velocity or a torque of said engine. a sensor configured to measure a rotational velocity of a rotating element connected to said engine and to provide an angular synchronous analog signal representing said rotational velocity, wherein rotation of the rotating element triggers the sensor and the trigger events occur at regular angular intervals; an analog-to-digital converter connected to said sensor to receive and convert said angular synchronous analog signal into a time continuous angular synchronous digital signal; a filtering module configured to receive and filter said digital signal using a continuous moving average anti aliasing filter using time-based sampling to form a filtered time continuous time synchronous digital signal, wherein the events in the time continuous time synchronous digital signal occur at regular time intervals, and wherein said filtering module comprises: an integrator configured to integrate said time continuous signal to form an integrated signal; a sampling module configured to continuously sample said integrated signal; an averaging module configured to form average values from the current sample S 0 and a previous sample S -2 being taken two samples before the current one, divided by the total sample time h*2, where h is the sample period; and an output module configured to form a time continuous output signal from said average values formed by said averaging module; and a control unit configured to form at least one time synchronous control signal based on said filtered digital signal, wherein said control signal is provided to an engine control system for controlling an engine velocity or a torque of said engine. an integrator configured to integrate said time continuous signal to form an integrated signal; a sampling module configured to continuously sample said integrated signal; an averaging module configured to form average values from the current sample S 0 and a previous sample S -2 being taken two samples before the current one, divided by the total sample time h*2, where h is the sample period; and an output module configured to form a time continuous output signal from said average values formed by said averaging module; and a control unit configured to form at least one time synchronous control signal based on said filtered digital signal, wherein said control signal is provided to an engine control system for controlling an engine velocity or a torque of said engine.