Kinematics

Processing kinematic data

There's plenty of scripts/programmes knocking around the internet to process kinematic data. I use Matlab scripts adapted from those developed by Gord Binsted and colleagues to process my kinematics. These scripts seem to work on all versions of Matlab, but do require the signal processing toolbox. First word of warning - I don't do much kinematic work that much these days, and the non-specificity of the code and the few quirks certainly reflect this. That being said, almost all simple end-effector kinematics (i.e., not looking at the coordination between body parts) adhere to the same principles and methods, so hopefully the advice in this wiki will generalise to some degree.

Before we start, a word about data. This program will deal with data in of the usual formats (.txt, .tsv, .csv), but must have no headers and have the data arranged in x y z for each marker (with x in the first column - no time stamp). If your data collection package has helpfully calculated velocity for you, this is not the analysis package for you (or you could spend a bit of time adapting the code here - it wouldn't be difficult). The file at the bottom of this page has some sample data files for reaching trials and grasping trials.

Anyway, for 'my' standard kinematic analysis download and unzip the file attached this page, and dump it in your Matlab root directory (remembering, of course, to select 'add to path'). Then run 'Qual_reach.m', which will bring up an entry window where you can select/alter some parameters. The main thing may may want to change in this window is your recording frequency (120Hz for my Optitrak system, 200Hz for a typical Qualisys setup, or 240Hz for a top-of-the-line Optotrak Certus. Getting this number right is important - it's not something you can guess at. Beyond that, you can set our onset/offset thresholds to a value lower than 50 if you want (don't go higher unless you have weird movements), and change your filter cutoff (10Hz is the minimum you'd want this to be). Once you have selected your various parameters, press 'OK', which will bring up a window which you can use to navigate to your data folder. Here, select all the files you want to analyze. 

If you're dealing with reaching and pointing data 

This sort of data is reasonably simple to work with, but actually gives you a ton of different data. Once you have selected your data, a bunch of windows will pop up which shows various different views of your data. The main thing you need to pay attention to is the bottom-left window, showing your data's velocity profile, which shows the vector sum of the x, y, and z velocities (known as 3d velocity, resultant velocity, or 's'). From this, the program figures out your key kinematic variables: reaction time (first frame when the speed goes above 50mm/s), movement end time (first frame after RT where it falls below 50mm/s), the peak velocity, time to peak velocity relative to RT, and the duration of the movement. The green and red lines in this plot represent the start and end of the movement. If you're not happy with how they've been identified (e.g., a twitch giving a 'false start', or the slight 'bounce' on landing in the example below) you can choose to edit the start and end points - just click edit and then use the cursor to select the new start and end (only click the velocity window - this program is pretty dumb). The pink line shows peak velocity, and cannot be edited.

You probably get the sense that such a dumb program is readily fooled, and you'd be right. But if you run experiments such that there is only a single ballistic movement while the motion tracker is recording, you can make you life a ton easier at this stage.

Churn through all your data, and once you have finished you can save the file, and then inspect your new excel file, which has each trial as a row and each of your many DVs as a column. You'll need to put in the trial order (your conditions etc) manually.