Regarding a fft of a signal taken from an accelerometer
Show older comments
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
Lenin Tuppari
on 2 Feb 2012
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.
Answers (1)
bym
on 24 Jul 2011
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
Sukhjeet
on 25 Jul 2011
Walter Roberson
on 25 Jul 2011
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
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!