Also, my current method I'm trying results in a lot of false features, so I think I need something a bit more sophisicated.
Extracting features from curves
12 views (last 30 days)
Show older comments
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
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.
Answers (1)
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
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.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!