FFT: Trouble with getting plausible frequencies

2 次查看(过去 30 天)
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 中查找有关 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