# Separating 'signal' from periodic 'noise'

I have data in which the signal we want is a few gaussian peaks superposed on a noisy background in which some of the 'noise' is periodic. Simply suppressing the associated fourier modes is effective (e.g., a 'notch filter') but also suppresses the signal, since it has some power associated with those frequencies.

What is a good approach for removing these periodic signals without removing the corresponding signal?

This figure shows the data (top; with X-axis labeled by pixel #) and the absolute value of its fourier transform (bottom; X-axis is pixel frequency) with relevant regions identified.

An approach I've considered is least-squares fitting a series of sine functions with frequencies limited to the identified range and the signal-containing region masked out, but this is computationally expensive and it is difficult to automatically identify the affected frequency range.

• If the signal is known you can use a matched filter Commented Nov 21, 2014 at 9:37
• The signal is not known. As it turns out, our spectra are exceedingly poorly behaved, with "noise" features that mimic the signal very well in frequency and fourier space. Commented Nov 21, 2014 at 11:16
• Perfect situation to use wavelet. You may try with Morlet I guess. Commented Sep 15, 2015 at 23:04
• I have a naive suggestion. since the FFT of Gaussian is again a Gaussian, you might segment the signal into smaller windows, get the FFT of those, and remove the periodic noise spike in the Gaussian (frequency domain) and get back the signal through iFFT. Commented Sep 11, 2016 at 16:56
• Which kind of signal is it? Where do the data come from? Commented Nov 16, 2022 at 15:29

If you just need to detect when a gaussian peak occurs, you could try this:

Use the scipy hilbert function to determine the amplitude of the signal.

Pass the result through a high pass to remove the DC component.

Pass the result through a low pass to remove high frequency noise.

Use a threshhold function to detect peaks.

This will tell you when a peak occurred, and should be good at rejecting constant frequency and amplitude signals, as well as rejecting white noise of more or less constant amplitude.

It won't necessarily give you the shape of the peak. The peak you will see in a plot of the result (before the threshholding) may well resemble the original peak, but it won't be a perfectly accurate representation of it.

The values of the high pass and low pass filters can be juggled to get rid of noise, and to provide an appropriate pass band for the signal you are looking for.