wavelet coherence significance test
3 views (last 30 days)
Show older comments
I am using wcoherence to get the wavelet coherence of two signals.
how can i evaluate the significance (eg. 95%) ??
1 Comment
Answers (1)
Prasanna
on 4 Nov 2024
Hi yx,
To evaluate the significance of wavelet coherence when using the ‘wcoherence’ function in MATLAB, refer the following:
- First, compute the wavelet coherence between your two signals using the ‘wcoherence’ function.
- Create surrogate data to estimate the significance level. Surrogate data can be generated by randomizing one of the signals while preserving its power spectrum.
- Calculate the wavelet coherence for each surrogate dataset.
- Use the distribution of coherence values from the surrogate data to determine the significance threshold (e.g., the 95th percentile).
A sample MATLAB code to evaluate is as below assuming two example random signals:
% Example signals
x = randn(1, 1000);
y = randn(1, 1000);
% Compute wavelet coherence
[wcoh, ~, ~, ~] = wcoherence(x, y);
% Number of surrogates
numSurrogates = 1000;
surrogateCoherence = zeros(size(wcoh, 1), size(wcoh, 2), numSurrogates);
% Generate surrogate data and compute coherence
for i = 1:numSurrogates
ySurrogate = y(randperm(length(y))); % Randomize y
[wcohSurrogate, ~, ~, ~] = wcoherence(x, ySurrogate);
surrogateCoherence(:, :, i) = wcohSurrogate;
end
% Determine the 95th percentile threshold
significanceThreshold = prctile(surrogateCoherence, 95, 3);
% Plot the wavelet coherence and significance threshold
figure;
subplot(2, 1, 1);
imagesc(wcoh);
title('Wavelet Coherence');
colorbar;
subplot(2, 1, 2);
imagesc(significanceThreshold);
title('95% Significance Threshold');
colorbar;
The output of the above sample code is as follows:
The surrogate data is generated by randomizing one of the signals. This helps in creating a distribution of coherence values under the null hypothesis. For more information regarding the functions used, refer the following documentations:
- wcoherence: https://www.mathworks.com/help/wavelet/ref/wcoherence.html
- prctile: https://www.mathworks.com/help/matlab/ref/prctile.html
0 Comments
See Also
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!