How do I segment a repetitive pattern?

Figure 1
Hi, Is there a way where I can segment the cycle in an efficient way? From Figure 1, there are 8 reptitive cycles based on the 8 tall peaks and I would like to segment the 8 cycles and put each cycle in a matrix. I've tried using findpeaks function in Matlab with different values for the parameters eg. MinPeakProminence, MinPeakDistance etc. but there will always be unwanted peaks. The unwanted peaks are usually the peaks pointed downwards.
So in the end, the final product of the cycle segmented would look something similar to the picture below. Thank you.

回答 (1 件)

KSSV
KSSV 2017 年 11 月 9 日

0 投票

You fix a _y_ value at which cycle get's over.....use _find_ to get the indices. With the help of these indices you should be able to get your cycles.

4 件のコメント

lol lolol
lol lolol 2017 年 11 月 9 日
編集済み: lol lolol 2017 年 11 月 9 日
Hi,
thanks for the reply but I tried to find the black circled peaks with the method mentioned but I always get the red circled peaks along with it as their y values are quite similar. Did I do something wrong or is it meant to be like that? Thank you.
KSSV
KSSV 2017 年 11 月 9 日
As you are dealing with flottant's...you should use:
Let y be your y values and yval be the value which you are seeking.
tol = 10^-3 ;
idx = find(abs(y-yval))<=tol ;
lol lolol
lol lolol 2017 年 11 月 9 日
Thanks for the help KSSV. I've tried doing it your way but the result isn't so satisfactory. Probably it'd look different when you do it but when I did it, it doesn't come out right. Haha.
lol lolol
lol lolol 2017 年 11 月 9 日
But yes, if you don't mind helping me out a little bit more, attached is a copy of the raw data. What I want is to know the coordinates of the pink circled peaks. So does the way you taught me previously find these coordinates automatically? Or do you perhaps know a more efficient way? Cause the only other way I can think of is doing it semi automatically but it'd take a lot of time as I have to remove some points manually and it is also quite prone to human error. Thank you.

サインインしてコメントする。

質問済み:

2017 年 11 月 9 日

コメント済み:

2017 年 11 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by