필터 지우기
필터 지우기

How can I calculate the cross power spectral density from fft data?

조회 수: 5 (최근 30일)
Ege Gurtan
Ege Gurtan 2019년 4월 19일
Hello, I need to calculate the cross power spectrum of two signals
I have calculated the fourrier transform of them by using the following formula. Could you help me to write a code to calculate and plot cross power spectrum?
X=DATA1;
xdft = fft(X(:,2));
% sampling interval -- assuming equal sampling
DT = X(2,1)-X(1,1);
% sampling frequency
Fs = 1/DT;
DF = Fs/size(X,1);
freq = 0:DF:Fs/2;
xdft = xdft(1:round(length(X)/2));
%plot(freq,abs(xdft))
Y=DATA2;
xdft2 = fft(Y(:,2));
% sampling interval -- assuming equal sampling
DT2 = Y(2,1)-Y(1,1);
% sampling frequency
Fs2 = 1/DT2;
DF2 = Fs2/size(Y,1);
freq2 = 0:DF2:Fs2/2;
xdft2 = xdft2(1:round(length(X)/2));
plot(freq,abs(xdft2))

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by