What does a wavelet coherence plot tell you?

1 min read

Can you find any pattern in the two signals, green and blue?

Two Time Series
Two Time Series

The blue signal is the brain wave (measured by NIRS) of a person when he is pressing some buttons (the timing of button pressing is shown in the vertical lines); the green signal is also brain wave but from a second person who is doing the same thing (button pressing). With naked eyes, it’s hard to see if there is any pattern in the signals in relation with each other, or with the button pressing. But wavelet coherence analysis tell you something.

Wavelet Coherence
Wavelet Coherence

In the above figure, I plot the wavelet coherence between the two signals in both time and frequency domain. Coherence is kind of correlation. 1 (red) means the two signals are highly correlated and 0 (blue) means no correlation. There are definitely something interesting between the two signals.

First, there is a red band in the period 8 region. As the sampling frequency of the signals is 10Hz, period 8 means 0.8s. This band is originated from heart beating (~1Hz) and indicates that the two people’s heart beating is highly correlated.

Second, there are some red blobs in the period 64 region. The button pressing is occurring at 6-7s frequency. These blobs indicate that the two people’s brain are correlated during button pressing.

So, with wavelet coherence analysis, you can discover something you might not discover with other methods.

Cross Wavelet and Wavelet Coherence Toolbox Note: this link is dead. To download the “Cross Wavelet and Wavelet Coherence Toolbox”, please enter

Other blog posts on wavelet analysis

PS: You may wonder why the two brain signals are correlated. In fact, the two people are doing a cooperative task. They have to press buttons at the same time to win a point. We at the same time measure their brain activity and find their brain is correlated during cooperation (but not during competition).

Check out our publication: Cui et al, NIRS-based hyperscanning reveals increased interpersonal coherence in superior frontal cortex during cooperation, NeuroImage, 2012

[update 2017-01-25] We contributed to MatLab (wavelet toolbox) https://www.alivelearn.net/?p=1957

第十九期 fNIRS Journal Club 通知 2021/05/29,9:30am

美国普渡大学童云杰助理教授,将为大家讲解他们组最近被接受的一篇使用近红外相位信息研究脑血流变化的文章。热烈欢迎大家参与讨论。 时间: 北京时间2021年5月29日上午9:30地点: https://zoom.com房间号: 846 8391 7517密码: 805190 童云杰教授简介:普渡大学 生物医学工程助理教授、博士生导师。主攻方向是多模态脑成像, 包括核磁,fNIRS, EEG。关注脑功能及生理信号的提取与研究。发表论文九十余篇,引用上千次(H-index = 20)。 童教授要讲解的文章如下: Liang Z, Tian H, Yang HC, Arimitsu T, Takahashi...
Xu Cui
12 sec read

第十八期 fNIRS Journal Club 视频

北京时间2021年4月25日10点,北京师范大学的朱朝喆教授为大家讲解了他们最近几年在经颅脑图谱(Transcranial brain Atlas) 方面做的工作。视频如下: Youtube: https://youtu.be/EhYPuBPQ5uI Youku: 该视频在优酷上传后被优酷屏蔽,不清楚什么原因。申诉无效。
Xu Cui
3 sec read


会议日期:2021年5月22日-24日会议地点:天津师范大学 一、 会议简介       近红外光谱脑功能成像(fNIRS)具有设备购买与使用成本低、可在自然环境条件下使用、具有较高的时间分辨率和空间定位能力等特点,受到了脑科学研究的高度重视。“近红外光谱脑功能成像学术会议”是由北京师范大学认知神经科学与学习国家重点实验室朱朝喆教授发起并组织的全国性学术会议。已连续成功举办六届,共吸引全国近百家高校、科研院所及医院的六百余名学者参加。该会议已成为国内规模和影响力最大的fNIRS脑成像学术活动。       本届会议由北京师范大学与天津师范大学联合主办。会议将延用往届会议将学术报告与研究方法工作坊相结合的模式。学术报告模块(5月22日周六)将邀请心理学与认知神经科学领域、基础与临床医学领域以及工程技术领域知名学者汇报其fNIRS最新研究成果;工作坊模块(5月23-24日)由fNIRS领域一线研究者系统讲授fNIRS成像原理、fNIRS实验设计、fNIRS数据分析与统计、fNIRS论文写作以及fNIRS前沿技术等。除理论讲授外,还设置了fNIRS空间定位与数据分析操作(NIRS-KIT软件)环节,此外还安排充足的研讨答疑时间以便与会人员交流互动。       具体日程与详细内容等最新消息请关注后续通知,可通过天津师范大学心理部网站http://psych.tjnu.edu.cn/或北京师范大学国家重点实验室网站http://brain.bnu.edu.cn/,或者扫描下方二维码关注微信公众号-“fNIRS脑成像实验室”查阅更新信息,期盼在天津师范大学与您相聚! 二、会议组织机构 主办单位:教育部人文社会科学重点研究基地天津师范大学心理与行为研究院、天津师范大学心理学部、北京师范大学认知神经科学与学习国家重点实验室会议主席:白学军、朱朝喆组织委员会:赵春健、杨邵峰、侯鑫、曹正操 三、说明1.        学术报告模块注册费:人民币500元/人;工作坊模块注册费:人民币2500元/人。发票为电子发票,内容均为:“会议费”。两个模块各自独立收费,参会者可根据自己需要进行选择。2.        注册费包括各自模块的资料费、午餐费;其他费用自理。3.        会议报告人免除会议模块注册费,其他费用请自理。4.       ...
Xu Cui
18 sec read

29 Replies to “What does a wavelet coherence plot tell you?”

  1. Dear Dr. Xu:

    Could you please tell me what tools you usually apply when you analyze the data from NIRS? I always get signals from which the pattern are usually hard to detect with bare eye. Also, when you consider the changes in signal, did you take the scattering coefficient changes into consideration?

    Hope to see your reply.


  2. @Zoe
    I usually write my own programs to analyze data. I used nirs-spm for a while and you may check it out.

    We do use scattering coefficient to calculate the change of hbo and hbr.

  3. Dear Dr. Xu:
    Thank you, I will check the SPM.
    Does that mean that you calculate the scattering coefficient in real time, and apply the real time optical property to calculate the HbO and Hbr level?
    And how do you usually consider the brain structure, do you consider it as several layers or you treat it as a homogeneous tissue?

    Thanks for your time!
    Best Regards

  4. @Zoe
    It’s called NIRS-SPM.

    No. For we calculate after we acquired the data. For real time experiment, the device we use (ETG4000) calculated the hbo hbr level automatically.

    We did not consider the structure of brain in the calculation.

  5. Can we classify normal ECG and abnormal ECG using wavelet coherence and cross correlation.

  6. Hi, Dr Cui
    What is coherence mean? I know it is a character of waves, which have the same frequency. But, when it comes to two persons, what’s that mean? And what could it tell us?

  7. Dear Dr. Xu

    My research is related to “Spatiotemporal groundwater level modeling using hybrid artificial intelligence-meshless method”

    i like to know what is the correlation between input time series data (rainfall, runoff and grounwater level lag time series) and output time series data (groundwater level).

    ANN input and output prediction:
    R(t-1) , R2(t-1), GL (t-1) —> Gl (t)

    What can use wavelet coherence?

  8. Dear Sir,

    can you please guide me how I can cut the cone of influence in WTC diagram and how I can limit my frequency scale upto 256

  9. Dear Dr. Xu,

    I wonder if you could share a small sample as .CVS file from one of your experiments. The reason I am asking for this is that the data I am using appears to have a different result when I plot the wavelet coherence. So I do not know if my database is wrong or not.

    I did an anti-correlation check between Hbo and Hbr and it appears to be OK with only 3 or 4 bad channels.

    I can share/email my figures if it is needed.

    Thanks for your help.

  10. Dear Dr. Cui,

    As you said, there are some red blobs in the period 64 region (i.e., about 6.4s). The button pressing is occurring at 6-7s frequency. These blobs indicate that the two people’s brain are correlated during button pressing.

    Since your task lasted about only 6 min, the peak MaxScale reached 1024 region. I used the same wtc method to analyze the data lasting 40 min (task:a long two-person talk),however the peak MaxScale reached 8192 region. My question is, whether the horizontal coordinate (i.e., Time) covaried with the vertical coordinate (i.e., Period)?

    Closely related, the inter-brain coherence in my 40-min talk mainly appears in the 256-1024 period. It is weird to focus such high period based on your rationale provided (i.e., 64period corresponds 6~7s button-pressing). Simply because I have not see such high period in existing fNIRS hyperscanning studies.

    I look forward to hearing you!

    Yafeng Pan

  11. Dear Dr. Xu
    感谢您分享的程序和使用心得体会。交叉小波和小波相干图谱里面的箭头有特定的含义,右箭头表示正相关,左箭头表示负相关,这个还能理解。但是上下箭头表示相位角提前或滞后90°,这是什么概念,具体表示什么含义呢,还请Dr. Xu帮忙解释一下.
    Thank you!

  12. 您好,我在理解matlab生成的wavelet coherence图的时候发生了困难,找到了您的博客。

    1.我很困惑的是生成了这样一个wavelet scale – frequency/period的矩阵,如何才能把它压缩成一个scalar来形容这两个timeseries的整体的相关性?就像相关系数那样?
    2.我有同一个人两个不同脑部ROI的fMRI的timeseries, 有80个timepoints, TR=720ms。那么对应timescale-period图中的某一个点,例如, 在time40秒处period20秒处的取值是0.999,表达了什么含义呢?是从0~40秒的范围内,20秒一个cycle的时间内,相关度很高的意思吗?

  13. @Xiang Xiao
    1. 可以把这个矩阵的数值平均成一个值。参考:http://www.alivelearn.net/?p=1518
    2. 说明在time 40s附近,这两个信号在1/20频率上有很高的相关度。

  14. @Xu Cui

    感谢回答!我也看了您哪一篇,您的意思是先过滤一部分必定相关的(例如period > 32 )然后再直接求平均吗?这样会不会损失了比较多的情报。

    另外再追问一下,https://cn.mathworks.com/help/wavelet/ref/wcoherence.html matlab2016b自带了Wavelet coherence的模块,但是计算Wavelet coherence矩阵的时候可以设置两个参数,一个是period,一个是frequency,也可以都不设置。例如我上面问您的那个例子里的fMRI的时间序列,应该怎么样设置period和frequency呢?比如frequecny是不是就是TR=720ms的倒数设置为1/0.72而period(interval)就设置为seconds(0.72),还是说不用设置?


  15. @Xiang Xiao

    matlab自带的wavelet coherence这个,我还不熟悉,因此不敢乱给建议。

    btw,matlab的wavelet package中用到的nirs数据是我们的数据:https://www.mathworks.com/help/wavelet/examples/compare-time-frequency-content-in-signals-with-wavelet-coherence.html

  16. 我想请问,wavelet coherence中关于significance level的计算问题,您论文中的significance level的计算方法跟A Grinsted工具箱中的一样吗?

  17. 非常感谢您的回答,我想问一个问题,当有多个试次时,如何计算这些试次的平均wavelet coherence?

  18. Dear Cui,

    Thank you for the complete explanation for the wavelet analysis. I am currently conducting an analysis using this method. You mention that coherency in wavelet representing the correlation between two (time-series) dataset. However, is there anyway to understand if the data were negatively or positively correlated?

Leave a Reply to Zoe Cancel reply

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