Extracting features from curves

I would like to be able to identify and features that occur in a curve. A typical feature can be seen in the attached image. The features may be big, or barely visible above the background noise. The all have the same shape though: From a baseline, drop to a trough, climb up to a peak and drop back down to a trough.
I do not know how many features are present before I start the analysis, although I can see them if I look at the data visually.
I have tried searching for peaks and searching for valleys using Prof O'Haver's code http://terpconnect.umd.edu/~toh/spectrum/PeakFindingandMeasurement.htm#Valleys and now I'm trying to see if there is only positive gradient between a trough and the neighbouring peak. But I think this far from the best way and doesn't seem to be working.
Any suggestions please?

6 comentarios

jlt199
jlt199 el 22 de Jun. de 2016
Editada: jlt199 el 22 de Jun. de 2016
Also, my current method I'm trying results in a lot of false features, so I think I need something a bit more sophisicated.
dpb
dpb el 22 de Jun. de 2016
Have you tried findpeak in Signal Processing Toolbox? While it looks only for positive peaks, using it on abs(signal) may be effective.
I'd suggest attaching the data file if you'd expect anybody to do much; hard to do anything w/o the data and while a visualization is nice, that's all can do with it...
jlt199
jlt199 el 22 de Jun. de 2016
I haven't tried findpeak in the SP toolbox, I currently don't have any toolboxes, although I'm willing to purchase some if they help solve the problem. I have tried findpeaksx from the file exchange.
A simulated data set is attached, but it shows most of the features of the real data.
Many thanks
jlt199
jlt199 el 23 de Jun. de 2016
I have tried searching for peaks and troughs and then matching them up be searching for different criteria such as, the gradient between the trough and the peak must be +ve, the trough must occur before the peak and there must be at least four points to a feature.
I'm finding that this technique is throwing out actual features, whilst accepting noise as features. I would really appreciate help finding a better technique. Many thanks
Star Strider
Star Strider el 23 de Jun. de 2016
Your signal has a relatively low amplitude resolution, so the resulting quantisation noise is making it difficult for us to understand what you want to identify as peaks (other than the one significant deflection).
If you could post a second image on which you manually identify what you want to detect, that would help.
jlt199
jlt199 el 23 de Jun. de 2016
Thanks for your comment Star Strider. I have attached a figure with all of the features in the signal shown. I understand that the first one is difficult to see above the noise, so if I miss this one with my algorithm it wouldn't be the end of the world. Thanks again

Iniciar sesión para comentar.

Respuestas (1)

Star Strider
Star Strider el 23 de Jun. de 2016

0 votos

My pleasure.
If you’re doing what appears to be signal acquisition (it looks like a biomedical signal) and want to work with your signals, you need the Signal Processing Toolbox.
You have low-frequency baseline variation in your signal as well as high-frequency noise, so I would first do a fft on it to determine the signal frequency range and the noise frequency range. I would then use that information to design a bandpass filter to eliminate the low-frequency baseline variation and any high-frequency noise. Filter your signal, then use findpeaks to identify your peaks of interest. That should be much easier on your filtered signal.
There are several ways to design filters in MATLAB, including fdatool, dfilt, and others. My IIR filter design procedure is here: How to design a lowpass filter for ocean wave data in Matlab? A filter for your signal may be challenging to design, but not impossible.
I will do what I can to help you process your signals.

3 comentarios

jlt199
jlt199 el 23 de Jun. de 2016
I have requested a trail of the signal processing toolbox, once I receive that hopefully I can follow your suggestions. I've never designed filters however, is there such a thing as an adaptive filter because my background trend and noise levels are going to be changing over time?
Thanks again
jlt199
jlt199 el 23 de Jun. de 2016
Can I use the fft if my signal isn't time-based? I actually take a reading every xmm. Thanks
Star Strider
Star Strider el 23 de Jun. de 2016
Sure. You will get back spatial frequencies (cycles/millimetre) rather than cycles/time_unit.
For the fft, your data just have to be regularly-sampled. The fft really doesn’t care what your independent variable is, providing the interval between samples is constant, and known. The same applies to the filter design and implementation functions.

Iniciar sesión para comentar.

Preguntada:

el 22 de Jun. de 2016

Comentada:

el 23 de Jun. de 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by