How to find an event in data ?

6 views (last 30 days)
Tomaszzz
Tomaszzz on 5 Oct 2020
Commented: Sargondjani on 16 Dec 2021
Hi all. I'm attaching a plot of acceleration versus time for a signal that I averaged over time. I want to automatically locate the event in data that I've circled in yellow. Is there a way to find the the time where it occurred? Any other tips to automate this would be welcome as well! I can find events circled in blue by using findpeaks if this of any relevance. Thanks from a Matlab beginner
  4 Comments
Adam Danz
Adam Danz on 5 Oct 2020
Edited: Adam Danz on 15 Dec 2021
In my experience it's best to start off by listing a set of rules that a person or computer can follow in order to isolate those areas of interest. Listing a set of rules in written or spoken language is prerequisite to building code that would follow those rules.
For example,
  • Ignoring the first spike (ie, starting at time ~0.1) isolate every 3rd spike where a spike is defined by passing a positive threshold. The theshold is defined by ......
  • Find the first two zero-crossings prior to each 3rd-spike. They mark the beginning and end of the dip below y=0.
  • Once the 'dip' is isolated, find it's minimum (or, perhaps you just want the index of the 0-crossing just before the 3rd spike).
After those rules are set, you can start to implement them (findpeaks may come in handy) and the rules may evolve as you go. But I wouldn't even think about the implementation without having a solid starting conceptual gameplan.
Sargondjani
Sargondjani on 16 Dec 2021
Yep, you first need to find out a rule that works. If you can identify the blue peaks, then go backwards in time (assume you can do it ex-post), and find 2 peaks earlier (those labelled three in Adam's post). Then find the last trough before those peaks.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!