mscohere function
조회 수: 25 (최근 30일)
이전 댓글 표시
I'm using mscohere to calculate the coherence between two signals x, y. using the following formula: mscohere(x,y,window,overlap,nfft,sampling frequency)
1- I have the following questions: nfft doesn't permit to specify frequencies of interest i.e 1:1:50 Hz. Is there anyway to specify the frequencies of interest. When i use a frequency vector i receive an error message. 2- When i try to use the same function to analyze the coherence among 54 different signals (54 X 54 / 2 ) times. The processing time is considerably slow. Are there any tips or suggestions to make it faster. 3- Any suggestions for the ideal overlap and window duration ?
Thanks,
댓글 수: 0
채택된 답변
Wayne King
2012년 3월 24일
Hi Raf, You can't specify the frequencies of interest as an input argument, but you can easily extract the mean-square coherence values for the frequencies you want. This of course implies that you have chosen your input parameters to ensure that the spacing between DFT bins is sufficient.
t = 0:0.001:1-0.001;
x = cos(2*pi*10*t)+0.25*sin(2*pi*40*t)+randn(size(t));
y = cos(2*pi*10*t-pi/4)+0.15*sin(2*pi*40*t-pi/2)+randn(size(t));
[Cxy,F] = mscohere(x,y,250,200,250,1000);
plot(F,Cxy)
In the above, I've chosen a segment length of 250, that gives me a frequency resolution of Fs/250 or 4 Hz. You can see this by looking at
diff(F)
If you really want a resolution of 1 Hz, then you have to choose your window length accordingly.
The overlap is trickier to give specific rules for. The larger the overlap, the more computation, but the more averaged the result (less bias)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spectral Measurements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!