user1812432
user1812432

Reputation: 11

Detecting a curve shape from a signal

I am trying to detect a curve of a certain shape and its position from a signal as shown below:

(link to picture: http://tinypic.com/view.php?pic=ab5j45&s=6)

I would be getting the signal as an array of floats.

Due to noise and other variations, the curve may not be exact so I can not use simple number matching. I was wondering if there is something in OpenCV which I can use for this.

Note that I will need to detect curves of different shapes and their position in the signal but if I know to detect one type, I can use the same method to detect other types.

Regards, Peter

Upvotes: 1

Views: 1595

Answers (3)

Aki Suihkonen
Aki Suihkonen

Reputation: 20037

Matched filter has the highest peak at the integer position in a signal that best matches the given shape (or energy of the pattern to be matched). But in addition to that, often the neighboring values of the matched filter output can be used to fine tune the position by calculating tau = a-b/(a+b) (IIRC), where a=peak value and b is the second best value.

This works especially well, if the signal to be matched has good auto correlation characteristics -- one high peak and close to zero at +-1 from the peak (basically means detecting pilot signals).

Upvotes: 0

mariosangiorgio
mariosangiorgio

Reputation: 5543

I would try to define a parametric mathematical function representing the shape you want to match.

Then all you need to do is to apply a technique (For instance least squares) to get the values of the parameters that best matches the curve over your signal.

You may want to match your function against a sliding window, especially if you want to match multiple events in your signal.

Upvotes: 1

Broken_Window
Broken_Window

Reputation: 2093

Noise and "other variations" are high frecuencies, so you need to filter the signal with a low-pass filter (for filtering, use the convolution operation). It seems that you signal have very low frecuencies (below 5KHz maybe?). Alfter filtering, look at your signal, and when you get the desired curve shape, apply numerical matching.

Upvotes: 0

Related Questions