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