surf 함수로 플롯하기 위해 스펙트럼 상관 함수를 구현하려고합니다. 필자가 읽은 논문에서 설명한대로 SCF의 아이디어를 이해한다고 생각하지만 Matlab에서 제 기능을 구현하는 데 문제가 있습니다. 나는이 지침에 따라 봤는데 :Matlab에서 신호의 FFT 이동
을 나는 대부분 제대로 데이터의 나의 조각을 이동하는 데 문제가 있습니다. 3 단계를 달성하는 쉬운 방법이 있습니까?
여기 내 코드에서 시도 내용은 다음과 같습니다
function [output] = spectral(x, N)
% This function does cyclostationary spectral analysis
% on a data set and returns some features
t = length(x);
samplesPerFrame = floor(t/N);
count = 1;
for alpha = -1:0.01:1
% Split up the samples into frames
% Have to leave some samples out if unevenly split
for i = 1:N+1
frange = ((i - 1) * samplesPerFrame + 1):(i * samplesPerFrame);
if i == N+1
break;
end
xFrame(i, :) = x(frange);
ts = [1:length(xFrame(i,:))];
shiftLeft = fft(xFrame(i, :) .* exp(-1 * 2 * pi * 1i * (alpha/2) .* ts));
shiftRight = fft(xFrame(i, :).* exp(2 * pi * 1i * (alpha/2) .* ts));
S(i,:) = (1/samplesPerFrame) .* shiftLeft .* conj(shiftRight);
end
Savg(count, :) = mean(S, 1);
Ssmooth(count, :) = smooth(Savg(count,:), 'moving');
count = count + 1;
end
output = Ssmooth;
end
어떤 문제가 있었습니까? 지금까지 뭐 해봤 어? 우리에게 세부 사항을주지 않으면 당신을 도울 방법을 알 수 없습니다. – MrAzzaman
좀 더 자세한 내용을 추가했습니다. 내 잘못이야. – Paul