Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] processEMG.m Inappropriate EMG Normalization #240

Open
bfregly opened this issue Jul 12, 2023 · 2 comments
Open

[BUG] processEMG.m Inappropriate EMG Normalization #240

bfregly opened this issue Jul 12, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@bfregly
Copy link
Contributor

bfregly commented Jul 12, 2023

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):

  • OS: All
  • OpenSim Version: Any
  • MATLAB Version: Any
  • NMSM Pipeline Version: 1.0beta

Additional context
Add any other context about the problem here.

@bfregly bfregly added the bug Something isn't working label Jul 12, 2023
@cvhammond
Copy link
Member

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

@SpencerTWilliams
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants