A method for detecting pressure in a combustion chamber of a cylinder of an internal combustion engine by processing a voltage signal relating to the pressure in the combustion chamber of the cylinder of the internal combustion engine, the signal being an input signal having, in alternation, plateau phases, during which a base signal progresses on average in accordance with a linear function over time, and main peak phases, during which the input signal is representative of pressure peaks prevailing in the combustion chamber, said method comprising:
- acquiring the input signal;
- rectifying the input signal such that the gradient of the base signal is zero;
- clipping the peaks of the rectified signal of which the amplitude is greater than a predetermined voltage value to obtain an at least partially clipped signal;
- detecting a main peak when the amplitude of the input signal is greater than the amplitude of the clipped signal;
- compensating the input signal when the main peak is not detected to obtain a compensated output signal;
- and
- providing the compensated output signal to an electronic control unit of the vehicle to control operating parameters of the engine, the operating parameters including a moment of injection of fuel into the cylinder,
- wherein the input signal further comprises secondary noise peaks, and the predetermined voltage value is selected so as to allow the clipping of the main peaks while avoiding the clipping of the secondary noise peaks.