I understand that you are trying to compare the modal analysis data of a plate with and without crack using MATLAB’s “Wavelet” Toolbox.
When working with such signals, a direct comparison in the time domain may not highlight the differences effectively. So, you can use time-frequency analysis (Continuous Wavelet Transform) and wavelet coherence, which will provide you a clearer comparison of the two datasets.
Please refer to the following example code that shows how to use CWT, wavelet coherence, and DWT-based energy comparison:
% Example code for comparing plate vibration data with and without crack
% Replace with your actual signals
load plate_data.mat % Suppose you have 'signal_no_crack' and 'signal_crack'
fs = 1000; % Sampling frequency (Hz) - update as per your data
% Continuous Wavelet Transform
figure;
subplot(2,1,1);
cwt(signal_no_crack,'amor',fs);
title('CWT of Plate Without Crack');
subplot(2,1,2);
cwt(signal_crack,'amor',fs);
title('CWT of Plate With Crack');
% Wavelet Coherence
figure;
wcoherence(signal_no_crack, signal_crack, fs);
title('Wavelet Coherence Between Healthy and Cracked Plate');
% Energy Distribution using Discrete Wavelet Transform
wname = 'db4'; % Daubechies wavelet
level = 5;
[C1,L1] = wavedec(signal_no_crack, level, wname);
[C2,L2] = wavedec(signal_crack, level, wname);
E1 = zeros(1,level);
E2 = zeros(1,level);
for i = 1:level
D1 = detcoef(C1,L1,i);
D2 = detcoef(C2,L2,i);
E1(i) = sum(D1.^2);
E2(i) = sum(D2.^2);
end
figure;
bar([E1' E2']);
xlabel('Decomposition Level');
ylabel('Energy');
legend('Without Crack','With Crack');
title('Energy Distribution at Different Wavelet Levels');
Here, we are doing the following:
- We use "CWT" to visualize differences in time-frequency patterns.
- Apply wavelet coherence to compare correlation between healthy and cracked signals.
- And finally, we compute energy distribution across wavelet levels to quantify changes caused by the crack.
For further reference, please check the following official MATLAB documentations:
- “cwt”: https://www.mathworks.com/help/wavelet/ref/cwt.html
- “wcoherence”: https://www.mathworks.com/help/wavelet/ref/wcoherence.html
- “wavedec”: https://www.mathworks.com/help/wavelet/ref/wavedec.html
Cheers & Happy Coding!
