Cleaning a signal and computing period

126 Views Asked by At

I am working with a signal which is a periodic square signal with some kind of noise and some outliers. I would like to know which is the best solution in order to get the period and clean the outliers that can be seen in the image:

enter image description here

The final goal is to binarize the signal.

Thanks in advance,

1

There are 1 best solutions below

5
On BEST ANSWER

Here's what I would do:

  1. Lowpass filter the signal to remove the high-frequency noise.
  2. Once you lowpass filter the original signal, it won't look like a square wave anymore. The infinitely sharp transitions will be damped. Thus, apply a $1$-bit quantizer (with hysteresis) to the output of the lowpass filter, so that you "binarize" the lowpass filtered signal.
  3. Differentiate the "binarized" signal, in order to obtain a train of impulses. Compute the duration of the time intervals between successive impulses, compile a list of such durations, then compute a histogram, normalize the histogram, and then compute the 1st moment of the normalized histogram (which is an estimate of the expected value of the period).