Coherence of two signals

조회 수: 17 (최근 30일)
Siddhartha Singh
Siddhartha Singh 2013년 1월 8일
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 .

채택된 답변

Teja Muppirala
Teja Muppirala 2013년 1월 8일
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
Teja Muppirala
Teja Muppirala 2013년 1월 8일
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.
Siddhartha Singh
Siddhartha Singh 2013년 1월 8일
again thanks for your visualization one more question i want to ask how you know starting point is 1792 and and why 4.5?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by