Wavelet Coherence

1 min read

Wavelet transform coherence (WTC) is a method for analyzing the coherence and phase lag between two time series as a function of both time and frequency (Chang and Glover 2010). Here I played with it using the MatLab toolbox provided by Grinsted et al.

In the following examples, I created two time series, x (blue) and y (red) with different properties (phase shift, frequency and amplitude) and run wtc(x,y,’mcc’,0) command. Small white noise was added to the time series.

1. Phase shift and angle. A rightward arrow indicates 0 lag; a bottom-right arrow indicates a small lead of x; a leftward arrow indicates x and y is anti-correlated.

Phase
Phase

2. Frequency. At what frequency (or period) are x and y correlated?

frequency
frequency

3. Amplitude. It seems amplitude doesn’t matter much.

amplitude
amplitude

Toolbox can be found:
http://www.pol.ac.uk/home/research/waveletcoherence/
Note: this link is dead. To download the “Cross Wavelet and Wavelet Coherence Toolbox”, please enter
https://www.alivelearn.net/?p=1561

MatLab source code:

t =[1:1000]/10;

%% effect of phase
x = sin(t) + randn(size(t))/5;
y = [sin(t(1:250)) sin(t(251:500)-pi/4) sin(t(501:750)-pi/2) sin(t(751:end)-pi)] + randn(size(t))/5;

figure('color','w');
subplot(2,1,1);
wtc(x,y,'mcc',0)
subplot(2,1,2);
plot(x);
hold on;
plot(y,'r')

%% effect of frequency
x = [sin(2*t(1:250)) sin(2*t(251:500)) sin(4*t(501:750)) sin(8*t(751:end))] + randn(size(t))/5;
y = [sin(2*t(1:250)) sin(2*t(251:500)) sin(4*t(501:750)) sin(8*t(751:end))] + randn(size(t))/5;

figure('color','w');
subplot(2,1,1);
wtc(x,y,'mcc',0)
subplot(2,1,2);
plot(x);
hold on;
plot(y,'r')

%% effect of amplitude
x = [sin(2*t(1:250)) sin(2*t(251:500)) sin(4*t(501:750)) sin(8*t(751:end))] + randn(size(t))/5;
y = [sin(2*t(1:250)) sin(2*t(251:500))/2 sin(4*t(501:750))/3 sin(8*t(751:end))/4] + randn(size(t))/5;

figure('color','w');
subplot(2,1,1);
wtc(x,y,'mcc',0)
subplot(2,1,2);
plot(x);
hold on;
plot(y,'r')


Receive email notification via email 博客有新内容通知我
文献鸟,永远不错过新文献!

Don't want to miss new papers in your field? Check out Stork we developed:


第二十四期 fNIRS Journal Club 通知 2021/10/23,10:00am

来自韩国釜山国立大学Keum-Shik Hong教授团队的杨大林同学将为大家介绍如何结合深度学习和近红外扫描技术实现早期老年痴呆症的识别,并分享深度学习技术在相关方面的应用经验。热烈欢迎大家参与讨论。 时间: 北京时间2021年10月23日上午10:00地点: https://zoom.com房间号: 876 7722 5723 密码: 600106 杨大林要讲解的文章如下: Yang, D., Huang, R., Yoo, S.-H., Shin, M.-J., Yoon, J.-A., Shin, Y.-Il., Hong,...
Xu Cui
10 sec read

第二十三期 fNIRS Journal Club 视频

北京时间2021年9月25日10:00,上海师范大学的张明明博士为大家介绍团体 (三人或者之上) 超扫描领域的进展,以及他们最近发表的超扫描决策行为的文献。 https://www.storkapp.me/pubpaper/34335212 Youtube: https://youtu.be/aWkdYn1q3Jk Youku 优酷:https://v.youku.com/v_show/id_XNTgwOTEwOTE1Mg==.html 相关资源: 文献鸟(追踪科学文献)文献大分析(两分钟了解一个领域)
Xu Cui
6 sec read

第二十三期 fNIRS Journal Club 通知 2021/09/25,10:00am

上海师范大学的张明明博士将为大家介绍团体 (三人或者之上) 超扫描领域的进展,以及他们最近发表的团体超扫描决策行为的文献。热烈欢迎大家参与讨论。 时间: 北京时间2021年9月25日上午10:00地点: https://zoom.com房间号: 894 6339 2399 密码: 264149 张博士要讲解的文章如下: Zhang, Jia, Wang (2021) Interbrain Synchrony of Team Collaborative Decision-Making: An fNIRS...
Xu Cui
9 sec read

18 Replies to “Wavelet Coherence”

  1. Respected Sir,
    I need an help from you.I have a doubt in wavelet coherence using matlab.i have two series of length 80.how should i write the code in matlab so that i will get the wavelet coherence of two time series is a single value?

  2. The ‘v6’ argument to COLORBAR is
    deprecated, and will no longer be supported in a
    future release.

  3. How to compute cross wavelet or wavelet coherence for time series having same sampling rate but different lengths?

  4. Respect Sir. I have some questions below and look forward to receive your answer:
    1. [rsv,period] = wtc(x,y,’mcc’,0); In my experiment, x,y have a length of 90 seconds(sampling rate equals to 12). But the minimum frequency of 1/(period/sampling rate) I calculate is around 0.03Hz, instead of 1/90 Hz. Is the result wrong? Does this mean if i want to reach the minimum of 0.01Hz, I need a longer data(more than 90 seconds)?
    2. [rsv,period] = wtc(x,y,’mcc’,0); The frequency sequence i got based on 1/(period/sampling rate) is not distributed uniformly. It’s not convenient to segment frequency range for further analysis. How to solve this problem?

  5. I have a question. What is the meaning of axis y (period)? I don’t understand, why chose 4-128? Can you explain a little bit about this?

Leave a Reply

Your email address will not be published. Required fields are marked *