



Calculating angles in 2D from marker coordinates  2Dangles.xls  ZongMing Li, PhD
Musculoskeletal Research Center Department of Orthopaedic Surgery University of Pittsburgh See Discussion 
The tan function is usually used to derive angle from
2D coordinate data. Unfortunately, it goes negative in the second quadrant
(>90º). This can be avoided by using the atan2 function. However,
this too goes negative in the fourth quadrant, so a test must be made to
detect this and correct the result by adding 360º. So the complete
algorithm is as follows:
ATAN2(x,y) returns an angle between p
and p
A solution using atan is also given in case the atan2 function is not available. 
Javascript digitizer  Cycling example #1, #2, #3, #4, #5, #6  Chris Kirtley  Video needs to be saved as separate JPG image files using, e.g. QuickTime export function, and numbered 01, 02, 03... etc. Wait for each image to be loaded. 
Automatic marker tracking  MaxTRAQ  Innovision Systems  Free 15 day trial 
Finite Impulse Response (FIR) Criticallydamped
Lowpass Filter
4th order Butterworth 
FIRfilter.xls  Jim Martin
See Discussion 
The Hamming coefficients are calculated first:
H(0)=(1/freq)*cutoff*2
...then the tap coefficients themselves:
The filter equation is then:

Infinite Impulse Response (IIR) Criticallydamped Lowpass Filter 4th order (twopass) Butterworth  IIRfilter.xls  Chris Kirtley (from David
Winter's "Biomechanics and
Motor Control of Human Movement") 
y_{t }= a.x_{t } + b.x_{t1 } + c.x_{t2 } + d.y_{t1 } + e.y_{t2} w_{c} = tan(f_{c} * p/N) where f_{c} = cutoff frequency required and N is the sampling rate (e.g. frame rate of video for kinematics). Divide cutoff by 0.802 to take account of two passes (see below): e.g. for 6 Hz cutoff, set frequency to 6/0.802 = 7.48 Hz K_{1} = Ö2
* w_{c
}, where w_{c}
= 2pf_{c}
After the first (forward) pass of the filter, phase distortion is introduced (as shown in the demo). This is removed by a second (backward) pass (note the improved correlation), of equation: 
Highpass Filter
4th order (twopass) Butterworth 
HighPass.xls  Peter Sinclair
School of Exercise and Sport Science University of Sydney 
A double pass filter like the butterworth filter provided
by Chris
Kirtley. Filter equations were published by Murphy and Robertson, JAB 10(4): 374381, 1994. Like Chris's filter, there is potential for endpoint distortion because of the lack of prior filter values. I have chosen to automatically use the raw values here, knowing that there can be some distortion and caution should be exercised near the end point. For use of the filter, simply drop your data into column
A and

Resampling data to enable matching of two data sets recorded at different sampling rates  Resample.xls  Li Li, PhD (modified from a program
by D. Gordon Robertson, University of Ottawa) Department of Kinesiology Louisiana State University http://kin16.kin.lsu.edu 
Linear interpolation using Excel Macro. Can be used for both down and up sampling. Since it uses a macro, you'll need to adjust your security settings to make it operational. Select ToolsMacrosEdit to see the script. 
Fourier analysis to calculate Median Power Frequency  MedianFreq.xls  Peter Sinclair
School of Exercise and Sport Science University of Sydney 
Uses the Fourier Analysis tool within Excel to analyse
a signal
and report Median Power Frequency. Fourier Analysis is an option from the Analysis Toolpack AddIn that comes with Excel. It only works with a binary number of data points (1024, 2048, 4096, etc). This particular sheet is designed for a sample frequency of 1000 Hz and analysis of 4096 points, but can be modified for other values. Data is dropped into column A. Select Tools  Data Analysis  Fourier Analysis. Input range must be cells $A$2:$A$4097, output range must be cell $H$3. Fourier Analysis outputs an array of complex numbers specifying
Median Frequency is calculated as the frequency corresponding to half the area of the Power  Frequency curve (Bartlett, 1997, p245). Column L calculates a cumulative sum of the powers and the Median Power Frequency is displayed in cell $0$6. 
Residual Analysis to calculate suitable filter cutoff frequencies  Resid.xls  Peter Sinclair
School of Exercise and Sport Science University of Sydney 
This sheet contains a macro to repeatedly apply a 4th
order
Butterworth filter to analyse the pattern of residual error vs smoothing frequency (Winter, 1990). Data is dropped into column A and the formulae from columns
BD
Cells G10G20 contain frequencies to be applied in the
residual
The resulting graph has a line ready for you to move yourself
by

Center of Mass from Force Platform Integration  com.xls  Chris Kirtley  Integration of Ground Reaction Force over three successive steps, to derive acceleration, velocity and displacement of body CoM. CoM from total body kinematics shown for comparison. Note importance of accurate body mass and initial velocity estimates. In the vertical direction, the starting velocity can be found by integrating (using initial velocity = 0) to find the mean velocity, v_{o}:  v_{o} can then be used as the initial velocity to correct the integration. Note this only works for the vertical direction, and only if the mean vertical velocity is truly zero. 
SavitskyGolay Smoothing  SG.xls  D.Acosta, Univ. Florida  SavitzkyGolay seeks to preserve shapes of peaks. 
Statistics  WinStat  free 30 day trial  R. Fitch  Broad range of statistical funtions, including ANOVA, crosscorrelation, polynomial regressions, etc. 
Please send your submissions
or suggestions to Chris Kirtley
Back to Clinical Gait Analysis home page