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);endfigure(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.
Best Answer