🦾 Prosthetic Hand Control — EMG

EMG-driven prosthesis: surface electrodes detect motor unit action potentials. Signal features (RMS, MAV, ZC) classify intended grasp patterns with an LDA or SVM classifier.

RehabilitationInteractive
EMG channels (top) · Feature space (bottom-left) · Hand pose (bottom-right) · P pause · R reset

How it Works

Synthetic EMG signals are generated for each electrode channel based on the selected grasp intent and contraction level. Each motor unit fires stochastic action potentials whose amplitude and rate encode contraction. The signals pass through a 256-sample sliding window, features are extracted, and the classifier predicts the grasp class.

RMS = sqrt(1/N × Σᵢ x²ᵢ) [signal power proxy] MAV = 1/N × Σᵢ |xᵢ| [mean absolute value] ZC = Σᵢ sign(xᵢ) ≠ sign(xᵢ₋₁) [zero crossing count] LDA: y = argmax_c w_c · x + b_c [linear classifier]

Frequently Asked Questions

What is EMG in prosthetic control?

EMG (electromyography) measures electrical activity produced by muscle contractions. Surface EMG electrodes on residual limb muscles detect motor unit action potentials (MUAPs) processed to classify intended movements and control prosthetic hands with natural feel.

What are motor unit action potentials (MUAPs)?

A motor unit is one motor neuron plus all muscle fibres it innervates. When activated, all fibres fire simultaneously producing a characteristic electrical signature (MUAP). Surface EMG records the superposition of many MUAPs from multiple motor units firing asynchronously.

What EMG signal features are used for classification?

Common time-domain features include RMS (root mean square, related to signal power), MAV (mean absolute value), ZC (zero crossing rate, related to frequency content), SSC (slope sign changes), and waveform length. These form a compact feature vector for classifiers.

What is RMS in EMG?

RMS = sqrt(1/N × Σ x²ᵢ) measures the power of the EMG signal in a processing window. It is strongly correlated with muscle force and contraction level, making it one of the most useful and robust features for prosthetic control.

What is LDA classification in EMG?

Linear Discriminant Analysis (LDA) finds linear decision boundaries in feature space that best separate classes. It assumes Gaussian class distributions with equal covariance. LDA is popular in EMG prosthetics for its speed, low training data requirements, and good generalisation.

What grasp patterns can EMG control?

Modern pattern recognition systems classify 10-15+ grasp types: power grasp (cylindrical), pinch (lateral, tip), tripod, key grip, and individual finger extension. Clinical systems implement 4-6 most-used daily grips to balance versatility and reliability.

What are the main challenges in EMG prosthetic control?

Key challenges: electrode displacement during use, sweat changing electrode impedance, muscle fatigue shifting the EMG frequency spectrum, and the limb position effect (accuracy degrades when arm moves away from training position). Classification must work within 200-300 ms for natural feel.

What is the windowing approach in EMG processing?

EMG is processed in short windows (150-250 ms) with 50% overlap to produce a stream of feature vectors classified in real-time. Window length balances temporal resolution (short = more responsive) against reliable feature estimation (long = more stable).

What is the limb position effect in EMG?

Classifier accuracy degrades when the arm moves to positions different from training because muscle geometry and electrode contact change with posture. Mitigation includes training in multiple arm positions, position-adaptive classifiers, and data augmentation.

What is targeted muscle reinnervation (TMR)?

TMR is a surgical procedure redirecting nerves from the amputated limb to residual chest or arm muscles, creating new EMG sites. This gives amputees intuitive simultaneous control of multiple prosthetic joints and enables sensory feedback via somatosensory reinnervation.

About this simulation

This simulator generates synthetic multi-channel EMG by summing randomly-timed biphasic motor unit action potentials, with each of six grasp intents driving a distinct 8-channel activation pattern scaled by your chosen contraction level. A 256-sample sliding window extracts RMS, MAV, and zero-crossing-rate features, which are then fed to your choice of LDA, SVM, or kNN classifier to predict which grasp you intended.

🔬 What it shows

Live scrolling EMG traces across multiple electrode channels, the extracted feature values (RMS, MAV, ZC), and the classifier's predicted grasp with a confidence score — plus a schematic hand pose that reflects the recognized intent.

🎮 How to use

Select a Grasp intent, set Contraction level and Noise level, choose the number of Electrode channels, and pick a Classifier (LDA, SVM, or kNN) to see how well it recognizes the pattern under different signal conditions. P pauses, R resets.

💡 Did you know?

Every grasp in this simulator activates all eight channels to some degree — it's the relative pattern across channels, not any single electrode, that identifies the intended grasp, exactly matching how real multi-channel EMG prostheses rely on combined spatial patterns rather than isolated muscle signals.

Frequently asked questions

Why does turning up Noise level degrade the classifier's confidence?

generateEMGSample() adds (Math.random()-0.5)·noise·0.8 directly onto the summed motor-unit signal before feature extraction, so higher noise pushes RMS and MAV away from each grasp's clean expected values, making it harder for the distance-based classifier to confidently match the correct pattern.

Why does raising Contraction level increase RMS and MAV together?

Both features are computed from the same underlying signal amplitude, which generateEMGSample() scales directly by contraction (amp = pattern·contraction) and also uses to set how many motor units fire (nMU = amp·15+1) — more and larger MUAPs raise both the power-based RMS and the amplitude-based MAV in tandem.

Why do different grasps produce genuinely different classifier predictions rather than random guesses?

Each grasp in GRASP_PATTERNS has a fixed, distinct 8-channel activation profile (e.g., Power Grasp emphasizes channels 1-2 strongly while Pinch emphasizes channel 2 alone), so the resulting feature vectors cluster in different regions of feature space that the classifier can genuinely separate.

What does the Electrode channels slider actually change about classification difficulty?

Reducing channel count means classify() has fewer of each grasp's distinguishing activation values to compare against, discarding some of the spatial information that separates similar grasps like Tripod and Key Grip — fewer channels generally means lower achievable confidence, mirroring why real prosthetic systems favor more electrode sites for finer-grained grasps.

Why does the Zero Crossing rate behave differently from RMS and MAV?

ZC counts how often the signal's sign flips between samples, which tracks the frequency content of the EMG rather than its amplitude — this is why extractFeatures() computes it separately from RMS/MAV, since two signals can have identical power but very different zero-crossing rates depending on how "jagged" the underlying motor-unit firing is.