# Overlap in the mscohere function

3 ビュー (過去 30 日間)
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 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.
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 2017 年 9 月 8 日
This is a very well explained answer. Thanks Axel.

サインインしてコメントする。

### カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

### Community Treasure Hunt

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

Start Hunting!

Translated by