I have managed to plot 2 different plots as shown in the below figures.
In this figure, I have added 2 types of data. The yellow corresponds to a reference undamaged specimen, indicated by the presence of the peaks between 10 and 12 (is called backwall echo). The one in red is indicating presence of damage because of the absense of backwall echo and the increased amplitude between 3 and 8.
In this figure the tested specimen has no damage as there is presence of backwall echo.
I'm ot able to figure out a method to categorize and identify the presence of backwall echo from a given data. Please suggest me some methods so that my output correctly determines if there is damage or not (presence of backwall echo or not).
Thanks in Advance.

 채택된 답변

Mathieu NOE
Mathieu NOE 2022년 8월 23일
편집: Mathieu NOE 2022년 8월 23일

1 개 추천

hello
I have reworked your code
check this :
%% Plot of Undamaged Specimen
% na=readmatrix('Default Dataset (4).csv');
% na=readmatrix('Default Dataset (3).csv');
na=readmatrix('Default Dataset (5).csv');
%time
x= na(:,1);
%amplitude
y=na(:,2);
t=0:0.006:12;
D=interp1(x,y,t);
% plot (x,y,t,D);
plot (t,D);
% [v,idx]=findpeaks(D,MinPeakProminence=0.5);
[v,idx]=findpeaks(D,'MinPeakProminence',0.25);
y_threshold = 10;
idx(v>y_threshold)=[];
v(v>y_threshold)=[];
x_threshold=500;
v(idx<x_threshold)=[];
idx(idx<x_threshold)=[];
hold on
scatter(x(idx),v,"y","filled")
%% Plot of Damaged Specimen
nb=readmatrix('Default Dataset (6).csv');
x1= nb(:,1);
y1=nb(:,2);
E=interp1(x1,y1,t); % no need to use u instead of t
hold on
plot (t,E);
% [w,idx]=findpeaks(E,MinPeakProminence=0.5);
[w,idy]=findpeaks(E,'MinPeakProminence',0.25);
y_threshold = 10;
idy(w>y_threshold)=[];
w(w>y_threshold)=[];
x_threshold=500;
w(idy<x_threshold)=[];
idy(idy<x_threshold)=[];
scatter(x(idy),w,"r","filled")
legend('Undamaged Specimen','Peaks of Undamaged Specimen','Tested Specimen','Peaks of Tested Specimen');
hold off
%% Detecting peaks
% Thresholds
xmin_threshold = 10 ;
xmax_threshold = 12 ;
% Remove below min threshold
v(t(idx)<xmin_threshold )=[];
idx(t(idx)<xmin_threshold )=[];
w(t(idy)<xmin_threshold )=[];
idy(t(idy)<xmin_threshold )=[];
% Remove above max threshold
v(t(idx)>xmax_threshold )=[];
idx(t(idx)>xmax_threshold)=[];
w(t(idy)>xmax_threshold )=[];
idy(t(idy)>xmax_threshold)=[];
n=numel(v); % <= here
m=numel(w); % <= here
% if (n>m)
% disp('The specimen is showing characteristics of damage at this site.');
% else
% disp('The specimen is showing no characteristics of damage at this site.');
% end
%% simpler alternative : if m>0 the tested specimen is OK (whatever the n value is)
if (m>0)
disp('The specimen is showing no characteristics of damage at this site.');
else
disp('The specimen is showing characteristics of damage at this site.');
end

댓글 수: 3

Shruthimol
Shruthimol 2022년 8월 23일
Thank you so much Mathieu, It works perfectly. I cannot thank you enough for your help.
Shruthimol
Shruthimol 2022년 8월 23일
And I was able to understand the change as well. I'm a beginner and it made so much sense now that i read your comments along with the code.
Mathieu NOE
Mathieu NOE 2022년 8월 23일
My pleasure !
Glad you could recognize where I did the mods , as I was a bit lazy on the comments today !
all the best !

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Measurements and Feature Extraction에 대해 자세히 알아보기

질문:

2022년 8월 22일

댓글:

2022년 8월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by