analyse time series in frequency domain with spectral analysis
I have the following data:
286.6388889 1.026681635
286.6458333 1.016358286
286.6527778 1.009417537
286.6597222 1.028687388
286.6666667 1.028510939
286.6736111 0.94883809
286.6805556 0.846286541
286.6875 0.739437891
286.6944444 0.768898142
286.7013889 0.808513793
286.7083333 0.908196144
286.7152778 0.947781995
286.7222222 0.978898446
286.7291667 0.993943797
286.7361111 1.019133248
286.7430556 1.077287098
286.75 1.127817549
286.7569444 1.1580582
286.7638889 1.199274751
286.7708333 1.242171102
286.7777778 1.285057553
286.7847222 1.325402304
286.7916667 1.362363254
286.7986111 1.391722205
286.8055556 1.405890056
286.8125 1.405713007
286.8194444 1.386128858
286.8263889 1.390171509
286.8333333 1.40349566
286.8402778 1.41091221
286.8472222 1.433514661
286.8541667 1.490696612
286.8611111 1.554607563
286.8680556 1.657266314
286.875 1.651191865
286.8819444 1.650172916
286.8888889 1.671063567
286.8958333 1.653188717
286.9027778 1.561978268
286.9097222 1.515426219
286.9166667 1.46295927
286.9236111 1.421446621
286.9305556 1.432237372
286.9375 1.455681323
286.9444444 1.448756373
286.9513889 1.419896024
286.9583333 1.434905475
286.9652778 1.422917126
286.9722222 1.363674277
286.9791667 1.336490828
286.9861111 1.311835179
286.9930556 1.281267129
287 1.30472878
287.0069444 1.270779231
287.0138889 1.179396282
287.0208333 1.139513333
287.0277778 1.116522584
287.0347222 1.115500835
287.0416667 1.136448385
287.0486111 1.136271936
287.0555556 1.118350587
287.0625 1.088596138
287.0694444 1.063908989
287.0763889 1.06880334
287.0833333 1.033123391
287.0902778 1.045626442
287.0972222 1.118979792
287.1041667 1.127253143
287.1111111 1.099190394
287.1180556 1.079576245
287.125 1.110667896
287.1319444 1.119786347
287.1388889 1.116229598
287.1458333 1.091546048
287.1527778 1.032199999
287.1597222 0.95423135
287.1666667 0.860149201
287.1736111 0.827813852
287.1805556 0.853873003
287.1875 0.889231654
287.1944444 0.880596504
287.2013889 0.893111355
287.2083333 0.920852106
287.2152778 0.895291757
287.2222222 0.881581708
287.2291667 0.911860759
287.2361111 0.99626061
287.2430556 1.003693861
287.25 0.897791711
287.2569444 0.796067862
287.2638889 0.811127113
287.2708333 0.790634864
287.2777778 0.781146015
287.2847222 0.795360766
287.2916667 0.827348017
287.2986111 0.877944967
287.3055556 0.965741718
287.3125 0.954566969
287.3194444 0.80209232
287.3263889 0.768056071
287.3333333 0.789890322
287.3402778 0.825265173
287.3472222 0.814085223
287.3541667 0.803751274
287.3611111 0.825581225
287.3680556 0.870255676
287.375 0.939445427
287.3819444 1.033130578
287.3888889 1.094655129
287.3958333 1.147710979
287.4027778 1.18808193
287.4097222 1.221687781
287.4166667 1.246844632
287.4236111 1.261021383
287.4305556 1.281951134
287.4375 1.336641485
287.4444444 1.377816036
287.4513889 1.398733086
287.4583333 1.432302037
287.4652778 1.474299688
287.4722222 1.508699239
287.4791667 1.54730899
287.4861111 1.580853241
287.4930556 1.600063792
287.5 1.546778742
287.5069444 1.535641493
287.5138889 1.567501444
287.5208333 1.588398895
287.5277778 1.612665846
287.5347222 1.637772097
287.5416667 1.661190448
287.5486111 1.675337998
287.5555556 1.701279449
287.5625 1.7011028
287.5694444 1.726198351
287.5763889 1.724336802
287.5833333 1.730899053
287.5902778 1.708820104
287.5972222 1.669886155
287.6041667 1.551715005
287.6111111 1.554067756
287.6180556 1.548832607
287.625 1.544440558
287.6319444 1.556066709
287.6388889 1.56432026
287.6458333 1.553183911
287.6527778 1.558065361
287.6597222 1.566318912
287.6666667 1.566142363
287.6736111 1.587039214
287.6805556 1.587705365
287.6875 1.461025816
287.6944444 1.211059967
287.7013889 1.200736217
287.7083333 1.034103368
287.7152778 1.189403119
287.7222222 1.13938777
287.7291667 0.889822121
287.7361111 0.795722772
287.7430556 0.739669923
287.75 0.807208974
287.7569444 1.052324124
287.7638889 0.910935775
287.7708333 0.748269526
287.7777778 0.635449377
287.7847222 0.580192928
287.7916667 0.700314179
287.7986111 0.67727323
287.8055556 0.64406498
287.8125 0.609148231
287.8194444 0.575918982
287.8263889 0.617268033
287.8333333 0.629801384
287.8402778 0.671984635
287.8472222 0.647240586
287.8541667 0.591138536
287.8611111 0.577399687
287.8680556 0.710235838
287.875 0.854808789
287.8819444 0.93669534
287.8888889 0.805367791
287.8958333 0.705296242
287.9027778 0.685639792
287.9097222 0.685463443
287.9166667 0.680204694
287.9236111 0.707129645
287.9305556 0.767916196
287.9375 0.893827947
287.9444444 1.067834798
287.9513889 1.186785949
287.9583333 1.265984999
287.9652778 1.29451115
287.9722222 1.300242701
287.9791667 1.392890752
287.9861111 1.501521403
287.9930556 1.577222454
288 1.641098005
288.0069444 1.699057055
288.0138889 1.765422206
288.0208333 1.830925957
288.0277778 1.876209308
288.0347222 1.876874359
288.0416667 1.86743821
288.0486111 1.847899061
288.0555556 1.888127211
288.0625 1.948546262
288.0694444 1.980343813
288.0763889 2.002042464
288.0833333 2.009436915
288.0902778 2.027767366
288.0972222 2.031796617
288.1041667 2.045078468
288.1111111 2.042378618
288.1180556 2.016124569
288.125 2.00164622
288.1319444 1.993056471
288.1388889 1.970162722
288.1458333 1.976716973
288.1527778 1.946248524
288.1597222 1.892210074
288.1666667 1.769107825
288.1736111 1.660271976
288.1805556 1.545466227
288.1875 1.577328578
288.1944444 1.447302029
288.2013889 1.28680798
288.2083333 1.18784403
288.2152778 1.039812881
288.2222222 0.891660332
288.2291667 0.821260583
288.2361111 0.813467334
288.2430556 0.770121585
288.25 0.708985336
288.2569444 0.713042687
288.2638889 0.717946737
288.2708333 0.730470988
288.2777778 0.670165939
288.2847222 0.60560149
288.2916667 0.552881141
288.2986111 0.478944392
288.3055556 0.510141043
288.3125 0.533702893
288.3194444 0.535221944
288.3263889 0.550302895
288.3333333 0.589959746
288.3402778 0.642315597
288.3472222 0.698888248
288.3541667 0.748669999
288.3611111 0.781508449
288.3680556 0.8041844
288.375 0.832780951
288.3819444 0.843604202
288.3888889 0.871348153
288.3958333 0.887244604
288.4027778 0.889605555
288.4097222 0.875047505
288.4166667 0.784324456
288.4236111 0.800230807
288.4305556 0.770428858
288.4375 0.849788609
288.4444444 0.86824086
288.4513889 0.866369111
288.4583333 0.907641562
288.4652778 0.968358112
288.4722222 1.005381963
288.4791667 0.956166814
288.4861111 0.934003765
288.4930556 0.882232116
288.5 0.898972967
288.5069444 0.974904418
288.5138889 1.083767668
288.5208333 1.118232919
288.5277778 1.15015707
288.5347222 1.177853121
288.5416667 1.199633772
288.5486111 1.218034523
288.5555556 1.218702174
288.5625 1.169542824
288.5694444 1.081506275
288.5763889 0.941005026
288.5833333 0.889238977
288.5902778 0.904287528
288.5972222 0.861815779
288.6041667 0.89885933
288.6111111 0.968874081
288.6180556 1.038016131
288.625 1.118114782
288.6319444 1.194801933
288.6388889 1.248664084
288.6458333 1.288162635
288.6527778 1.325121286
288.6597222 1.367978637
288.6666667 1.411670687
288.6736111 1.433424538
288.6805556 1.459392489
288.6875 1.49294654
288.6944444 1.527337891
288.7013889 1.558351542
288.7083333 1.586832393
288.7152778 1.616994543
288.7222222 1.637884194
288.7291667 1.657928945
288.7361111 1.677971696
288.7430556 1.698012547
288.75 1.712155898
288.7569444 1.724613349
288.7638889 1.735385299
288.7708333 1.72257555
288.7777778 1.732505201
288.7847222 1.744961452
288.7916667 1.767522703
288.7986111 1.798501054
288.8055556 1.833684705
288.8125 1.828456356
288.8194444 1.803022606
288.8263889 1.849990357
288.8333333 1.873382508
288.8402778 1.864788559
288.8472222 1.86461201
288.8541667 1.898943161
288.8611111 1.887825512
288.8680556 1.917944762
288.875 1.953110113
288.8819444 1.979856464
288.8888889 2.025105515
288.8958333 2.082960166
288.9027778 2.127349317
288.9097222 2.135580568
288.9166667 1.978969018
288.9236111 1.915689669
288.9305556 1.84312992
288.9375 1.786545271
288.9444444 1.721525322
288.9513889 1.714610773
288.9583333 1.735489524
288.9652778 1.699936775
288.9722222 1.651742825
288.9791667 1.627973776
288.9861111 1.589874527
288.9930556 1.308830678
289 1.047722029
289.0069444 0.84292588
289.0138889 0.793671131
289.0208333 0.760485081
289.0277778 0.757768832
289.0347222 0.766056583
289.0416667 0.770112034
289.0486111 0.738614185
289.0555556 0.652062836
289.0625 0.614615487
289.0694444 0.617827337
289.0763889 0.637134788
289.0833333 0.642040839
289.0902778 0.63508729
289.0972222 0.650156941
289.1041667 0.685551492
289.1111111 0.704004043
289.1180556 0.724147894
289.125 0.743443244
289.1319444 0.741573095
289.1388889 0.748168846
289.1458333 0.748837797
289.1527778 0.763897948
289.1597222 0.806884499
289.1666667 0.80924675
289.1736111 0.814147
289.1805556 0.850352751
289.1875 0.900928802
289.1944444 0.907518653
289.2013889 0.848128304
289.2083333 0.835262455
289.2152778 0.884152306
289.2222222 0.889050656
289.2291667 0.888873907
289.2361111 0.914915258
289.2430556 0.954482009
289.25 0.93993096
289.2569444 0.935526311
289.2638889 0.944650762
289.2708333 0.955466212
289.2777778 0.967971263
289.2847222 0.988084014
289.2916667 1.013265665
289.2986111 1.051965016
289.3055556 1.093191267
289.3125 1.122582518
289.3194444 1.143522269
289.3263889 1.166993619
289.3333333 1.18455127
289.3402778 1.202106821
289.3472222 1.209529072
which shows the variation in air temperature measured at ten minutes
intervals (which I have converted into decimal days).
I'm attempting to compute the spectral properties of the time series in
order to see which periods are dominant. So far I have tried:
x = data(:,1);
y = data(:,2);
N = length(x);
% Time specifications:
Fs = 1; % samples per second, 10 minute samples
freq = 0:N-1; %Numerators of frequency series
freq = freq.*Fs./N;
% Fourier Transform:
X = fft(y)/N; % normalize the data
% find find nuquist frequency
cutOff = ceil(N./2);
% take only the first half of the spectrum
X = (X(1:cutOff));
% Frequency specifications:
freq = freq(1:cutOff);
% Plot the spectrum:
figure(i);
subplot(211);
plot(x,y);
subplot(212);
plot(freq,abs(X));
Is the sampling frequency specified here correct?
I am not convinced that I have done this correctly, could someone please
specify the correct or advised way of doing this? The reason I say that
this must not be correct is because I have a peak in the spectra at some
value that doesn't seem to mean much, and therefore would like to see how
someone who is experienced in performing these kinds of analysis would
tackle this.
No comments:
Post a Comment