## Time-frequency spectral coherence analysis (desperate need of help)

Hinna Ahmed

### Hinna Ahmed (view profile)

さんによって質問されました 2019 年 10 月 21 日

### Hinna Ahmed (view profile)

さんによって コメントされました 2019 年 10 月 28 日
How is it possible in MATLAB to calculate Coherence as a function of time for two nonstationary signals (EEG) as shown on the below image. I want to genereate a similar one in matlab. Can someone please help me. I am very new to matlab so a code will help.
Below are the equations for coherence. I have read that a multitaper moving window can be used. For this application, a 300 ms multitaper moving window can be used in time steps of 10 ms. I dont know how to implent it in matlab.

#### 0 件のコメント

サインイン to comment.

## 2 件の回答

### Kaashyap Pappu (view profile)

Answer by Kaashyap Pappu

### Kaashyap Pappu (view profile)

on 24 Oct 2019

As has already been suggested by Daniel, the mscohere function can be used. If you are using a custom window, generate the vector for the coefficients of the window and provide the vector as the input for the “window” argument.
Hope this helps!

Hinna Ahmed

### Hinna Ahmed (view profile)

on 28 Oct 2019
i am new to matlab, so i am not sure that I understand your reply. mscohere dont have time as an output

サインイン to comment.

### Daniel M (view profile)

Answer by Daniel M

### Daniel M (view profile)

on 24 Oct 2019

Have you looked at the MATLAB function mscohere?
Otherwise, you could try looking into this function in the spm12 toolbox: spm_eeg_ft_multitaper_coherence, found at https://github.com/neurodebian/spm12/blob/master/toolbox/MEEGtools/spm_eeg_ft_multitaper_coherence.m

#### 0 件のコメント

サインイン to comment.

Translated by