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')

第十二期 fNIRS Journal Club 视频

在2020/9/26日, 华东师范大学李先春教授和他的学生陈美为大家讲解他们今年发表的一篇用近红外超扫描揭示欺骗行为神经机制的文章。视频如下: Youtube:https://www.youtube.com/watch?v=Qyn1vqUetiQYouku:https://v.youku.com/v_show/id_XNDg3ODkxOTA0MA==.html
Xu Cui
6 sec read

第十三期 fNIRS Journal Club 通知 2020/10/24,10am

北京时间2020年10月24日周六上午10点, 华东师范大学青少年健康评价与运动干预教育部重点实验室、华东师范大学体育与健康学院李琳教授将为大家讲解她们今年发表的一篇用近红外超扫描揭示团体体育运动(篮球)增强合作行为的文章。欢迎大家参加并参与讨论。 时间: 北京时间2020年10月24日周六上午10点地点: https://zoom.com房间号: 865 4354 8112密码: 497127 她要讲解的文献如下: Li, Wang, Luo, Zhang, Zhang, Li (2020) Interpersonal Neural Synchronization During Cooperative Behavior of...
Xu Cui
43 sec read

第十二期 fNIRS Journal Club 通知 2020/9/26,10am

北京时间2020年9月26日周六上午10点, 华东师范大学李先春教授将为大家讲解他们刚刚发表在 Human brain mapping 的一篇用近红外超扫描揭示欺骗行为的男女差别的文章。欢迎大家参加并参与讨论。 时间: 北京时间2020年9月26日周六上午10点地点: https://zoom.com房间号: 841 2136 8036密码: 603763 他要讲解的文献如下: Chen, Zhang, Zhang, Wang, Yin, Li, Liu, Liu, Li (2020)...
Xu Cui
1 min read

17 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 *