# Double Integration : (Displacement signals from the Acceleration data)

152 views (last 30 days)
UTS on 27 Feb 2015
Commented: Dr. Seis on 10 Apr 2016
Hi,
In order to obtain the displacement signals from the acceleration data, The following steps are used to convert the acceleration data to achieve the displacement values:
1- The acceleration signals are filtered [High pass filter]
2- The cumtrapz is applied to integrate the displacement to obtain the velocity
3- The velocity signals are filtered [High pass filter]
4- Finally, the filtered signals of velocity is integrated to get the displacement signals.
The concern is still about the correct methods and the accuracy of the results which are obtained. Please have look at the Matlab Program as stated below; If there any comments and contribution regarding the proposed methodology please do not hesitate to shear us your experience, Thank you
%% accelerations are integrated twice to produce displacements
clear all
close all
clc
time = load('D:\Users\Desktop\time.txt');
acc = load('D:\Users\Desktop\data.txt');
figure
plot(time,acc)
xlabel('Time (sec)')
ylabel('Acceleration (mm/sec^2)')
%% Design High Pass Filter
fs = 8000; % Sampling Rate
fc = 0.1/30; % Cut off Frequency
order = 6; % 6th Order Filter
%% Filter Acceleration Signals
[b1 a1] = butter(order,fc,'high');
accf=filtfilt(b1,a1,acc);
figure (2)
plot(time,accf,'r'); hold on
plot(time,acc)
xlabel('Time (sec)')
ylabel('Acceleration (mm/sec^2)')
%% First Integration (Acceleration - Veloicty)
velocity=cumtrapz(time,accf);
figure (3)
plot(time,velocity)
xlabel('Time (sec)')
ylabel('Velocity (mm/sec)')
%% Filter Veloicty Signals
[b2 a2] = butter(order,fc,'high');
velf = filtfilt(b2,a2,velocity);
%% Second Integration (Velocity - Displacement)
Displacement=cumtrapz(time, velf);
figure(4)
plot(time,Displacement)
xlabel('Time (sec)')
ylabel('Displacement (mm)')
##### 0 CommentsShowHide -1 older comments

Sign in to comment.

### Answers (1)

Torsten on 27 Feb 2015
##### 1 CommentShowHide None
Dr. Seis on 10 Apr 2016

Sign in to comment.

### Categories

Find more on Signal Operations 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!