The Naked Scientists
  • Login
  • Register
  • Podcasts
      • The Naked Scientists
      • eLife
      • Naked Genetics
      • Naked Astronomy
      • In short
      • Naked Neuroscience
      • Ask! The Naked Scientists
      • Question of the Week
      • Archive
      • Video
      • SUBSCRIBE to our Podcasts
  • Articles
      • Science News
      • Features
      • Interviews
      • Answers to Science Questions
  • Get Naked
      • Donate
      • Do an Experiment
      • Science Forum
      • Ask a Question
  • About
      • Meet the team
      • Our Sponsors
      • Site Map
      • Contact us

User menu

  • Login
  • Register
  • Home
  • Help
  • Search
  • Tags
  • Member Map
  • Recent Topics
  • Login
  • Register
  1. Naked Science Forum
  2. Non Life Sciences
  3. Physics, Astronomy & Cosmology
  4. How can I calculate displacement from time series acceleration data?
« previous next »
  • Print
Pages: [1]   Go Down

How can I calculate displacement from time series acceleration data?

  • 9 Replies
  • 35706 Views
  • 0 Tags

0 Members and 1 Guest are viewing this topic.

Offline timabram (OP)

  • First timers
  • *
  • 1
  • Activity:
    0%
    • View Profile
How can I calculate displacement from time series acceleration data?
« on: 07/06/2006 08:26:04 »
Hi,

Does any one have a simple algorithm for translating time series acceleration data to displacement.  All any one ever seems to have is "just double integrate the data" ......  ???  double integrate what?

I also understand that this process results in drift of the result, this isn't so important to me as I am recording accelerations from a bouy to record wave height, and all im interested in is the mean wave height of the data series.

The data is recorded from a simple single axis accelerometer and resulting in the following data:

Time ; Acceleration in m/s^2

at a frequency of 20Hz - although this can be changed.


Any Ideas of VB code samples would be great.


Tim

Mod: Edited to rephrase your title as a question.
« Last Edit: 11/03/2010 03:50:56 by JP »
Logged
 
 



Offline Soul Surfer

  • Naked Science Forum King!
  • ******
  • 3384
  • Activity:
    0%
  • Thanked: 6 times
  • keep banging the rocks together
    • View Profile
    • ian kimber's web workspace
Re: How can I calculate displacement from time series acceleration data?
« Reply #1 on: 09/06/2006 11:22:45 »
The simple answer to this is that you need to learn about integration and some basic dynamics because the answer you have been given is correct and there is no substitute for the process of integration.  

If something starts moving it displacement from its original position depends on the velocity that it is moving and the time that it has been moving  (velocity is distance moved in a given time)so velocity is the rate of change of distance.  However this velocity is not contstant and the rate of change of velocity is acceleration  in other words a position is in meteres from a particular spot, a velocity is meteres per second and an acceletation is meteres per second per second.  This process is called differentiation.  The inverse of this process is integration.

You are particularly interested in wave motion where something starts at rest accelerates moves a bit comes to rest and moves back again this involves continually varying, position, velocity and acceleration.



Learn, create, test and tell
evolution rules in all things
God says so!
Logged
Learn, create, test and tell
evolution rules in all things
God says so!
 

Offline daveshorts

  • Moderator
  • Naked Science Forum King!
  • *****
  • 2568
  • Activity:
    0%
  • Physics, Experiments
    • View Profile
    • http://www.chaosscience.org.uk
Re: How can I calculate displacement from time series acceleration data?
« Reply #2 on: 09/06/2006 12:58:43 »
A very quick overview:

Integration is a way of converting a rate of change in x to x itself.


A a change of velocity (Δv) over a period of time (dt) is the average acceleration over this period of time * dt

so if you have equally spaced acceleration data the change of velocity between each point could be approximated to be the accelleration at each point. so Δv = a * dt

so the total change of velocity will be from point 1 to point n will be approximately:
Δv = a_1 * dt + a_2 * dt + a_3 * dt ....a_n *dt

the relation of velocity to position is the same as acceleration to velocity.

You will find that average errors in position will build up over time, as errors build up. There must be more sophisticated methods of dealing with this.

the most trivial way of doing this is to
« Last Edit: 09/06/2006 12:59:26 by daveshorts »
Logged
 

Offline wolfpackdiver

  • First timers
  • *
  • 1
  • Activity:
    0%
    • View Profile
Re: How can I calculate displacement from time series acceleration data?
« Reply #3 on: 10/03/2010 20:38:28 »
Double integration of raw acceleration data is a pretty poor estimate for displacement.  The reason is that at each integration, you are compounding the noise in the data.  If you are dead set on working in the time-domain, the best results come from the following steps.
1. Remove the mean from your sample (now have zero-mean sample)
2. Integrate once to get velocity using some rule (trapezoidal, etc.)
3. Remove the mean from the velocity
4. Integrate again to get displacement. 
5. Remove the mean. Note, if you plot this, you will see drift over time.
6. To eliminate (some to most) of the drift (trend), use a least squares fit (high degree depending on data) to determine polynomial coefficients.
7. Remove the least squares polynomial function from your data.

A much better way to get displacement from acceleration data is to work in the frequency domain.  To do this, follow these steps...

1. Remove the mean from the accel. data
2. Take the Fourier transform (FFT) of the accel. data.
3. Convert the transformed accel. data to displacement data by dividing each element by -omega^2, where omega is the frequency band.
4. Now take the inverse FFT to get back to the time-domain and scale your result. 

This will give you a much better estimate of displacement.  Hope this helps..
Logged
 

Offline LeeE

  • Naked Science Forum King!
  • ******
  • 3382
  • Activity:
    0%
  • Thanked: 1 times
    • View Profile
    • Spatial
How can I calculate displacement from time series acceleration data?
« Reply #4 on: 12/03/2010 00:24:37 »
Hmm... sounds as though the old and simple

  s= ut + 1/2 at2

might suit, where s is the displacement, u is the initial velocity, a is the acceleration and t the period between samples.  You'll also need to work out the new value for u, for each sample, of course, but that's trivial, assuming you have an initial velocity to start with.
Logged
...And its claws are as big as cups, and for some reason it's got a tremendous fear of stamps! And Mrs Doyle was telling me it's got magnets on its tail, so if you're made out of metal it can attach itself to you! And instead of a mouth it's got four arses!
 



Offline balajiV

  • First timers
  • *
  • 2
  • Activity:
    0%
    • View Profile
Re: How can I calculate displacement from time series acceleration data?
« Reply #5 on: 01/02/2017 18:05:00 »
Quote from: wolfpackdiver on 10/03/2010 20:38:28
Double integration of raw acceleration data is a pretty poor estimate for displacement.  The reason is that at each integration, you are compounding the noise in the data.  If you are dead set on working in the time-domain, the best results come from the following steps.
1. Remove the mean from your sample (now have zero-mean sample)
2. Integrate once to get velocity using some rule (trapezoidal, etc.)
3. Remove the mean from the velocity
4. Integrate again to get displacement. 
5. Remove the mean. Note, if you plot this, you will see drift over time.
6. To eliminate (some to most) of the drift (trend), use a least squares fit (high degree depending on data) to determine polynomial coefficients.
7. Remove the least squares polynomial function from your data.

A much better way to get displacement from acceleration data is to work in the frequency domain.  To do this, follow these steps...

1. Remove the mean from the accel. data
2. Take the Fourier transform (FFT) of the accel. data.
3. Convert the transformed accel. data to displacement data by dividing each element by -omega^2, where omega is the frequency band.
4. Now take the inverse FFT to get back to the time-domain and scale your result. 

This will give you a much better estimate of displacement.  Hope this helps..


SIR CAN YOU SEND THE CODE FOR THE ABOVE STEPS YOU HAVE MENTIONED FOR FINDING THE DISPLACEMENT??
Logged
 

Offline evan_au

  • Global Moderator
  • Naked Science Forum King!
  • ********
  • 8971
  • Activity:
    75%
  • Thanked: 882 times
    • View Profile
Re: How can I calculate displacement from time series acceleration data?
« Reply #6 on: 01/02/2017 20:54:09 »
For the second method described (Fourier Transform), you can calculate it as follows using EXCEL.
This is a rough outline only, based on the way I would approach it for a one-off calculation.
For bulk calculations, use a conventional programming language, with automatic data download from the monitoring station, export and archiving.

0. Input The Data
In Column A: Time; In Column B: List of acceleration measurements. Use a block of measurements which is a power of 2 (eg 1024 or 8096 measurements)
So if the sampling rate is 20Hz (as in the OP), and you use blocks of 8192 measurements, the input data will span 163.84 seconds.


1. Remove the mean from the accel. data
Calculate the average of the accelerations in column B. In column C, insert the value in column B, minus the average.


2. Take the Fourier transform (FFT) of the accel. data.
Not mentioned here: You should calculate a windowing function in column D, such as a sine wave from 0 to 180 degrees, This eliminates spurious accelerations at the start and end of the block of data.
In column E, multiply the value in column C times the window function in column D.
Use the built-in Fast Fourier Transform function (you may need to enable the maths package in EXCEL) to put the transformed results in column F
From 8192 input values, this calculates 4096 frequency bands (it returns 8192 values; the other 4096 mirror the first 4096)
Each frequency band is 4096/163.84s = 25Hz wide.
So if the sampling rate is 20Hz (as in the OP), and you use blocks of 8096 measurements, the input data will span 161.92 seconds.


3. Convert the transformed accel. data to displacement data by dividing each element by -omega^2, where omega is the frequency band.
I assume that omega here is measured in radians per second. so the first frequency band is 25Hz x 2pi; the second is 50Hz x 2pi, etc. Put this in column G.
You can divide the Fourier transform data in column F by the square of omega in Column G.


4. Now take the inverse FFT to get back to the time-domain and scale your result.
This uses the built-in Inverse FFT function. Put the result in column H. This represents the wave height at 20ms intervals during the sampled period.


5. Output the results
You can graph the wave height data, and process it to find maximum, minimum, range, etc. 
But definitely sanity-check the results before you try to use them!

Note that the results will be better if the blocks of data span many cycles of the waveform you are monitoring. The best block size depends on the sampling rate and the frequency spectrum of the waveform.

Some links that might get you started:
https://en.wikipedia.org/wiki/Fast_Fourier_transform
https://en.wikipedia.org/wiki/Window_function
Logged
 

Offline balajiV

  • First timers
  • *
  • 2
  • Activity:
    0%
    • View Profile
Re: How can I calculate displacement from time series acceleration data?
« Reply #7 on: 02/02/2017 03:32:28 »
Quote from: wolfpackdiver on 10/03/2010 20:38:28
Re: How can I calculate displacement from time series acceleration data?
« Reply #3 on: 10/03/2010 20:38:28 »

sir what about the first method?
Logged
 

Offline PmbPhy

  • Naked Science Forum King!
  • ******
  • 3903
  • Activity:
    0%
  • Thanked: 125 times
    • View Profile
Re: How can I calculate displacement from time series acceleration data?
« Reply #8 on: 02/02/2017 04:19:45 »
Quote from: timabram
Does any one have a simple algorithm for translating time series acceleration data to displacement.
First off you're not really looking for an algorithm. You're looking for an equation. {u]If[/u] the acceleration is constant then that equation, for one dimension, is

x = at/2 + v0t + x0

where

x0 = initial displacement from origin of coordinate system
v0 = initial velocity

and of course t is the time as read on  a "good" clock.
It the acceleration is not constant then you need to know how it varies in time. Then you plug that into the integrations. I'm assuming that you know how to integrate.
Quote from: timabram
All any one ever seems to have is "just double integrate the data" . ???  double integrate what?
That's a poor, if not wrong, way to explain it.  You need to double integrate the equation of motion, which is

d2x/dt2 = a = acceleration
« Last Edit: 02/02/2017 04:23:40 by PmbPhy »
Logged
 



Offline PmbPhy

  • Naked Science Forum King!
  • ******
  • 3903
  • Activity:
    0%
  • Thanked: 125 times
    • View Profile
Re: How can I calculate displacement from time series acceleration data?
« Reply #9 on: 02/02/2017 04:28:10 »
Quote from: LeeE
... and t the period between samples.
That is incorrect. As I explained above t is the time as read on a clock. The equation you posted is not the kind of equation one uses as an algorithm but the equation one uses to create an algorithm for real data. In such cases the value of t is still something that increases constantly with time but the time between samples depends on how the data was collected, i.e. at what time intervals the sample was taken.

To really do all of this correctly one should read a text on numerical analysis or take a course on the subject.
Logged
 



  • Print
Pages: [1]   Go Up
« previous next »
Tags:
 

Similar topics (5)

Must ∞ monkeys on ∞ typewriters really write everything given ∞ time?

Started by chiralSPOBoard General Science

Replies: 28
Views: 24401
Last post 28/03/2020 11:42:26
by yor_on
We Know The Extent Of The Sun, What Is The Extent Of Space Time?

Started by TitanscapeBoard Physics, Astronomy & Cosmology

Replies: 2
Views: 10970
Last post 27/04/2008 23:10:10
by turnipsock
What does "time-like" mean in the following sentence?

Started by scheradoBoard Physics, Astronomy & Cosmology

Replies: 15
Views: 9046
Last post 09/02/2018 10:28:21
by Colin2B
If you could travel faster than light, could you travel in time?

Started by DmaierBoard Technology

Replies: 13
Views: 14073
Last post 19/03/2020 14:56:52
by Paul25
If the speed of light is constant, time must be constant too?

Started by Chuck FBoard General Science

Replies: 4
Views: 11704
Last post 19/03/2020 14:51:12
by Paul25
There was an error while thanking
Thanking...
  • SMF 2.0.15 | SMF © 2017, Simple Machines
    Privacy Policy
    SMFAds for Free Forums
  • Naked Science Forum ©

Page created in 0.229 seconds with 62 queries.

  • Podcasts
  • Articles
  • Get Naked
  • About
  • Contact us
  • Advertise
  • Privacy Policy
  • Subscribe to newsletter
  • We love feedback

Follow us

cambridge_logo_footer.png

©The Naked Scientists® 2000–2017 | The Naked Scientists® and Naked Science® are registered trademarks created by Dr Chris Smith. Information presented on this website is the opinion of the individual contributors and does not reflect the general views of the administrators, editors, moderators, sponsors, Cambridge University or the public at large.