Regarding a fft of a signal taken from an accelerometer

I have taken a signal with an accelerometer,whose Data acquisition setup details are:
Frequency limits: 2000,spectral lines/sampling rate: 12800, No of blocks: 1,time taken for data acquisition: 6.4 seconds.
First, I have to transfer acceleration signal from time to frequency domain using FFT.
The code which I am using is as follows:
load data.mat;
% data.mat is the acceleration signal file
x=data(:,1);
% x is the my acceleration signal
N=32786; % length of the vector
Fs= 12800; % sampling frequency in Hz
% carrying out FFT on acceleration data
xdft = fft(x-mean(x))/N;
%just retaining the positive frequencies%
xdft = xdft(1:length(x)/2+1);
%generating suitable frequency scale%
freq = linspace(0,Fs/2,length(x)/2+1);
plot(freq,abs(xdft));
xlabel('Hz'); ylabel('Magnitude');
But I have a software from the manufacturer of the equipment which I am using which is giving the results otherwise,the amplitude value at a particular frequency in the frequency domain using matlab and the said software are not matching. Please check whether I am using the correct code.and also What is the importance of the frequency limit?
Thanks in advance.

1 Comment

hii iam working on the same idea as yours.i want to derive frequency values from the accelerometer data.I am stuck with fft implementaation.can you please share the info what u did.

Sign in to comment.

Answers (1)

are they off by a factor of 2? When you discard the negative frequencies, you need to multiply the remaining by 2 (except dc), so
xdft(2:end) = 2* xdft(2:end);

2 Comments

Dear can u give me ur email id? I will send u one set of data and the image of the file which i am getting from the manufacturer's software. then only we can compare.
You can upload the information to a shared site and post the URL here. See http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers

Sign in to comment.

Tags

Asked:

on 24 Jul 2011

Community Treasure Hunt

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

Start Hunting!