FFT: Trouble with getting plausible frequencies

조회 수: 2 (최근 30일)
Julia Klein
Julia Klein 2018년 7월 30일
댓글: dpb 2018년 8월 7일
Hey,
I'm trying to solve following problem: I have data from digital drawings and want to calculate the frequencies of velocity and acceleration in order to define a tremor frequency. An example data set contains 289 measurements in 1.003 seconds. This is the code for the FFT I was trying to compute (X is the signal, for example velocity in cm/s, and timestamp defines when the data points were measured):
Fs = length(timestamp(timestamp <= 1)); %Frequency sample (data points in 1 second) = 288
T = 1/Fs; %Sample time = 0.0035
L = length(X); %Length of signal = 289
t = (0:L-1)*T; %Time vector
N = 2^nextpow2(L); %Next power of 2 = 512
Y = fft(X,N)/L; %FFT
f = Fs/2*linspace(0,1,N/2);
plot(f,2*abs(Y(1:N/2))) %Single-sided amplitude spectrum
With this code I get the attached plot that shows frequencies from 0 to 150Hz on the x-axis and peaks at approximately 60Hz and 100-120Hz.
According to the literature, the frequencies for velocity should be around 2-10Hz and not this high. I know that it is possible to use a Low-Pass filter on the data, but I cannot just cut off all frequencies higher than 20Hz, can I?
I'm now asking for help how I get more plausible frequencies and to understand if I'm calculating the FFT correctly for my kind of problem.
Thanks!
Julia
  댓글 수: 8
Julia Klein
Julia Klein 2018년 8월 7일
It came out that there was a mistake in the collection of the data and now everything's working fine. Thanks again for your time and help!
dpb
dpb 2018년 8월 7일
That's more often the case than not, unfortunately.
"Question everything!"

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

답변 (1개)

Dimitris Kalogiros
Dimitris Kalogiros 2018년 7월 30일
편집: Dimitris Kalogiros 2018년 7월 30일
Only 288 data points maybe are not enought to show you the spectrum of your data. With your code, you evaluate an FFT of length N=512. This means that matlab appent 512-288 zeros to your signal and the side effect of this fact is some noise at the spectrum. I suggest to use more than 1sec data interval.
More over, you can use more efficient functions to estimate spectrum of your data, for example pwelch().
And a last observation: your data look like they have a very strong dc component
  댓글 수: 5
dpb
dpb 2018년 7월 31일
The DC component in the PSD plot appears twice the size it actually is owing to the normalization of
plot(f,2*abs(Y(1:N/2)))
FFT returns only a single bin for the DC and Fmax components so doubling Y(1) doubles the actual DC magnitude.
It's still large in comparison to the rest of the spectrum but not quite so much as is shown.
Of course, as is said, removing it won't make any difference anywhere else; could just as effectively just set Y(1)=0;.
The underlying problem here appears to be in however these data were gathered not being up to the task desired or there simply not being the type of signal buried in the data as was expected.
David Goodmanson
David Goodmanson 2018년 8월 1일
Hello Julia,
Does the signal go on for quite a ways, or does it drop into the noise after a fairly short period of time? It would help if you could provide an example, 4-6 seconds of time and velocity data, say in a mat file.

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

카테고리

Help CenterFile Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by