rcnl-org / nmsm-core

Neuromusculoskeletal Modeling (NMSM) Pipeline codebase
https://nmsm.rice.edu
Other
17 stars 3 forks source link

[BUG] processEMG.m Inappropriate EMG Normalization #240

Open bfregly opened 1 year ago

bfregly commented 1 year ago

Describe the bug The function processEMG.m which is used in preprocessing normalizes EMG data to maximum value over the current motion cycle. This normalization means that the same EMG channel will be normalized by different values for different motion trials. We need to remove the EMG normalization line

% Normalize by maximum value for each channel emgData = emgData ./ max(emgData, [], 2);

and allow the user to normalize EMG data to maximum value over MULTIPLE trials using any desired combination of processed EMG trials.

To Reproduce Nothing to reproduce - just need to remove one line of code.

Expected behavior Output EMG data will not be normalized

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

cvhammond commented 1 year ago

processEMG.m should be run before splitIntoTrials.m so it normalizes over the entire motion not over the individual motion cycle.

SpencerTWilliams commented 2 months ago

This came up again recently. The solution will be to normalize EMG over all trials after importing data into MTP. MTP activations will then be the expected magnitudes for NCP.