1
$\begingroup$

I have a signal coming from a sensor as shown below. This signal has high frequency noise (as can be seen from small fast wiggles) and four regions of interest where distinct spikes can be seen. The first region of interest starts with signal dropping first and settling. Second interesting region shows similar pattern; it drops first. The third region of interest is different from first and second because this time it spikes upwards and then settles. And fourth area of interest is also similar to third one; it spikes upwards first and then settles.

I consider third and fourth area of interests as similar signals as first and second but phase shifted versions.

Raw Data

My goal is not only to detect these interesting areas but also distinguish between the first two and last two. I then designed a matched filter and passed the raw signal through this matched-filter. The template for the matched filter was designed to detect the first two variants (the ones which fall downwards first) as shown in the picture below. Note that template is time-reversed version of the first area of interest in the signal.

Matched Filter Template

The output from matched filter is shown in the figure below which improves the SNR quite a bit and allows for easy detection of areas of interest. As can be seen, I can very clearly see the spikes corresponding to the four areas of interest. However, I cannot distinguish between the first two and second two. How do I do that?

Matched Filter Output

$\endgroup$

3 Answers 3

-1
$\begingroup$

Try this: Apply a moving-average-window to the output signal. A window with a length close or equal to your matched-filter template signal. This window is supposed to add all the samples within its range. When this window applies to the location of first and second waves, the result's sign would be different to that of third and forth. You can also try a weighted window like Hanning window.

$\endgroup$
1
  • $\begingroup$ That didn't really work. Moving average has low pass filtering effect. The result is not negative for third and fourth areas; the only effect I see is that the waveform output after moving average is averaged out (larger spikes are less prominent). Thanks for suggestion though. $\endgroup$ Jun 15, 2020 at 2:25
-1
$\begingroup$

That's a well formulated question.

I see this "just as a matter of programming" rather than trying to apply some DSP technique. You're interested in where the peaks are the biggest. Start with that, first loop scans and finds all the peaks and troughs, makes a list of each. Find the biggest one, work your way outward, classify your shapes from there.

If you want the shape of the envelope, or the frequency of the apparent tone, that's a different ball game.

$\endgroup$
-1
$\begingroup$

Looks like you know the shape of the signal and just want to discriminate:

  • amplitude
  • sign ( which is a special case of amplitude)
  • phase ( which is a special case of complex amplitude)

Do a wavelet transform. This will give you 4 peaks. Complex kernels would also yield phase info other than 0 or 180° (aka negative).

The result graphic will tell you:

  • when events occur
  • how fast they are
  • their amplitude (i.e. including sign, phase etc.)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.