本帖最后由 多多会迈特来布 于 2016-2-12 05:24 编辑
这是我遇到问题的代码:
[code]N=2^14; %Number of RecordsL=2^14;%Transform Length
SmoothingK=2^0;
fd=zeros(L,1); %Frequency division matrix
%Sampling Frequency
Fs=(N-1)/(Times(N,1)-Times(1,1));
%Find the resolution from the samplingfrequency
f=Fs/L;
%Auto spectal density for each probe
SP1=pwelch(P1,(L/SmoothingK),[],L)/(Fs/12.566);
SP2=pwelch(P2,(L/SmoothingK),[],L)/(Fs/12.566);
SP3=pwelch(P3,(L/SmoothingK),[],L)/(Fs/12.566);
%Generate cross spectral densities
CSD12=cpsd(P1,P2,(L/SmoothingK),[],L);
CSD13=cpsd(P1,P3,(L/SmoothingK),[],L);
PH11=zeros(L,1);
PH12=zeros(L,1);
PH13=zeros(L,1);
for i = 1:(L/2)
PH12(i,1)=atan2(imag(CSD12(i,1)),real(CSD12(i,1)));
PH13(i,1)=atan2(