Extracting features from curves

13 views (last 30 days)
jlt199
jlt199 on 22 Jun 2016
Commented: Star Strider on 23 Jun 2016
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 Comments
Star Strider
Star Strider on 23 Jun 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 on 23 Jun 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

Sign in to comment.

Answers (1)

Star Strider
Star Strider on 23 Jun 2016
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 Comments
jlt199
jlt199 on 23 Jun 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 on 23 Jun 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.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!