# FFT of sensor data

조회 수: 22 (최근 30일)
A VP 2017년 6월 8일
댓글: Walter Roberson 2017년 6월 8일
Hello everyone!
I am a beginner in Signal processing. I have a time series plot of sensor data that has 200000 values. I need to calculate the FFT of the same data. When I perform fft(x), (assuming x is the time series signal), I get a plot with two peaks , one at 0 and one at 200000. The peak at 0 has an amplitude of 110 and the peak at 200000 has an amplitude of 7. The FFT should be mirror images. Why am I not observing any mirror images on this plot? The sample time of sensor is 0.01s (1000Hz).
Also I expect a resonant frequency of the sensor to be around 70-80 Hz. I do not see any peaks in the FFT at this frequency range. Please help.

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

### 채택된 답변

Walter Roberson 2017년 6월 8일
The peak at 0 is equal to the sum of your readings. It would disappear if you were to subtract the mean of your readings from your input.
If your readings are real-valued, then the peak at the last bin is the complex conjugate of the peak at bin #2; both correspond to the lowest non-zero frequency.
##### 댓글 수: 2없음 표시없음 숨기기
A VP 2017년 6월 8일
If I want to obtain the resonant frequency of the time series plot, how can I do it? Thank you in advance .
Walter Roberson 2017년 6월 8일
One thing to keep in mind is that fft() assumes that the signal is periodic. If you cut the signal at a point that does not happen to be the end of all of the cycles, then you will get some edge effects leading to some unexpected frequencies showing up. There are two common cases for that:
• if you zero-pad a signal, then you are effectively convolving it with a sync function, which will give you large narrow peaks near time 0 in the time domain, which would be high frequencies in the frequency domain
• when people synthesize signals, it is common for them to use something like t = 0 : delta_t : 10 and then sin() or cos() of some integer frequency times 2 * pi of t. The problem with that is that it starts with a 0 (for sine) and ends with a zero (because the upper bound is an integer, multiplied by 2*pi times an integer), and since the signal is assumed to be periodic, that effectively gives you two 0's together. When you are synthesizing a signal, be sure to end one sample before the return to the original conditions.

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

### 추가 답변 (1개)

Santhana Raj 2017년 6월 8일
You are getting mirror images. except that matlab's FFT results are different from what you have read in your books. Normally FFT algorithm results are from -Fs/2 to +Fs/2, where Fs is the sampling frequency. Matlab's output gives from 0 to Fs. Saying that, if you want to see the plot from -Fs/2 to Fs/2, use the command fftshift.
Your peak at 0 frequency means there is a large DC value. To remove it, find the mean of x and subtract it from each and every value of x.
y=x-mean(x);
This should remove the mean value.
If your x has the senor's resonance, then it should be visible as soon as you have removed the mean. if not, provide the x data in the question, so that people can check it and give you better answers.

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

### 카테고리

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