MATLAB: Filtering data by removing a specified frequency (noise)

fftfilterfrequencySignal Processing Toolbox

Hi, I have Pressure-crank angle degree data for an Internal Combustion Engine, before combustion starts, the curve is realistic and smooth, after the combustion starts, a pressure wave, of known frequency, travelling through the combustion chamber resulting in disturbing the original pressure increase curve, how can I remove this known frequency from my data ? I tried with fft, butter, and filter but I couldn't done, any kind of help will be greatly appreciated, thanks in advance,

Best Answer

Take the Fourier Transform. Look for the spike at that frequency (252 kHz) and set it to zero. Then inverse transform.
Or, alternatively, you could try a Savitkzy-Golay filter (sgolayfilt in the Signal Processing Toolbox) for a one-liner solution. The SG filter is a sliding polynomial filter - it replaces the element at the center of the sliding window by the polynomial fit, at that location, of the data inside the window. (Demo available upon request.)
Related Question