Periodicity using Fourier transform

조회 수: 2 (최근 30일)
aurc89
aurc89 2016년 11월 18일
댓글: Walter Roberson 2016년 11월 18일
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
Walter Roberson
Walter Roberson 2016년 11월 18일
Are the times uniform intervals or irregular?
aurc89
aurc89 2016년 11월 18일
In this case uniform but sometimes could be irregular in fact

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2016년 11월 18일
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
aurc89
aurc89 2016년 11월 18일
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 2016년 11월 18일
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)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by