I have run through the example used here: http://www.mathworks.co.uk/products/matlab/examples.html;jsessionid=20a658a2dcd514f152ada895e6f8?file=/products/demos/shipping/matlab/fftdemo.html and am now trying to do the same with my data. I have a time series that consists of 5127 data points which were collected every 12 hours for just over 7 years. It is of ocean current water movement and I am trying to look at cycles within it.
I have tried to do this and the graph comes up blank. I suspect it is something to do with this part f = 1000/251*(0:127);
I don't know why they have used 1000 or 127.
Would someone be able to explain this? Thanks
Ok sorry, This is what I used. I have a time variable and a measurement of water volume. By following the example above I used this, but have clearly done something wrong:
t=0:.5:2578;>> plot (Thermocline(1:5157)) >> Y=fft(Thermocline,5157);>> Pyy=Y.*conj(Y)/5127;>> f=1000/5127*(0:2563);plot(f,Pyy(1:2564))
Pyy – 1×5157
Max ans =
1.6713e+06
ans =
4.4727e-07
I am unsure of the range as I don't fully understand what Pyy is. If its time then its half days. If its volume then the range is 18.7 Sv and if its periodicity then I expect to see a strong annual signal (720).
Best Answer