Overlap in the mscohere function

조회 수: 5 (최근 30일)
Eric
Eric 2015년 5월 24일
댓글: baba 2017년 9월 8일
Hi everybody,
I'm calculating the magnitude-squared coherence for signals like:
[Cxy,F] = mscohere(xdata,ydata,[],noverlap,[],samp_rate);
With the window size being the entire length of the data [] (one second here), f as default and sampling rate at 200 (same as data). However, even though the window size is the same length as the data I can change the result by inserting different values in 'noverlap'.
How can that be? Does it make sense to use 50% overlap when the window size is the same as data length?
Best,
Eric
  댓글 수: 2
Edinburgh
Edinburgh 2015년 8월 13일
Hallo Eric, You probably had an answer for your question but I will give you my suggestion anyway. It might help someone else in the future :).
First, taking the window size equal to the length of your data is wrong. In fact, the window size is a function of your sample frequency, and the frequency you want to resolve while using the function mscohere. Let's say the data is collected at 50 Hz and you want to resolve the coherence between two time series at 0.5 Hz, then you will need a window length = 50/0.5 = 100 samples. In practice, it is ALWAYS better to multiplied this value by 4 or 5 so to be sure that the desired frequency falls within the frequency bin. Therefore, your window length = 400 or 500.
Now, concerning the noverlap question. Depending on how noisy is your signal, increasing the noverlap size will decrease the noise variance. If your signal is a clean one, perhaps an overlap = 0 or 10% would not change anything. I suggest, you play with the noverlap to see which value corresponds best in your case.
Taking your example,
for noverlap = [0 0.1 0.2 0.3 0.4 0.5 0.6 0.9]*window_size
mscohere(xdata,ydata,[],noverlap,window_size,samp_rate);
end
I hope this help.
Best regards, Axel
baba
baba 2017년 9월 8일
This is a very well explained answer. Thanks Axel.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by