fourier analisys - harmonic analisys

1 view (last 30 days)
Dany
Dany on 22 May 2012
hi, im doing work about tidal prediction. one of the steps requires calculation of amplitude and phase of some constituents. the way to it is by fourier analisys of a data vector wich holds the measured heights during a period of time. also the speed of each constituent is known. i've tried to you the FFT function but it was not succesfull.
can any one help me on this matter?
  4 Comments
Daniel Shub
Daniel Shub on 22 May 2012
@Dany Ummm yeah you did say it is not succesful: "i've tried to you the FFT function but it was not succesfull." What Honglei was asking is what have you tried and why has it not been successful. Provide some simplified code that demonstrates where you are and then tell us what the next step is that you are having problems with. Generally we do not answer questions that ask for help with multiple steps.
Dany
Dany on 22 May 2012
lets say that vector X holds the measured height data.
Y=fft(X); %thats the fourier transform
angle(Y); %i assume that gives me the phases of the constituents
the next step is to get the amplitudes thats corespond to the phases, thats where im stuck.
another question is does the amplitudes/phases are in any order (the one with the most effect is first)?

Sign in to comment.

Answers (3)

Daniel Shub
Daniel Shub on 22 May 2012
You can get the amplitude with
abs(Y);
The components are in a very specific order. They are arranged by frequency. The component with the highest amplitude is the most important, but generally does not have the highest or lowest frequency.

Honglei Chen
Honglei Chen on 22 May 2012
You can get amplitude by doing
Y_mag = abs(Y);
The magnitude and phase are in the order of frequencies, from 0 to your sample rate. If you want to see the 0 frequency int the middle, you can use fftshift. As a quick example, you can do the following
freqz(X,1)

Dany
Dany on 22 May 2012
thank you. the units of the amplitude are the same as the units of the data? is it possible to get very lagre numbers at the few first amlitudes?
  2 Comments
Honglei Chen
Honglei Chen on 22 May 2012
You can think that way, but the x axis is frequency now, so it tells you how your signal's energy is distributed among different frequencies. I don't quite get why you want to see very large numbers at the first few amplitudes, could you elaborate? Is there a specific pattern you are looking for?
Dany
Dany on 23 May 2012
the data vector that im trying to analyse has heights that are not exceding 20-25 cm.
however after using the abs() function im getting numbers that are very large, tens and sometimes hundreds of meters, thats wrong it does not supose to be this way.
because if i use those values for tide prediction im getting results that shows tide of hundreds of meters, wich is impossible, specifically at my location we have tides of up to 25 cm.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!