0

I am running an FFT in MATLAB of some tidal data. I am using the FFT function:

y = tide_data
Fs = 12*24; % Sampling frequency (number of samples per day)
L = numel(y(:,ii)); % Length of time series
NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y = fft(y(:,ii),NFFT)/L;
f = Fs/2*linspace(0,1,NFFT/2+1);
tt = (1./f);
figure (1)
semilogx(tt,2*abs(Y(1:NFFT/2+1)), 'k');

I successfully pick up most of the major tidal species, most predominantly the major peak sits at 12.42hrs (the M2 tidal component), however I can't seem to be able to pick up the fortnightly component (Mf), even though it is apparent in the time domain. It should have a frequency of about 327hrs, or 14 days. Please see the link to the image below. Does anyone have any suggestions as to why this is?

enter image description here

  • 2
    What is Mf? Can you rephrase the question? What is what you want and what you dont see? Can you please post the code to create those images? a MWE – Ander Biguri Feb 09 '15 at 15:00
  • 2
    We couldn't possibly tell you what you're doing wrong since you didn't show us how you did it and what the desired behavior is. – runDOSrun Feb 09 '15 at 15:02
  • So what exactly are you expecting the output to be? Your question is phrased in such a way where you are expecting a domain expert to come in a save the day. Unfortunately, not all of us have experience with tidal data, so please rephrase your question in such a way that shows what the expected inputs and expected outputs are in terms of the frequency domain, which will be more palatable to signal processing experts (such as myself). – rayryeng Feb 09 '15 at 17:12
  • Sorry about that, hopefully I have improved what I am after by being more specific now? – user2653752 Feb 12 '15 at 11:44
  • What sort of amplitude are you expecting to see? If it's very small, have you tried a log-log plot? Does your sample window correspond with the natural frequency of the tidal cycle? If not then you should be windowing the data before performing an FFT - you could be losing low amplitude data in the sidelobes or noise floor of the rectangular window. – Katie Feb 12 '15 at 12:15
  • Although, actually looking at the numbers, windowing shouldn't be a problem for something that far from the main peak unless it is in the millimeter range, so it probably isn't your issue. – Katie Feb 12 '15 at 12:25
  • Thanks Katie, my main concern is over accurate location of the frequency peaks. Therefore, as I understand it, windowing would cause a problem. As I understand it there is a trade-off in the FFT between the accuracy of amplitude information and frequency information. Windowing might help me with accurate amplitude information, but is unlikely to so with frequency information. – user2653752 Feb 12 '15 at 13:10

0 Answers0