Identifying repeated patterns in data without knowing the pattern

17 次查看(过去 30 天)
To analyze recorded signals of a car driving on a track, I need to identify and isolate the effective data range to perform further calculation. Below is what a typical speed signal may look like, with the x-axis being time. The data is simply stored in a ?x2 matrix with time being the first column. Since the car drives in circle, three repeated pattern can be identified visually, however, we didn't know what the pattern looked like. There are three types of unwanted signals to exclude:
  1. Continuous 0 or NaN at the beginning and the end (the periods between cycles are to be kept)
  2. The small hill before the first cycle. Sometimes it also happens at the end, but never between cycles.
  3. That false peak at the end caused by sensor gliches.
In the end, I only want to keep the blue line region for further processing. My current method is to first use rmoutliers to get rid of false peaks. Then to identify where the real cycles start, the code searches where the signal first reaches half of the maximum speed, and then locates the last time it went back to 0. The use of half the max speed is arbitrarily chosen, because the little hill (type 2) is usually less then that. However, sometimes it also causes a part of the pattern to be removed as well (yellow region), because it's smaller then 1/2 max speed and is followed by a 0 region. It would be most ideal, if a function can simply identify repeated pattern in a set of data, without knowing what the pattern looks like, so that I can simply extract that region. If not, any way to filter out those unwanted parts is appreciated as well.
  1 个评论
Image Analyst
Image Analyst 2022-7-28
Is there something about the beginning and ending glitches that can identify where they are? That would probably be easier than to find out if some unknown/undefined pattern is replicated exactly or approximately some unknown number of times.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:

请先登录,再进行评论。

回答(1 个)

Mathias Smeets
Mathias Smeets 2022-7-28
Try working with the function groupcounts.
This will detect which values are returning often in your code, this way you might be able to detect some values that are not used often and therefor can be thrown away.
Here is another useful link.
  1 个评论
Shao-Yu Wang
Shao-Yu Wang 2022-8-2
That did not quite work for my data, but I've found a work around using findsignals, so thanks for your reponse anyway!

请先登录,再进行评论。

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by