# Harmonic analysis of time series

조회 수: 1 (최근 30일)
edward kabanyas 2019년 9월 8일
Hi all,
I want to make harmonic analysis for my time series data to see first (diurnal) and second harmonic (semi diurnal variation). I simply tried the following code:
xxx = 0:1:23;
asc = Hour';
dec = xxx';
%FFT
d = fft(dec);
m = length(dec);
M = 3;
a0 = d(1)/m;
an = 2*real(d(2:M))/m;
bn = -2*imag(d(2:M))/m;
n = 1:length(an);
y1 = a0 + 0*cos(2*pi*1*x/23)+0*sin(2*pi*1*x/23);
y2 = a0 + an(1)*cos(2*pi*n(1)*x/23)+bn(1)*sin(2*pi*n(1)*x/23);
y3 = a0 + an(2)*cos(2*pi*n(2)*x/23)+bn(2)*sin(2*pi*n(2)*x/23);
y4 = a0 + an*cos(2*pi*n'*x/23) ...
+ bn*sin(2*pi*n'*x/23);
It seems ok, howewer in Statistical Methods in the Atmospheric Sciences book, the author use another method:
I want to make harmonic analysis using this equation and compare with the above code. Are there any body having experience with this question in Matlab?
Thank you for sharing.
Edward

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Fast Fourier Transforms에 대해 자세히 알아보기

### Community Treasure Hunt

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

Start Hunting!

Translated by