@@ -357,7 +357,7 @@ EMG is a high-frequency oscillatory signal (20-250 Hz). When you average raw EMG
357357The ** linear envelope** preserves amplitude information while removing the problematic oscillations:
358358
3593591 . ** Rectification** : Take the absolute value (makes all values positive)
360- 2 . ** Low-pass filtering** : Smooth the rectified signal (~ 10 Hz)
360+ 2 . ** Low-pass filtering** : Smooth the rectified signal (10-20 Hz)
361361
362362``` matlab
363363% Step 1: Rectify the filtered EMG
@@ -379,17 +379,17 @@ EEG.etc.envelope_cutoff = envelope_cutoff;
379379
380380![ Envelope Computation] ( /assets/images/emg_envelope_computation.png )
381381
382- This figure shows the three stages:
383- 1 . ** Filtered EMG ** (gray): High -frequency oscillations around zero
384- 2 . ** Rectified EMG** (blue): All positive, but still noisy
385- 3 . ** Envelope ** (red): Smooth curve showing muscle activation
382+ This figure shows the envelope computation stages for several channels :
383+ - ** Gray ** : Original filtered EMG with high -frequency oscillations
384+ - ** Blue ** : Rectified EMG (absolute value) - all positive but noisy
385+ - ** Red ** : Smoothed envelope - captures muscle activation amplitude
386386
387387![ Why Envelope Needed] ( /assets/images/emg_envelope_needed.png )
388388
389- This comparison demonstrates:
390- - ** Left ** : ERP from raw filtered EMG - noisy and weak
391- - ** Right ** : ERP from envelope - clear and interpretable
392- - The envelope typically provides ** 3-10x better signal-to-noise ratio **
389+ This comparison demonstrates why the envelope is critical :
390+ - ** Top row ** : Filtered EMG epochs and resulting ERP - oscillations cancel out during averaging
391+ - ** Middle row ** : Envelope epochs and resulting ERP - clear event-related response
392+ - ** Bottom ** : Direct comparison showing filtered EMG ERP (blue, noisy) vs envelope ERP (red, clear)
393393
394394### Parameters for envelope computation
395395
@@ -614,8 +614,8 @@ EEG_k = pop_epoch(EEG, {'keystroke_k'}, [epoch_start epoch_end]);
614614EEG_k = pop_rmbase(EEG_k, baseline_window * 1000);
615615
616616% Compute ERPs from envelope (average across trials)
617- ERP_a_left = mean(EEG_a.data(left_channels , :, :), 3);
618- ERP_k_right = mean(EEG_k.data(right_channels , :, :), 3);
617+ ERP_a_left = mean(EEG_a.data(left_wristband , :, :), 3);
618+ ERP_k_right = mean(EEG_k.data(right_wristband , :, :), 3);
619619```
620620
621621### Visualizing EMG-ERPs with EEGLAB
0 commit comments