Main Content

FFT를 사용하여 주기적 데이터 분석하기

푸리에 변환을 사용하여 일정 기간 동안의 자연 현상 같은 데이터의 변화를 분석할 수 있습니다.

천문학자들은 거의 300년 동안 취리히 흑점 상대 수(Zurich Sunspot Relative Number)를 사용하여 태양 흑점의 개수와 크기를 표로 만들어 왔습니다. 대략 1,700년대부터 2,000년대까지의 취리히 수를 플로팅해 보겠습니다.

load sunspot.dat
year = sunspot(:,1);
relNums = sunspot(:,2);
plot(year,relNums)
xlabel('Year')
ylabel('Zurich Number')
title('Sunspot Data')

Figure contains an axes object. The axes object with title Sunspot Data, xlabel Year, ylabel Zurich Number contains an object of type line.

태양 흑점 활동의 주기적 특성을 자세히 살펴보려면 처음 50년간의 데이터를 플로팅하십시오.

plot(year(1:50),relNums(1:50),'b.-');
xlabel('Year')
ylabel('Zurich Number')
title('Sunspot Data')

Figure contains an axes object. The axes object with title Sunspot Data, xlabel Year, ylabel Zurich Number contains an object of type line.

푸리에 변환은 신호 처리의 기본 방법으로, 데이터에서 주파수 성분을 식별해 냅니다. fft 함수를 사용하여 취리히 데이터에 푸리에 변환을 수행합니다. 출력값의 첫 번째 요소에 데이터의 합이 저장되어 있는데, 이 요소를 제거합니다. 실수축에 대한 복소 푸리에 계수의 대칭 이미지가 포함된 나머지 요소들을 플로팅합니다.

y = fft(relNums);
y(1) = [];
plot(y,'ro')
xlabel('real(y)')
ylabel('imag(y)')
title('Fourier Coefficients')

Figure contains an axes object. The axes object with title Fourier Coefficients, xlabel real(y), ylabel imag(y) contains a line object which displays its values using only markers.

푸리에 계수만으로는 해석이 힘듭니다. 더 의미 있는 계수의 측정값은 크기를 제곱한 것으로, 전력을 측정한 값입니다. 크기에서 계수의 절반이 반복되므로 절반에 대한 전력만 계산해야 합니다. 파워 스펙트럼(Power Spectrum)을 Cycles/Year를 측정 단위로 취하는 주파수의 함수로 플로팅합니다.

n = length(y);
power = abs(y(1:floor(n/2))).^2; % power of first half of transform data
maxfreq = 1/2;                   % maximum frequency
freq = (1:n/2)/(n/2)*maxfreq;    % equally spaced frequency grid
plot(freq,power)
xlabel('Cycles/Year')
ylabel('Power')

Figure contains an axes object. The axes object with xlabel Cycles/Year, ylabel Power contains an object of type line.

최대 태양 흑점 활동이 1년에 1회 미만의 빈도로 나타납니다. 주기적 활동을 시각적으로 더 쉽게 해석하려면 Years/Cycle을 측정 단위로 취하는 주기 함수로 전력을 플로팅하십시오. 플롯에서 태양 흑점 활동이 약 11년마다 한 번씩 최대치에 도달하는 것을 알 수 있습니다.

period = 1./freq;
plot(period,power);
xlim([0 50]); %zoom in on max power
xlabel('Years/Cycle')
ylabel('Power')

Figure contains an axes object. The axes object with xlabel Years/Cycle, ylabel Power contains an object of type line.

참고 항목

| |

관련 항목