Periodicity using Fourier transform

4 visualizaciones (últimos 30 días)
aurc89
aurc89 el 18 de Nov. de 2016
Comentada: Walter Roberson el 18 de Nov. de 2016
Hi everyone, I have a simple question concerning how to find the periodicity of an oscillating function using the Fourier transform. Let's suppose to have an oscillating function y=f(x) where x and y are two vectors and x is the time vector expressed in second (s). Can you suggest me a code to retrieve the frequency (or frequencies) of this function, expressed in herz (i.e. 1/s) by using the Fourier transform? Thanks a lot.
  2 comentarios
Walter Roberson
Walter Roberson el 18 de Nov. de 2016
Are the times uniform intervals or irregular?
aurc89
aurc89 el 18 de Nov. de 2016
In this case uniform but sometimes could be irregular in fact

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 18 de Nov. de 2016
If the times are uniform intervals then do peak finding on fft(y-mean(y))
See the fft example for how to calculate the frequency from bin and fs and length
  2 comentarios
aurc89
aurc89 el 18 de Nov. de 2016
So if I have a vector in second (s) how can I get the frequency of the oscillations (in 1/s) by using fft ?
Walter Roberson
Walter Roberson el 18 de Nov. de 2016
For x at equal time intervals,
L = length(y);
Fs = 1/(x(2)-x(1));
f = Fs*(0:(L/2))/L;
Now the first length(f) positions in fft(y-mean(y)) are associated with corresponding frequencies in f, so if you find a peak at position K then the frequency corresponding is f(K)

Iniciar sesión para comentar.

Categorías

Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by