correlation of original signal with compressed this with wavelet analysis

5 views (last 30 days)
dear all, I have a signal matrix with 1080 samples, 1401 variables, which I compressed its size to 1080*352 using multisignal analysis 1-D(wavelet analyser) , now I want to know what is the correlation coefficient matrix between the two matrices?

Answers (1)

Harsh
Harsh on 24 Jul 2025
Edited: Harsh on 24 Jul 2025
A direct correlation matrix between your original (1080x1401) and compressed (1080x352) matrices isn't possible because they have a different number of columns (variables). The compressed variables are fundamentally different from the original ones.
The standard approach is a two-step process: first, you reconstruct the signal from your compressed wavelet coefficients, and then you can compare this reconstructed signal to your original one.
1. Reconstruct the Signal
Since you used a multisignal 1-D analysis, the corresponding function for reconstruction is "mdwtrec". This function is specifically designed to take the decomposition structure you created and rebuild the original matrix of signals from it. You can find more information and a complete example in the official documentation for Multisignal 1-D wavelet reconstruction -www.mathworks.com/help/wavelet/ref/mdwtrec.html.
% 'dec' is the decomposition structure from your wavelet analysis
reconstructed_matrix = mdwtrec(dec);
This new "reconstructed_matrix" will have the exact same dimensions as your original one (1080x1401), allowing for a direct comparison.
2. Calculate the Correlation Coefficient
Now that you have the original and reconstructed matrices, you can calculate the correlation for each variable (column) to see how well it was preserved. You can do this by looping through each column and using the "corrcoef" function. Please refer to the following documentation: www.mathworks.com/help/matlab/ref/corrcoef.html.
% 'original_matrix' and 'reconstructed_matrix' are both 1080x1401
num_variables = size(original_matrix, 2);
correlation_per_variable = zeros(1, num_variables);
for i = 1:num_variables
% Calculate the correlation coefficient for each corresponding column
temp_corr = corrcoef(original_matrix(:, i), reconstructed_matrix(:, i));
correlation_per_variable(i) = temp_corr(1, 2);
end
disp('Correlation for each variable:');
disp(correlation_per_variable);
This will give you a vector of 1401 correlation coefficients, providing a clear measure of how well each of your original signals was represented after compression and reconstruction.

Categories

Find more on Wavelet Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!