Obtaining displacement from acceleration with omega arithmetic

56 次查看(过去 30 天)
Hi everyone,
I have read on different posts, that another method to obtain the displacement from the acceleration is by using omega arithmetic. I have tried different techniques, however I get very confusing information / results. I am getting the accelerometer data from a tri-axis accelerometer, for which I use a sampling frequency of 400Hz. I have written the following code:
Fs = 400; %Sampling frequency from my Accelerometer
Fn = Fs/2; %Nyquist Frequency
dt = 1/Fs;
N = numel(Time); % Amount of Samples
%First I am doing a High-Pass-Filter on my data, using the Buttord, butter, zp2sos and filtfilt functions
Wp = [5.0/400 20.0/400]; % Passband (Hz)
Ws = [0.1/400 40.0/400]; % Stopband (Hz)
Rp = 1; % Passband Riple (dB)
Rs = 10; % Stopband Riple (dB)
[n,Wn] = buttord(Wp,Ws,Rp,Rs);
[z,p,k] = butter(n,Wn);
[sos,g] = zp2sos(z,p,k);
AccelVek_filtered = filtfilt(sos,g,AccelVek); %AccelVek is three dimensional (Acc_x, Acc_y and Acc_z in each column for the given Time)
% Next doing the FFT
NFFT = 2^nextpow2(N);
AFFT = fft(AccelVek_filtered, NFFT)*dt; %dAccelVek_filtered is simply the acceleration filtered using filtfilt
f_fft = Fs*(0:NFFT-1)/NFFT; % Frequency
omegai = 2*pi*Fs*sqrt(-1); % Omega to use in the Frequency domain
% dividing by omega*i^2
for i = 1:NFFT
if f_fft(i) > 10 && f_fft(i) < Fn
DFFT(i,1) = AFFT(i,1)/(omegai^2);
DFFT(i,2) = AFFT(i,2)/(omegai^2);
DFFT(i,3) = AFFT(i,3)/(omegai^2);
else
DFFT(i,:) = 0;
end
end
DisVek = ifft(DFFT, N)*Fs; %Transforming it back using ifft
I know it is a pretty long code, but my results don't seem to make sense. Could someone please have a look and tell me if i made a mistake somewhere?
Thank you :)
Sam
  3 个评论
Samuel Bofferding
Yes it is true, however I was not very happy with the results, because of the noise of my accelerometer. Therefore, I am trying different techniques to see which one gives me the best results.

请先登录,再进行评论。

采纳的回答

Lubos Smolik
Lubos Smolik 2020-4-2
编辑:Lubos Smolik 2020-4-2
Hello Samuel!
If you want to perform a single integration in the frequency domain, you have to multiply each spectral line by
1 ./ (2i * pi * f_fft),
where f_fft is a frequency of the spectral line rather than the sampling frequency.
For a full code, please refer to this submission: autoFFT
EDIT: Moreover, there is no need for low-pass filtering if you do not want to apply, e.g. frequency zoom. Note that each filter can alter magnitudes and phases of components in your signal and it in turn adds some degree of uncertainty to your experimental data. If you measure vibrations, it is usually better to perform only analog anti-aliasing filtering (your analyser should do it) and digital or analog high-pass filtering. If you do not need higher frequencies, you can discard them after the Fourier transform.
  2 个评论
Samuel Bofferding
Thank you Lubos! That was also what I was wondering, wether to use a constant frequency or not! I am also using the simple high pass filter function from Matlab!
Thirukumaran Nadesan
编辑:Thirukumaran Nadesan 2022-5-30
The result after second integration, is that position vector or displacement vector? how to obtain the total distance?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Spectral Measurements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by