week 4
Page 1
Data Filtering in Biomechanics – Outline topics:
Motion Analysis
Measurement of Forces and Movement
Electromyography (EMG)
Data Filtering in Biomechanics
Free Body Diagrams
Quantitative Biomechanics Applications
Example visualization: Angular velocity (rad/s) vs Frame number
Data series: Raw → 2nd Order → 6th Order smoothing
Indicates how higher-order polynomial fits can smooth motion signals across frames
Page 2
Overview of key concepts:
Noise and Errors: All measurements include error; errors are magnified by differentiation (e.g., displacement to velocity to acceleration)
Polynomial Functions: used for curve fitting to smooth data
Fourier (Frequency) Analysis: decomposes signals into frequency components
Digital Filters: remove unwanted frequency content (noise)
Roll-off and the cut-off frequency: how filters attenuate frequencies beyond a chosen threshold
Force Data – moving average: smoothing of force-time data
EMG: band-pass filters, RMS, and integration
Frequency Analysis and EMG: examine how EMG spectra change with conditions (e.g., fatigue)
Noise and Errors details:
Measurements contain error; differentiation amplifies noise
Example context: displacement data can be inherently noisy; smoothing improves velocity/acceleration estimates
Techniques to reduce error/noise:
Curve Fitting: derive mathematical functions (polynomials, Fourier series) to represent data
Smoothing: averaging or frequency manipulation to reduce irregularities; digital filters (e.g., Butterworth)
Additional notes:
The smoothing and filtering approach should be conservative to avoid removing true signal components
Page 3
Data Smoothing: Polynomial fitting
Polynomial Functions:
A line of best fit minimizes residual error (difference between data points and fit)
Most data are not linear, so curves are fitted using polynomial functions
Influence of polynomial order:
x^2 + 3 (quadratic) has one inflection point
x^3 + x^2 + 3 (cubic) has two inflections
Higher-order polynomials (e.g., 5th or 7th power) can provide better fits for some data
Visual examples:
Quadratic, Cubic, Higher-order polynomials (illustrative)
Page 4
Polynomial Functions in practice:
Regression analysis (best fit) determines the appropriate polynomial expression
Approach: find the curve where the residual (difference between filtered and raw data) is minimized
Velocity and acceleration are obtained by differentiation with respect to time: v = rac{dx}{dt}, \, a = rac{dv}{dt}
Different data segments may require different polynomial forms; combine piecewise functions as needed
Block-wise approach: select blocks of data and identify the function that minimizes the average residual error
Frequency Analysis (a method of filtering out unwanted information):
Decomposes data into frequency components to identify where noise lies
Page 5
Fourier Analysis basics:
Data can be represented as a sum of sine waves at different frequencies placed in the time domain
The signal with the largest amplitude is called the fundamental frequency: f_1
Harmonics of the fundamental are added to fit the data: f2 = 2 f1, f3 = 3 f1, \, ext{etc.}
Higher harmonics are required for signals with many peaks/troughs
Conceptual summary:
Fourier synthesis builds the signal from sine waves; Fourier analysis reveals the frequency content and power of each frequency component
Page 6
Fourier Analysis in the frequency domain:
Data moved from time domain to frequency domain provides frequency content information
Applications: compare signals by their spectra
EMG frequency content and fatigue:
EMG may shift to lower frequencies as fatigue develops, even if amplitude increases
Fatigue-related changes can reflect motor unit recruitment shifting toward fatigue-resistant units with lower firing frequency
Visual reference:
Example: EMG power spectrum during a fatiguing contraction shows a leftward shift (lower frequencies dominate)
Non-invasive power-spectrum analysis can reflect motor unit activity and muscle fiber type contributions
Digital Filtering context:
Filtering aims to produce a smoothed data set by targeting known noise bands in the spectrum
Page 7
Digital Filtering overview:
Purpose: reduce unwanted components in a signal
In motion analysis, true position = true signal + error; errors are random, often high-frequency (e.g., around 50 Hz)
Digital filters modify (remove) the region of the power spectrum where noise is known to reside
True signal and noise can overlap; filters should be conservative to avoid chopping out genuine signal
Digital Filter workflow:
Step 1: identify the frequency that separates true data from noise (Cut-off Frequency, fc)
Step 2: at the cut-off, amplitude is reduced to 0.70 of the original (power ~ 0.50, or 0.72 in some references)
Step 3: typical cut-off for human movement with Butterworth filter is fc ≈ 6 Hz (smaller fc ⇒ more filtering)
Step 4: choose fc using residual analysis or published values; fc may differ by marker
Page 8
Choice of Cut-off Frequency – Residual Analysis workflow:
Step 1: filter data across a range of cut-offs (e.g., 3 Hz to 20 Hz for movement data)
Step 2: compute residuals: Residual = Observed − Predicted between smoothed and raw data
Step 3: plot average residual error versus frequency
Step 4: identify fc where the residuals reach an appropriate level (example given ~5.2 Hz)
Notes:
The optimal fc may differ for different markers
Published cut-offs can be used as references
Residual plotting concept helps select a balance between noise reduction and signal preservation
Page 9
Example Residual Plot – Biomechanics and Motor Control of Human Movement (Winter 2009): 1) Filter raw data across test range with frequencies from 1 to 10 Hz in 0.1 Hz intervals, aiming for 2.5 to 6 Hz 2) Compute RMSE between raw and filtered data after each frequency filtering 3) Plot RMSE vs frequency (blue solid line on axes) 4) Residual plots show gradual RMSE increase at higher frequencies, then a sharp rise as the signal becomes affected 5) Extrapolate Y-intercept of the tail (gray dashed line); the intercept indicates a threshold value (red dashed line)
The chosen cutoff frequency is where RMSE surpasses this threshold
Page 10
Example interpretation of cutoff frequency:
The clean, slower movement yields the lowest calculated cutoff frequency
A faster movement (e.g., snatch video target tracking) yields a higher calculated cutoff frequency
Roll-off concept:
Filters do not cut off at a single frequency; instead, they roll off gradually around the cut-off
The cutoff frequency and the roll-off behavior determine how much of the signal around fc is attenuated
Page 11
Roll-off basics:
The amplitude of a biomechanics signal is the reference; filters reduce amplitude of frequencies away from DC
Filter order effects:
First-order filter: attenuation increases with frequency; commonly described as reducing amplitude as frequency doubles beyond fc
Second-order filter: attenuation increases more rapidly with frequency beyond fc
Higher-order filters have faster roll-off but more phase shift
Trade-offs:
Faster roll-off improves attenuation of noise but introduces more phase (timing) shift
It is important to quote and document the roll-off when reporting results to communicate potential timing inaccuracies
Cut-off frequency interpretation:
The cut-off often corresponds to a point where signal power is reduced to 50% (amplitude ~0.707) of the original
In some contexts, amplitude reductions of ~0.70 and power reductions of ~0.50 (or ~0.72) are referenced
Page 12
Digital Filter specifics:
Butterworth filters are common; they can introduce phase distortion
Phase distortion can be removed by applying the filter forward and then backward in time, yielding a zero-lag filter
Example: fourth-order Butterworth low-pass with fc = 6 Hz is used to achieve fast roll-off with reduced phase distortion
Practical note on data collection for filtering:
Filtering requires collecting more data than strictly necessary to filter reliably (to avoid edge effects during smoothing)
Ball-toss example: acceleration should be close to the constant 9.81 m/s²; plan data collection accordingly to allow filtering without losing the signal
Page 13
Force Data filtering and smoothing:
Similar methods as motion data apply to force data (digital filters, curve fitting, etc.)
Filtering may not always be necessary if only peak values are of interest
Important to remove higher-frequency noise by selecting an appropriate cutoff frequency
Force data smoothing options:
Moving average as a smoothing technique
5-point moving average: ext{MA}{n} = \frac{x{n-2} + x{n-1} + xn + x{n+1} + x{n+2}}{5}
The number of points in the window controls the smoothing level; more points = more smoothing
Example visualization:
Raw force data vs. filtered (e.g., 10 Hz) data
Page 14
Moving Average details:
Degree of smoothing depends on window size
End effects: fewer data points available for averaging at the ends of the series
Example graph: Force (N) vs Time (s) with Raw, 5-point, and 10-point smoothing curves
EMG data basics:
EMG is a complex signal composed of action potentials from multiple motor units
Action potential shapes and frequencies vary with motor unit type, activation level, electrode location, fatigue, and tissue filtering
EMG frequency content typically lies in the range 10–400 Hz, with median around 50–110 Hz
Low-frequency components (<10 Hz) can arise from poor equipment, lead movement, etc.
High-frequency components arise from electrode movement, 50 Hz interference, other signals (10–500 Hz), vibration, and environmental noise
Page 15
Band-pass (digital) filters:
High-pass: passes frequencies above a chosen threshold (e.g., >10 Hz)
Low-pass: passes frequencies below a threshold (e.g., <500 Hz)
Band-pass: passes frequencies in a specified range (e.g., 10–500 Hz)
These filters remove much of the noise from EMG signals
Other EMG noise reduction techniques:
RMS and integrated rectified value (IRV), both forms of moving-average processing
RMS has a physical interpretation as a form of averaging over a window
Integration (area under the rectified EMG curve) also common and often performed in software
Alternatively, BM (Butterworth) filtering with a cut-off similar to movement frequency (e.g., ~5 Hz) can give the same effect
EMG data processing goals:
Isolate meaningful muscle activation signals from noise and motion artifacts
Page 16
EMG Frequency analysis:
Use Fourier Transform to assess frequency content
Report mean or median frequency (differences are typically small)
Fatigue effect example: mean/median frequency tends to decrease with fatigue due to changes in conduction velocity and fiber recruitment patterns
Rationale for data smoothing in Biomechanics:
Smoothing displacement improves the reliability of velocity and acceleration estimates
Integrating smoothed data improves acceleration estimates
When fitting polynomials to raw biomechanics data, select blocks that minimize the average difference between raw and smoothed data (smallest residual error)
Fourier analysis helps identify dominant frequencies and their power content, guiding smoothing decisions
Digital filters modify the power spectrum to remove noise and produce a smoothed data set
Final point:
Any questions? This is the moment to clarify concepts like cut-off selection, roll-off trade-offs, and the interpretation of frequency-domain analyses for EMG and movement data