A lift tool was instrumented to measure the acceleration of the lower beam. A Nexus 6 android phone was used as the data acquisition device with the help of the Physics Toolbox app. Multiple lifts were performed. Acceleration in three axes and the total magnitude were recorded and uploaded to a cloud storage provider as a csv file.
We want to extract the spectral information from the acceleration time series. We use the discrete fast fourier transform (DFT or FFT) to compute the acceleration versus frequency.
import numpy as np
import pandas as pd
import datetime
import scipy
from pint import UnitRegistry
u = UnitRegistry()
import matplotlib
import matplotlib.pyplot as plt
import pylab
%matplotlib inline
%config InlineBackend.figure_format = 'svg'
acc = pd.read_csv('guardian_accelerometer_data_20160526.csv',
header=0,
names=['time',
'x',
'y',
'z',
'magnitude'],
dtype={'time':datetime.time,
'x':np.float64,
'y':np.float64,
'z':np.float64,
'magnitude':np.float64})
Fix time column
from dateutil.parser import parse
def munge_time(x):
return parse(':'.join(x.split(':')[:-1]))
acc['time'] = acc['time'].map(munge_time)
print(acc)
ax = acc.plot(x='time',
y='magnitude')
ax.set_ylabel("Acceleration (g)")