Algorithm to identify certain peaks at certain loation is a graph

1 回表示 (過去 30 日間)
Shruthimol
Shruthimol 2022 年 8 月 17 日
編集済み: Kevin Holly 2022 年 8 月 17 日
I reconstructed the output of an Ultrasound NDT signal. Ive created a set of codes to compare a plots corresponding to a damaged specimen again a healthy specimen. But i am not able to come up with a solution to identify only the peaks below a certain y value and after a certain x value. The required x value corresponds to the value of findchangepts(y).
In the figure peaks.jpg, The region in blue rectangle is insignificant to my analysis and the region on interest is the green. the red rectangle signifies the backwall echo. I used diff(x) and diff(y) to comare the graph but it is not giving reliable results. i'm looking to analyse the data for a presence of back wall echo. Figure 03.jpg shows 2 plots for 2 healthy specimens.
Please suggest me some commands or tools to obtain the results.
Thanks in advance.

採用された回答

Kevin Holly
Kevin Holly 2022 年 8 月 17 日
You can get the values and index of the peaks and apply the x and y thresholds as shown below:
plot (x,y,t,D);
[v,idx]=findpeaks(D,MinPeakProminence=0.5);
y_threshold = 10;
idx(v>10)=[];
v(v>10)=[];
x_threshold=500;
v(idx<500)=[];
idx(idx<500)=[];
hold on
scatter(x(idx),v,"r","filled")
  2 件のコメント
Shruthimol
Shruthimol 2022 年 8 月 17 日
Thanks alot... that works perfectly.
Can I also ask you some method to detect presence/absence of peaks between x=1600:2000 ?
Kevin Holly
Kevin Holly 2022 年 8 月 17 日
編集済み: Kevin Holly 2022 年 8 月 17 日
plot (x,y,t,D);
[v,idx]=findpeaks(D,MinPeakProminence=0.5);
% Thresholds
xmin_threshold = 1600;
xmax_threshold = 2000;
% Remove below min threshold
v(idx<xmin_threshold)=[];
idx(idx<xmin_threshold)=[];
% Remove above max threshold
v(idx>xmax_threshold)=[];
idx(idx>xmax_threshold)=[];
hold on
scatter(x(idx),v,"r","filled")

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBiomedical Imaging についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by