You can convert acceleration data into velocity and displacement by integrating it once for velocity and twice for displacement. Direct integration usually fails because sensor bias and low-frequency noise cause integration drift. Applying a high-pass filter and a Tukey window before integrating removes most of that drift, and the enDAQ Python library automates these steps. This guide walks through the method, a full Python example, and a validation against a laser displacement sensor.
The Relationship Between Acceleration, Velocity, and Displacement
Example: Converting Acceleration to Velocity and Displacement Using Python
9.2. Step 1: Upload an IDE File.
9.3. Step 2: Select the Measurement Axis
9.4. Step 3: Select the Time Interval
9.5. Step 4: Adjust Advanced Parameters (Optional)
Accelerometers are among the most widely used sensors in engineering applications, including structural health monitoring, machinery diagnostics, predictive maintenance, automotive testing, and aerospace systems. These sensors directly measure acceleration, which is the rate of change of velocity with respect to time. However, engineers are often interested in other quantities such as velocity and displacement, since they can provide more intuitive information about motion and vibration behavior.
Fortunately, velocity and displacement can be obtained from acceleration measurements through a mathematical process known as integration. While the concept is straightforward, practical implementation requires careful signal processing to avoid errors caused by sensor noise and bias.
This article explains how acceleration is converted into velocity and displacement and discusses the challenges associated with the process.
The three motion quantities are mathematically related through differentiation and integration.
Acceleration is defined as the rate of change of velocity:
Similarly, velocity is the rate of change of displacement:
By reversing these relationships, velocity can be obtained by integrating acceleration:
Displacement is then obtained by integrating velocity:
Combining both steps results in:
In other words:
Real-world acceleration data are collected at discrete time intervals rather than as continuous functions. Therefore, numerical methods must be used to perform integration.
One of the most common approaches is the trapezoidal integration method. For a signal sampled at a constant time interval Δt, velocity can be approximated as:
Similarly, displacement can be calculated from the velocity signal:
These calculations are repeated for every sample in the dataset.
Although the mathematics is simple, direct integration of measured acceleration data often produces unrealistic results.
The reason is that accelerometers are not perfect. Measurements typically contain:
Consider an accelerometer with a small offset of only 0.01 m/s². Integrating this constant error produces a velocity that grows linearly with time:
A second integration produces displacement that grows quadratically:
Even a tiny measurement bias can therefore generate enormous displacement errors after a few minutes of data collection.
This phenomenon is known as integration drift.
To obtain meaningful velocity and displacement measurements, signal conditioning is typically applied before integration.
A high-pass filter removes very low-frequency content, including DC offsets and sensor bias.
For example, a cutoff frequency of 1 Hz removes signal components below 1 Hz while preserving higher-frequency vibration content.
This significantly reduces drift during integration.
However, there is a tradeoff. If the system actually contains meaningful motion below the cutoff frequency, that information will also be removed.
Another common technique is applying a window function before integration.
A popular choice is the Tukey window, which gradually reduces the signal amplitude near the beginning and end of the record.
Benefits include:
A Tukey window is particularly useful when analyzing finite-duration vibration events.
While the mathematical concepts behind acceleration, velocity, and displacement are straightforward, implementing them correctly requires careful signal processing to minimize integration drift and noise. The Python enDAQ library provides built-in tools that automate many of these processing steps, making it easier to obtain reliable velocity and displacement measurements from acceleration data.
In addition to numerical integration, the enDAQ library offers a wide range of capabilities for vibration and shock analysis, including time-domain visualization, frequency analysis, filtering, power spectral density (PSD) calculations, shock response spectrum (SRS) analysis, data extraction from IDE files, and interactive plotting. These tools allow engineers and researchers to process, analyze, and visualize sensor data using a consistent workflow.
The example presented in this article uses the enDAQ library to convert acceleration measurements into velocity and displacement while applying signal conditioning techniques such as high-pass filtering and Tukey windowing to reduce integration drift.
The enDAQ Python library can be installed directly from PyPI using:
pip install endaq
or, within a Jupyter Notebook:
!pip install endaq
Note: Plotly libraries is also used, which may need to be installed (if they are not already available in your Python environment.) using
!pip install plotly
The following example demonstrates a complete workflow for converting acceleration data stored in an IDE file into velocity and displacement.
To this end, an enDAQ accelerometer was mounted on the top surface of a shaker, as shown in Figure 1. To validate the measurements, the shaker displacement was simultaneously measured using a laser displacement sensor mounted above the enDAQ and directed toward its top surface. The shaker acceleration was recorded for approximately 100 seconds.
The process consists of:
Step 1 – Plot the Raw Acceleration Signal
Before processing, it is often helpful to visualize the entire acceleration record and identify the time interval of interest.