%=====================================================================================
% Program functions:
% For the given structural vibration response data(time sequence signal),
% the program can decompose these response signal into multiple orders
% wavelet sub-signals, then calculate the energy spectum of the sub-signals.
%
% Data file preparation:
% Simulation data: save as the format "save 3mm_crack RS3mm" including file name
% and variable name
% Experimental data: (1)sampling data uing "Signal analyzer B&K 3557" are
% saved as "CVP" format flie
% (2) CVP file is edited using "Excel" and save as "TXT" file
% (3) TXT file is called using MATLAB software and save as
% " M" file
% (4) In matlab program, using special sentence call M data file,
% i.e., for example "x0=load('ad800t.m')"
%=====================================================================================
% to load the data files of structural vibration response
clear all
clc
format long e
load trans_nodamg_var2to5.txt
load res_dmg10perc.txt
%----------------------
time=trans_nodamg_var2to5(:,1);
l_time=size(time,1);
node_46_nodmg=trans_nodamg_var2to5(:,2);
node_46_dmg10perc=res_dmg10perc(:,2);
node_64_nodmg=trans_nodamg_var2to5(:,3);
node_64_dmg10perc=res_dmg10perc(:,3);
node_82_nodmg=trans_nodamg_var2to5(:,4);
node_82_dmg10perc=res_dmg10perc(:,4);
node_100_nodmg=trans_nodamg_var2to5(:,5);
node_100_dmg10perc=res_dmg10perc(:,5);
%-------------------------
%==================================
nn=length(time); %measure data length of structural response (all data files
% should have the same data length
%nn=1200; % One can select part data from a response signal to make wavelet analysis
%Put one group of damaged structual response data and one group of intact
%structural response data into two vectors "xx0 and xx1", so that one can compare
% differences between them using wavelet signal shape and energy spectrum
for i=1:nn
xx0(i)=node_100_nodmg(i);
xx1(i)=node_100_dmg10perc(i);
end
%==================================
%Using "plot(x,y)" function to draw the waveshapes of the response signals of
%intact and damage structures.
i=1:nn;
plot(i,xx0)
title(('Case 0: no damage'))
xlabel('time-')
ylabel('Response signal of the intact structure (mV)')
grid on
pause
close
i=1:nn;
plot(i,xx1)
title(('Case 1: damage 10%'))
xlabel('time-')
ylabel('Response signal of the damaged structure ')
grid on
pause
close
%=============================================
% Decompose two kinds of signals upto the LN layer of wavelet.
% First, one can get all wavelet coefficients using "wpdec";then we can
% recompose every sub-wavelet signals using these wavelet coefficients and "wprcoef"
% When a signal is decompsed to LN layer, one can get
%
s1=xx0; % response signal of non damage plate
s2=xx1; %response signal of damage plate
% To draw raw waveshape of the response signals of intact and damaged structures
subplot(11,2,1);
plot(s1);
title('Intact structure')
axis off
ylabel('raw signal')
subplot(11,2,2);
plot(s2);
title('Damaged structure 10%')
axis off
%===============================================================
% Decompose intact structural response signal to the LN layer of wavelet using wavelet package
% for the LN layer wavelet, we can get the 2**LN sub-wavelet signals
%
LN=5;
SUB_W_LN=2.^LN
t=wpdec(s1,LN,'db1','shannon'); %one-dimension wavelet decomposition
%---------------------------------
for i=1:SUB_W_LN
gsi=wprcoef(t,[LN,i-1]); % wavelet reconstruction
for j=1:nn
gs(i,j)=gsi(j);% Matrix "gs" containing the SUB_W_LN sub-wavelet signals of
% the intact structure.
end
end
%===============================================================
% Decompose damaged structural response signal to the LN layer of wavelet using wavelet package
% for the LN layer wavelet, we can get the 2**LN sub-wavelet signals
%
t=wpdec(s2,LN,'db1','shannon');%wavelet decomposition
%----------------------------
for i=1:SUB_W_LN
dsi=wprcoef(t,[LN,i-1]);% wavelet reconstruction
for j=1:nn
ds(i,j)=dsi(j);% Matrix "ds" containing the SUB_W_LN sub-wavelet signals of
% the damaged structure.
end
end
%===============================================================
% To draw the first 10 orders sub-wavelet signals of the intact structure
for i=1:10
subplot(11,2,2*i+1);
plot(gs(i,:));
axis off
end
%------------------------------------------------------
%To draw the first 10 orders sub-wavelet signals of the damaged structure
for i=1:10
subplot(11,2,2*i+2);
plot(ds(i,:));
axis off
end
pause
close
%===================================================================
% To calculate the energy spectrum of the sub-wavelet signals
%--------------------------------------------------------
for i=1:SUB_W_LN
for j=1:nn
si(j)=gs(i,j);
end
goodnorm(i)=norm(si); %the energy spectrum of the response signal of the intact structure
end
%----------------------
for i=1:SUB_W_LN
for j=1:nn
di(j)=ds(i,j);
end
badnorm(i)=norm(di);%the energy spectrum of the response signal of the damaged structure
end
%======================================================
% To calculate the variation percent of every wavelet-order energy spectrum between
% the intact and damaged structures
for i=1:SUB_W_LN
dr(i)=100*(goodnorm(i)-badnorm(i))/goodnorm(i);%the variation percent
end
%======================================================
% to display the energy spectrum valuse
for i=1:SUB_W_LN
result(i,1)=i;
result(i,2)=goodnorm(i);
result(i,3)=badnorm(i);
result(i,4)=dr(i);
end
format short e
result;
MAXESV=max(abs(dr));
bar(dr,'group');
title(('Structural damage index'))
xlabel('wavelet orders')
ylabel('variation percent of wavelet energy spectrum (%)')
axis([0 SUB_W_LN -1.5*MAXESV 1.5*MAXESV])
grid on
pause
close
评论0