How to set different threshold's for each data?

I am plotting a graph of acceleration(y axis) Vs time(x axis) for 1000 points(secs). I want that particular point at which value is greater than threshold. But if its for single data I can use this code :
firstIndex = find(Acceleration > 43 ,1, 'first');
AccelerationAtThresh = Acceleration(firstIndex);
timeAtThresh = time(firstIndex);
I have many data's and for each data there is different threshold to be set.
Say,for the 1st data (which I have attached) it should show 43
How can I proceed?
Can this be used in real time information gathering as well?
I have attached the flow chart for reference

回答 (1 件)

Image Analyst
Image Analyst 2022 年 9 月 13 日

0 投票

First I'd ask why you need a different threshold for each one. Is there drift in your measurement that can possibly be avoided, thus allowing you to use a fixed threshold, which is usually preferable?
Otherwise you'll need an automatic thresholding algorithm. You didn't post the plots (why not?) and I didn't bother to download the spreadsheet and write a MATLAB program to plot all your curves, so I don't know what to suggest (make it easy for us to help you, not hard). Perhaps findchangepts or my attached triangle threshold might work.

4 件のコメント

Surabhi A S
Surabhi A S 2022 年 9 月 14 日
編集済み: Surabhi A S 2022 年 9 月 14 日
I'm sorry I thought I have attached the plot but it wasn't visible. I have attached it again, I hope its opening. Does the findchangepts show the point at which the graph starts rising?
I need different threshold's as for each data there are different points at which peak starts rising and also I'm collecting real time data as well
Image Analyst
Image Analyst 2022 年 9 月 14 日
None of the Acceleration signal you showed in the Acceleration vs. Time picture show a value of 43, so how did you arrive at the 43 for the threshold?
Surabhi A S
Surabhi A S 2022 年 9 月 14 日
@Image Analyst Sorry its time which is 43 not the acceleration
Image Analyst
Image Analyst 2022 年 9 月 14 日
OK, but what is there in that fairly noisy signal that tells you 43 should be the time chosen to be a threshold?
And what do you want to do with that time threshold? Extract data after that? Extract data before that?

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

カテゴリ

製品

リリース

R2018a

質問済み:

2022 年 9 月 13 日

コメント済み:

2022 年 9 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by