spectral coherence between several time series

조회 수: 5 (최근 30일)
Richard
Richard 2012년 7월 30일
I need some advice regarding the spectral coherence of several signals. Consider the following example:
t = 1:365;
A = 1;
f = 24;
fs = 1/f;
y = A.*sin(2.*pi.*fs.*t);
Data = y + rand(1,length(t));
depth = 1:9;
for i = 1:10;
data(i,:) = Data+rand(1,length(t));
% spectral analysis
[Pxx(i,:),F(i,:)] = periodogram(data(i,:),rectwin(length(data(i,:))),length(data(i,:)),1);
end
figure(1);
subplot(2,1,1);
plot(F(1,:),10.*log10(Pxx(1,:)));
subplot(2,1,2);
pcolor(F(2:end,:),depth,Pxx(2:end,:));shading interp;axis ij
This example shows the spectra for air temperature as subplot(211) and then the spectra for the temperature at each depth in a water column in subplot(212). However, I would like to calculate the coherence in the spectra (if this makes sense), showing that the coherence between air temperature and water temperature decreases with depth in the water column. Can anyone suggest a method for this? Or any advice on this matter.

채택된 답변

Wayne King
Wayne King 2012년 7월 30일
I'll assume you really want to add Gaussian noise and not uniform noise to the data.
y = A.*sin(2*pi*1/T*t);
Data1 = y + randn(1,length(t));
Data2 = y+randn(1,length(t));
[Cxy,W] = mscohere(Data1,Data2,hamming(96),48,96,1);
plot(W,Cxy);

추가 답변 (1개)

Wayne King
Wayne King 2012년 7월 30일
You want to use mscohere.m to compute the magnitude squared coherence between two time series
  댓글 수: 1
Richard
Richard 2012년 7월 30일
could you provide an example of the most appropriate way of using mscohere for the example shown?

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

카테고리

Help CenterFile Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by