MATLAB Answers

mscohere for each frequency band_EEG data

21 views (last 30 days)
belen calvo
belen calvo on 15 Jan 2021
Commented: Star Strider on 16 Jan 2021
Hi all,
I'am working with the following code to get coherence values. I get some values but how can I get the measure for each frequency band? I tried to define F as F=[8.05.13] for alpha and F= [1.0.5.4] for delta. However, I get exactly the same values for alpha and delta. Any help would be greatly appreciated.
ch1= 7 % left electrode
ch2= 48 % right electrode
window = 2*EEG.srate;
nooverlap = 0;
nfft =window*2;
fs= EEG.srate;
F= [8.05.13]% change this for different bands
[Cxy, F] = mscohere (EEG.data(ch1,;),(EEG.data(ch2,;)window, nooverlap,nftt,fs);

  5 Comments

Show 2 older comments
Star Strider
Star Strider on 16 Jan 2021
No worries!
MATLAB function arguments must be entered in the order described in the documentation. If you do not want to specify an argument (that is, use the default value in the function), enter that argument as empty square brackets [], although only some arguments may be defined as appearing together. That is the situation with mscohere. So to use ‘F’, it will be necessary to use this set of arguments, again in the order required (quoting from the documentation):
[cxy,f] = mscohere(x,y,window,noverlap,f,fs) returns the magnitude-squared coherence estimate at the frequencies specified in f.
Note that here ‘nfft’ is not an accepted argument in this context. The only option is to use those listed, if you want to use ‘F’.
(I have rarely used mscohere, so my experience with it is limited.)
belen calvo
belen calvo on 16 Jan 2021
THANKS! yes, now I get different coherence values for each band. The only problem now is that I only get as output two values-I guess one for 8 and another one for 13 in F= [8 13]. I would like to get all the coherence values in the range going from 8 to 13 in that band (e.g. alpha). I tried F= [8:13] and it returns 6 values..not sure I'm picking what I want though. I'm gonna keep on reading about mscohere and papers that have used this function.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!