|
楼主 |
发表于 2008-11-30 14:55
|
显示全部楼层
以下是这个问题的matlab代码:
clear;
clc;
fid4=fopen('input8(t).txt','r');
xx4=fscanf(fid4,'%f');
status=fclose(fid4);
fid5=fopen('input10(t).txt','r');
xx5=fscanf(fid5,'%f');
status=fclose(fid5);
sf=187.5; %采样频率
np=length(xx5);
t=1:1/sf:np/sf;
[S55,w]=periodogram(xx5,hamming(np),np,sf,'onesided');
[S44,w]=periodogram(xx4,hamming(np),np,sf,'onesided');
[S54,w]=cpsd(xx5,xx4,hamming(np),0,np,sf,'onesided');
S54=abs(S54);
C54 =sqrt(S54.^2./(S55.*S44));
% [C54,w] = mscohere(xx5,xx4,hamming(np),0,np,sf); |
|