Coherence of two signals
17 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have two channel eeg data having length 1x8064 each. Sampling frequency of the data s 128 samples /sec. When I was applying "mscohere" command for magnitude square coherence then it gave 1025x1 matrix of values between 0 to 1. I am confused that how it gives 1025x1 value. According to help it divides both x and y in 8 equal length then it is 1008 samples . please any one who know the concept behind this help me .
0 Commenti
Risposta accettata
Teja Muppirala
il 8 Gen 2013
The coherence is a function of frequency, and in general it will not have the same number of elements as the original (split up) time domain signals.
If you have two signals:
>> x = rand(8064,1);
>> y = rand(8064,1);
Then if you call MSCOHERE with no specified input arguments,
>> C = mscohere(x,y);
this is the process that gives C 1025 elements:
Step 1. It splits x and y into 8 segments that overlap 50%.
Segment 1: x(1:1792)
Segment 2: x(897:2688)
Segment 3: x(1793:3584)
.
.
.
Segment 8: x(6273:8064)
You can see that because of the overlap, each segment is actually 8064/7 = 1792 samples long, not 8064/8 = 1008.
Step 2. It finds the next highest power of 2 as the length to use for the FFT. The next highest power of two after 1792 is 2048.
Step 3. When you take the FFT, the result is symmetric about the Nyquist frequency, so you really only need to keep half the result. This means, although the FFT length is 2048, the Nyquist frequency occurs at 2048/2+1, which is 1025. And so it is the coherence at these first 1025 frequency values that it is returning.
3 Commenti
Teja Muppirala
il 8 Gen 2013
Oops, sorry, I meant to say 8064/4.5 = 1792 . Anyways, what I mean by overlapping is the image below. You start off with 8064 samples, but you split it up into 8 total segments, such that each one overlaps with the next one by 50%. It looks like this:
|-------8064 samples-------|
1. |-----| <------- 1 to 1792
2. |-----| <------- 897 to 2688
3. |-----| <------- 1793 to 3584
4. |-----|
5. |-----|
6. |-----|
7. |-----|
8. |-----| <------- 6273 to 8064
You can see from this image, that each individual segment is 4.5 times shorter than the original segment. And 1792 = 8064/4.5.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su EEG/MEG/ECoG in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!