# Obtaining displacement from acceleration with omega arithmetic

38 visualizaciones (últimos 30 días)
Samuel Bofferding el 2 de Abr. de 2020
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 comentariosMostrar 1 comentario más antiguoOcultar 1 comentario más antiguo
Samuel Bofferding el 3 de Abr. de 2020
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 el 4 de Abr. de 2020

Iniciar sesión para comentar.

Lubos Smolik el 2 de Abr. de 2020
Editada: Lubos Smolik el 2 de Abr. de 2020
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 comentariosMostrar NingunoOcultar Ninguno
Samuel Bofferding el 4 de Abr. de 2020
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 el 30 de Mayo de 2022
The result after second integration, is that position vector or displacement vector? how to obtain the total distance?

Iniciar sesión para comentar.

### Categorías

Más información sobre Spectral Measurements en Help Center y File Exchange.

### Community Treasure Hunt

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

Start Hunting!

Translated by