Reading material lecture II
Biomechanics of Movement by Ucida and Delp chapter 1, 2, 4 and 7
CH1 - Basics
We now have recommendations for the daily physical activity levels we require to stay healthy, and
we have access to tools that help us achieve our fitness goals. Assembly lines, office furniture, and
many consumer products are designed ergonomically to improve comfort and prevent injury.
Products and procedures have been designed to replace hip and knee joints, reducing pain and
restoring function to millions of people with osteoarthritis. Powered exoskeletons are revolutionizing
post- stroke rehabilitation and can enable locomotion in individuals with paralysis. Movement
disorders such as Parkinson’s disease have been successfully treated using deep brain stimulation, in
which implanted electrodes deliver electrical impulses to specific regions of the brain. Epidural
stimulation, a technology that activates neural circuits in the spinal cord, has recently shown promise
for helping to restore voluntary movement to individuals with spinal cord injuries. Athletes are
benefiting from equipment and training programs designed to reduce injury risk
while enhancing performance.
In a forward dynamic simulation, we prescribe a pattern of neural activation of one or several
muscles, and then predict the resulting motion of a musculoskeletal model (Figure 1.12).
Experimental data are required to develop and test the mathematical models of musculoskeletal
dynamics that are used in simulations of movement, and to evaluate the degree to which simulations
reflect reality. The reverse process is often used when we have measurements of the motion of a test
subject and we want to convert these data into meaningful insights, such as what forces must have
been generated by the muscles to produce the measured motions. For this we need an inverse
dynamic analysis, a common analytical strategy that combines experimental data with
musculoskeletal models. The first step is to use a biomechanical model of the body to convert
measurements of marker positions, as shown in Figure 1.10, into joint angles through a process
called inverse kinematics (Figure 1.13).
CH2 - Walking gait cycle
Step width is approximately
10 percent of leg length in healthy adults.
Positive and negative foot progression angles are referred to as toe-out and toe-in angles,
respectively.
Ground reaction forces
The “action” forces generated by muscles result in “reaction” forces applied by the ground to the
foot. Ground reaction forces can be measured during walking with a force plate, an instrument that
measures the forces in the vertical, anteroposterior (fore–aft), and mediolateral (side-to-side)
directions as a person walks over the plate. Ground reaction forces are important because they
provide a measure of how the body’s center of mass is accelerating at each instant in time. We can
use Newton’s second law to relate the ground reaction forces and other external forces to the
acceleration of the center of mass ( COM ) of a body: Fexternal – mg = maCOM.
When both feet are contacting the ground, we must add the forces applied to each foot. Because the
Equation is a vector sum, directions matter. The vertical components of the forces under both feet
support the body’s weight.
Skeletal model for gait analysis
Anatomical joints are complex, with adjacent body segments translating and rotating relative to each
other in all directions. At every instant while we are walking, we are simultaneously controlling more
than a dozen angular positions, without being aware of it. As we have seen, walking is a three-
dimensional activity, and non-sagittal-plane motions and forces must be analyzed to understand
balance and body- weight support.
Kinematics of walking
Ground reaction forces and walking speed
Atypical gait
Crouch gait is characterized by excessive flexion of the knee during the stance phase. Excessive knee
flexion is problematic because it increases forces in the knees during stance, impedes toe–ground
clearance during swing, and dramatically increases energy expenditure.
Many persons with cerebral palsy, as well as individuals who have had a stroke, walk with a stiff-knee
gait in which swing- phase knee flexion is diminished and delayed (Figure 2.22). This gait pattern also
hinders toe-ground clearance and can result in tripping or require compensatory movements that are
energetically inefficient. Stiff- knee gait is thought
to be caused primarily by inappropriate activity of
the rectus femoris muscle, which crosses in front of
the knee via the patella and produces a knee
extension moment.
Changes in walking under various conditions
Humans are efficient walkers. In the best case, we
simply fall forward and then step to catch ourselves
from falling, injecting a little energy to make the
transition between steps and to swing our legs.
These are changes observed when walking in
various conditions
CH4 – Electromyography
When muscle is excited by the nervous system, it generates a small
electrical signal. Roughly speaking, the greater the stimulation arriving to a muscle via the motor
neurons (either from a higher frequency or greater recruitment), the larger the electrical signal
will be. Thus we can measure the level of muscle activity using electromyography ( EMG ), which, as
its name suggests, records electrical activity in the muscle.
Modeling muscle activation dynamics
The model accepts as input a time- varying function u(t) that describes the strength of the excitation
signal from the nerve to the muscle. Its output, a(t), is the activation, which represents the
availability of calcium ions within the intracellular space and, thus, the extent to which cross-bridge
cycling can occur. Both u(t) and a(t) vary between 0 (no excitation; no cross- bridge cycling) and 1
(maximum excitation; fused tetanus and all motor units recruited).
CH7 – Measurement techniques
Accurate kinematic measurements can also be obtained by implanting bone-anchored pins that
protrude from the skin and tracking the motion of these pins using optical techniques. As you might
expect, the invasiveness of this procedure makes it impractical for most research studies. Inertial
measurement units ( IMU s) have become popular as a low-cost alternative to existing strategies for
quantifying movement. IMU s typically comprise accelerometers for measuring linear accelerations,
gyroscopes for measuring angular velocities, and a magnetometer for measuring heading relative to
magnetic north. In many studies, IMU s eliminate the need for cameras and controlled lighting
conditions, which enables one to perform biomechanical experiments in natural environments,
during activities like swimming and trail running, and over long durations to capture infrequent
events or to monitor health.
Optical motion capture
Motion capture, or “mocap,” has evolved over nearly a century. We use a series of images to
determine what the underlying bones and muscles were doing to produce an observed motion. We
affix small spherical retroreflective markers either to the subject’s skin or onto plates that are then
attached to the subject’s body (Figure 7.6). Video cameras track the motion of these markers,
typically using infrared light. Operating in the infrared spectrum has two benefits: it reduces the
effects of ambient light and allows for pulsed illumination to reduce motion-blur artifacts.
In general, three noncollinear markers must be placed on a body segment to determine its position
and orientation in space. Fewer than 3n markers can track n body segments if some markers are
assumed to be common to adjacent segments (e.g., if the marker on the lateral side of the knee is
assumed to remain fixed relative to both the thigh and the shank). It is also possible to reduce the
number of markers by using a kinematic model of the underlying skeleton. However, using more
markers may improve joint angle estimates for some inverse kinematics algorithms. Each camera
records a series of 2 D images, capturing the location of each marker in that camera’s local 2 D image
plane over time (Figure 7.7). For each time frame, a computer combines the location information
from all cameras with knowledge of the relative position and orientation of each camera in space
(determined during an earlier calibration procedure) to estimate the 3 D location of each marker
relative to a “global” laboratory reference frame. Because a single image does not provide accurate
information about the distance between the camera and a marker, each marker must be visible by at
least two cameras to determine its location in space. Increasing the number of cameras in the lab
and the distance between them can improve marker location estimates, account for temporary
marker occlusion that occurs as the subject moves, and enlarge the volume through which the
subject’s movement can be measured. hen a mocap system is calibrated and operated correctly,
marker measurement errors are no greater than a few millimeters in a typical biomechanics
experiment.
Soft-tissue artifacts are unavoidable, but their effects can be reduced by placing markers in strategic
locations and by using algorithms that account for these artifacts. When studying obese subjects, for
example, we press a calibration wand of known length against the skin until the tip of the wand
reaches the anatomical landmark. We capture a single frame of video to calculate the location of the
tip from the positions of markers mounted along the length of the wand. This information gives us a
relationship between the position of the markers on the skin and the location of the anatomical
landmark, which we can then use to estimate the trajectory of the anatomical landmark during
motion trials. It can also be useful to define virtual markers at joint centers, the locations of which
can be estimated using the trajectories of
skin- mounted markers as the joint moves
through a large range of motion.
For example, we often want to obtain velocity
data by taking the derivative of the measured
position data. But differentiation amplifies the
high- frequency noise that these data typically
contain. One way to avoid this is to smooth
the data with a low-pass filter, which removes
high-frequency motion. A label must be
applied to each marker in each frame of
video. We may need to assign these labels
manually or correct errors that were made by
an automated labeling method.
We may be interested in frequencies up to about 3 Hz for studying posture, 6 Hz for studying
walking, and 10– 15 Hz for studying running. By contrast, frequencies up to 300 Hz may be relevant
in a study of rapid changes in motion during the heel strike of running.
Lecture II Processing human movement data - M.I. Refai (07-02-2024)
There are several tools for measuring movements:
1. Optimal markers (VICON, Qualisys)
a. For long period of time
b. Friendly use
2. Moving fluoroscopy (ETH)
3. Electromagnetics (Polhemus)
4. RGBD cameras (Theia, OpenSens)
5. Electromechanical (Gypsy suits)
6. Inertial (Xsens)
But, optimal markers are used most. Optoelectronic motion capture pipeline looks like:
Camera calibration can be done using a calibration wand or anything with a known length.
Furthermore, for subject calibration, a T-pose is done. The markers should also be labelled (in 2D is
fine).
Interaction forces can most efficiently be measured using ground reaction plates and pressure
insoles. Ground reaction plates measure in 3D (so x, y z axes). So, technically, there are always ‘side-
ways vectors’ (mediolateral side view), where one foot basically peaks in block-form during
movement and the other then does the opposite (it dips the same way).
So, the ground interaction force is an external force.
Internal body forces are for example the reaction force of the lower leg if the body weight is placed
upon it, on the condition that the muscles are active. So this muscle activity can be measured using
EMG.
Marker trajectories need to be reconstructed and sometimes errors are made.
After every measurement, you could apply: merging of trajectories, gap filling/ interpolation
(when markers are missed) or de-noising.
Low-pass filter removes all high-frequency noise
o Cut-off frequency is dependent on activity that is tested
o Gait/walking cut-off frequency is 6 Hz
Filtering always causes a delay so you should apply the filter back and forth using ‘filtfilt’
! When you don’t apply these and keep in the noise, this noise gets amplified during differentiation
(which you do going from position to velocity to acceleration).
Then, raw EMG data also has to be processed. The signal is quite easy to interpret: the stronger the
contraction, the higher the signal amplitude.
For walking, 25-400 Hz is interesting. Since only amplitude is enough and the raw signal has both
positive and negative mirrored amplitude, it can be flipped to one side only using ‘rectification’.
Then, low-pass filtering can be applied so the filtered EMG shows a smoothened signal. This signal is
useful for analysing muscle activity only. If you want to know brain-linked activity, all little signal
frequencies are important tho.
Matlab Processing
Filtering EMG
clear all; close all; clc;
load('28kmh.mat');
EMGraw = qtm_28kmh.Analog.Data(17,:)'; % EMG signal (the
channels should be in columns)
fs = qtm_28kmh.Analog.Frequency; % Sampling frequency
(typically 2048)
HPfreq = 30; % High-pass filter cut-
off frequency
LPfreq = 6; % Low-pass filter cut-
off frequency
[bHP,aHP] = butter(2,HPfreq/fs/2,'high'); % Create high-pass
filter (2nd order, butterworth). You could also choose higher orders
[bLP,aLP] = butter(2,LPfreq/fs/2,'low'); % Create low-pass
filter (2nd order, butterworth)
%%
% EMG filtering pipeline to extract the linear envelopes
EMGhp = filtfilt(bHP, aHP, EMGraw); % High-pass filtering
EMGrect = abs(EMGhp); % Rectification
EMGlp = filtfilt(bLP, aLP, EMGrect); % low-pass filtering to
extract linear envelopes
%% Add your code here
% Select one muscle (e.g., rectus femoris) and plot (use subplot) the high-
pass filtered signal,
% the rectified signal, and the low-pass filtered linear envelopes.
figure;
subplot(4,1,1); plot (EMGraw); xlim([1 length(EMGraw)]); title('EMG
filtering pipeline');legend('Raw');subplot(4,1,2); plot(EMGhp); xlim([1
length(EMGhp)]);legend('HPF'); subplot(4,1,3); plot(EMGrect);xlim([1
length(EMGrect)]);legend('Rectified');
subplot(4,1,4);plot(EMGlp);legend('LPF'); xlim([1 length(EMGlp)]);
xlabel('Time');
1. Loading Data & Extracting EMG Signal
The script loads EMG data from 28kmh.mat.
EMGraw = qtm_28kmh.Analog.Data(17,:)'; extracts one EMG channel (17th analog channel).
fs = qtm_28kmh.Analog.Frequency; defines the sampling frequency (typically 2048 Hz).
The EMG signal is oscillatory due to alternating electrical activity of muscles.
2. Defining Filters
A high-pass filter (HPF) with 30 Hz cutoff removes movement artifacts.
A low-pass filter (LPF) with 6 Hz cutoff extracts the linear envelope (smooth activation
signal).
Butterworth filters (2nd order) are created for both HPF & LPF.
3. EMG Filtering Pipeline
1. High-pass filtering (EMGhp = filtfilt(bHP, aHP, EMGraw);)
o Removes low-frequency noise (e.g., motion artifacts) while keeping muscle activity.
2. Rectification (EMGrect = abs(EMGhp);)
o Converts negative values to positive, ensuring all muscle activity is represented.
3. Low-pass filtering (EMGlp = filtfilt(bLP, aLP, EMGrect);)
o Extracts the linear envelope, representing the muscle activation intensity over time.
4. Additional Notes & Considerations
Analog data structure stores EMG signals, and labels 17-24 correspond to muscles.
Fs must match the sampling frequency of the dataset to ensure proper filtering.
If selecting a marker like RS3, reshape the data appropriately (reshape may be needed for
spatial marker data but not EMG).
The EMG signal is oscillatory due to alternating muscle fiber depolarization and
repolarization.
Filtering GRF
clear all; close all; clc;
load('28kmh.mat');
%% Extract GRF data
% GRF data is saved within field name Force
force_right = qtm_28kmh.Force(1).Force';
force_left = qtm_28kmh.Force(2).Force';
%% Add your code here
fs = 2048; % Fill in the
sampling frequency value (refer to the Force struct field)
LPfreq = 20; % Assign the cut-off
frequency of the low-pass filter
%% Add your code here
[bLP,aLP] = butter(2,LPfreq/fs/2,'low'); % Create low-pass
filter (2nd order, butterworth). You could also choose higher orders
force_left_filt = filtfilt(bLP,aLP,force_left);
force_right_filt = filtfilt(bLP,aLP,force_right); % Filter forth and back
to avoid delaying the signal
%% Plot the raw and filtered marker trajectory
figure;
subplot(211); plot(force_right_filt);
ylabel('Force Right (N)')
subplot(212); plot(force_left_filt);
legend('X','Y','Z')
xlabel('Frames');
ylabel('Force Left (N)')
1. Loading and Extracting GRF Data
The script loads the 28kmh.mat file.
qtm_28kmh.Force(1).Force' → Right foot GRF is extracted.
qtm_28kmh.Force(2).Force' → Left foot GRF is extracted.
Forces are stored in rows (frames over time), and each column corresponds to an axis:
o Column 1 → Front-to-back force (X-axis)
o Column 2 → Side-to-side force (Y-axis)
o Column 3 → Vertical ground reaction force (Z-axis, important for gait analysis)
2. Defining the Low-Pass Filter
fs = 2048; → Defines the sampling frequency (should match dataset).
LPfreq = 20; → Low-pass filter cutoff frequency is set to 20 Hz.
butter(2,LPfreq/fs/2,'low') → Creates a 2nd order Butterworth filter for smoothing GRF
signals.
3. Filtering GRF Data
filtfilt(bLP, aLP, force_left) → Applies the filter twice (forward & backward) to avoid phase lag.
Same filtering is applied to the right and left GRF signals (force_right_filt).
This removes high-frequency noise, making the force signals more interpretable.
4. Plotting Raw vs. Filtered GRF Data
Subplot 1 → Right foot force (filtered)
Subplot 2 → Left foot force (filtered)
The legend ('X', 'Y', 'Z') clarifies which force components are displayed.
X-axis → Frame number (time steps in the dataset).
Y-axis → Force magnitude in Newtons (N).
5. Additional Notes & Considerations
Vertical GRF (Z-axis) is often the most important for gait analysis (used to detect foot contact
and toe-off).
Filtering is necessary to remove measurement noise and obtain a clean force signal.
Ensure correct axis interpretation to avoid confusion when analyzing forces.
RS3 Marker Processing
clear all; close all; clc;
load('28kmh.mat');
%%
% Extract RS3 (Labeled as marker 24) trajectory
RS3 = qtm_28kmh.Trajectories.Labeled.Data(24,:,:); % Raw RS3 marker data
RawRS3=reshape(RS3,[4,3840])';
fs = 128; % Sampling frequency
LPfreq = 6; % Low-pass filter cut-
off frequency (6Hz is the standard for gait)
[bLP,aLP] = butter(2,LPfreq/fs/2,'low'); % Create low-pass
filter (2nd order, butterworth)
%MarkersLP = filter(bLP,aLP, RawRS3);
MarkersLP = filtfilt(bLP, aLP, RawRS3); % Filter forth and
back to avoid delay of the signal
figure, plot(RawRS3(:,1)), hold on,
plot(MarkersLP(:,1)), hold on,
plot(RawRS3(:,2)), hold on,
plot(MarkersLP(:,2)), hold on,
plot(RawRS3(:,3)), hold on,
plot(MarkersLP(:,3)), hold off,
legend('x raw','x filtered','y raw','y filtered','z raw','z filtered')
xlabel('Frames')
ylabel('Position [mm]')
1. Loading and Extracting RS3 Marker Data
The script loads motion capture data from 28kmh.mat.
RS3 = qtm_28kmh.Trajectories.Labeled.Data(24,:,:); extracts the RS3 marker trajectory (24th
marker).
reshape(RS3,[4,3840])' reshapes the data for easier processing:
o Columns represent X, Y, and Z positions.
o The fourth column may represent measurement errors.
2. Defining the Low-Pass Filter
fs = 128; → Defines the sampling frequency.
LPfreq = 6; → Sets the low-pass filter cutoff frequency (6 Hz is standard for gait analysis).
butter(2,LPfreq/fs/2,'low') → Creates a 2nd-order Butterworth low-pass filter.
3. Filtering the Marker Data
filtfilt(bLP, aLP, RawRS3); applies the filter forward and backward, eliminating phase lag.
This smooths the marker trajectory, reducing noise while preserving motion patterns.
4. Plotting Raw vs. Filtered Marker Data
plot(RawRS3(:,1)) and plot(MarkersLP(:,1)) → X-axis raw vs. filtered.
plot(RawRS3(:,2)) and plot(MarkersLP(:,2)) → Y-axis raw vs. filtered.
plot(RawRS3(:,3)) and plot(MarkersLP(:,3)) → Z-axis raw vs. filtered.
Legend helps differentiate between raw and filtered trajectories.
X-axis: Frames (time steps).
Y-axis: Position in millimeters (marker coordinates).
Motion capture data
1. file
Likely contains metadata about the file, such as its name, format, or version.
Useful for keeping track of different recordings.
2. timestamp
Records the exact time when the data collection started.
Used for synchronization between different datasets (e.g., motion capture, EMG, and force
plates).
3. startframe
The frame number at which the recording starts.
Important for segmenting trials (e.g., extracting only the walking phase).
4. frames
The total number of frames in the dataset.
Determines how long the recorded session lasts.
If the frame rate is known, the total duration can be calculated:
Duration (s)=framesframerate\text{Duration (s)} = \frac{\text{frames}}{\
text{framerate}}Duration (s)=framerateframes
5. framerate
The sampling frequency of the motion capture system (frames per second, FPS).
Higher values = more precise tracking, but also larger datasets.
Typical values:
o Motion capture: 100–250 Hz
o EMG signals: ~1000–2000 Hz
o Force plates: ~1000 Hz
6. trajectories
Stores marker trajectories from the motion capture system.
Typically structured as: (Markers×Coordinates×Frames)(\text{Markers} \times \
text{Coordinates} \times \text{Frames})(Markers×Coordinates×Frames)
o Markers → Number of body markers used (e.g., 35 markers).
o Coordinates → X, Y, Z positions.
o Frames → Position data over time.
Used for kinematic analysis (joint angles, gait cycle, etc.).
7. analog
Contains analog data from additional sensors (e.g., EMG or other biosignals).
Typically structured as: (Channels×Frames)(\text{Channels} \times \text{Frames})
(Channels×Frames)
o Channels → Each muscle or sensor has a separate channel.
o Frames → The recorded signal over time.
EMG signals are typically high-frequency and require filtering before analysis.
8. force
Stores ground reaction force (GRF) data from force plates.
Typically structured as: (Forces×Coordinates×Frames)(\text{Forces} \times \text{Coordinates}
\times \text{Frames})(Forces×Coordinates×Frames)
o Forces → Separate values for left and right foot.
o Coordinates → X (anterior-posterior), Y (medial-lateral), Z (vertical).
o Frames → Force data over time.
Used for inverse dynamics and gait analysis (e.g., impact forces, joint loading).