User Tools

Site Tools


visual3d:documentation:emg:processing_tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
visual3d:documentation:emg:processing_tools [2024/06/19 12:47] sgrangervisual3d:documentation:emg:processing_tools [2024/07/17 15:45] (current) – created sgranger
Line 1: Line 1:
-===== introduction =====+====== Processing Tools ======
  
-the purpose is to offset trial data to accommodate for any dc shift. quantifying the emg background noise based on a "resting trial" using the following algorithm:+==== Introduction ====
  
-find overall mean of trial:+The purpose is to offset trial data to accommodate for any DC shift. Quantifying the EMG background noise based on a "Resting Trial" using the following algorithm: 
 + 
 +Find overall mean of trial:
  
 if positive, subtract mean from all values to offset overall average to zero if positive, subtract mean from all values to offset overall average to zero
 if negative, add mean to all values to offset overall average to zero. if negative, add mean to all values to offset overall average to zero.
-rectify trial around the zero baselines+Rectify trial around the zero baselines
  
-calculate threshold values for each channel of emg (level of digitized baseline noise).+Calculate threshold values for each channel of EMG (level of digitized baseline noise).
  
-determine noise threshold (i.e., the value determined from the resting emg values fall below; calculated by passing a ceiling through data at successively higher levels until all data values for the 5 second duration fall below the ceiling. +Determine noise threshold (i.e., the value determined from the resting EMG values fall below; calculated by passing a ceiling through data at successively higher levels until all data values for the 5 second duration fall below the ceiling. 
-===== emg_resting_background =====+==== EMG_Resting_Background ====
  
-you can remove the background using a meta-command (as described below), or you can see [[visual3d:documentation:emg:filtering:resting_background_noise_offset|here]] for an example implementing this in a script.+You can remove the background using a Meta-Command (as described below), or you can see [[Visual3D:Documentation:EMG:Filtering:Resting_Background_Noise_Offset|here]] for an example implementing this in a script.
  
-===== emg_resting_background meta-command =====+==== EMG_Resting_Background Meta-Command ====
  
-the following meta command can be cut-and-paste into a file named **emg_resting_background.v3m**+The following Meta Command can be Cut-and-Paste into a file named **EMG_Resting_Background.v3m**
  
 <code> <code>
-begin_meta +BEGIN_META 
-meta_cmd_name=emg_resting_background +META_CMD_NAME=EMG_Resting_Background 
-meta_paramsignal_names:string::yes +META_PARAMSIGNAL_NAMES:string::yes 
-meta_paramsignal_folder:string::yes +META_PARAMSIGNAL_FOLDER:string::yes 
-meta_paramresult_folder:string::yes +META_PARAMRESULT_FOLDER:string::yes 
-end_meta+END_META
  
-set_pipeline_parameter +Set_Pipeline_Parameter 
-/parameter_name=folder +/PARAMETER_NAME=FOLDER 
-/parameter_value=::signal_folder +/PARAMETER_VALUE=::SIGNAL_FOLDER 
-! /parameter_value_search_for+! /PARAMETER_VALUE_SEARCH_FOR
-! /parameter_value_replace_with+! /PARAMETER_VALUE_REPLACE_WITH
-! /parameter_value_prefix+! /PARAMETER_VALUE_PREFIX
-! /parameter_value_append=+! /PARAMETER_VALUE_APPEND=
 ; ;
  
-set_pipeline_parameter +Set_Pipeline_Parameter 
-/parameter_name=result +/PARAMETER_NAME=RESULT 
-/parameter_value=::result_folder +/PARAMETER_VALUE=::RESULT_FOLDER 
-! /parameter_value_search_for+! /PARAMETER_VALUE_SEARCH_FOR
-! /parameter_value_replace_with+! /PARAMETER_VALUE_REPLACE_WITH
-! /parameter_value_prefix+! /PARAMETER_VALUE_PREFIX
-! /parameter_value_append=+! /PARAMETER_VALUE_APPEND=
 ; ;
  
 ! --------------------------------------------------------------- ! ---------------------------------------------------------------
-offset trial data to accommodate for any dc shift+Offset trial data to accommodate for any DC shift
 ! (find overall mean of trial&ldots;if positive, ! (find overall mean of trial&ldots;if positive,
 ! subtract mean from all values to offset overall average to zero&ldots; ! subtract mean from all values to offset overall average to zero&ldots;
 ! if negative, add mean to all values to offset overall average to zero). ! if negative, add mean to all values to offset overall average to zero).
-rectify trial around the zero baselines+Rectify trial around the zero baselines
 ! (all values set to absolute values). ! (all values set to absolute values).
 ! --------------------------------------------------------------- ! ---------------------------------------------------------------
  
-for_each +For_Each 
-/iteration_parameter_name=index +/ITERATION_PARAMETER_NAME=INDEX 
-/items=::signal_names+/ITEMS=::SIGNAL_NAMES
 ; ;
  
-metric_mean +Metric_Mean 
-/result_metric_name=_mean +/RESULT_METRIC_NAME=_MEAN 
-/apply_as_suffix_to_signal_name=true +/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE 
-! /result_metric_folder=processed +! /RESULT_METRIC_FOLDER=PROCESSED 
-/signal_types=analog +/SIGNAL_TYPES=ANALOG 
-/signal_names=::index +/SIGNAL_NAMES=::INDEX 
-/signal_folder=::folder +/SIGNAL_FOLDER=::FOLDER 
-! /signal_components=x +! /SIGNAL_COMPONENTS=X 
-/event_sequence+/EVENT_SEQUENCE
-/exclude_events+/EXCLUDE_EVENTS
-/generate_mean_and_stddev=false +/GENERATE_MEAN_AND_STDDEV=FALSE 
-! /append_to_existing_values=false+! /APPEND_TO_EXISTING_VALUES=FALSE
 ; ;
  
-evaluate_expression +Evaluate_Expression 
-/expression=abs(analog&:&:&::folder&:&:&::index&-&metric::processed&:&:&::index&_mean+/EXPRESSION=ABS(ANALOG&:&:&::FOLDER&:&:&::INDEX&-&METRIC::PROCESSED&:&:&::INDEX&_MEAN
-/result_name=::index +/RESULT_NAME=::INDEX 
-/result_type=analog +/RESULT_TYPE=ANALOG 
-/result_folder=::result+/RESULT_FOLDER=::RESULT
 ; ;
  
-end_for_each +End_For_Each 
-/iteration_parameter_name=index+/ITERATION_PARAMETER_NAME=INDEX
 ; ;
  
 ! --------------------------------------------------------------- ! ---------------------------------------------------------------
-calculated threshold values for each channel of emg+Calculated threshold values for each channel of EMG
 ! (level of digitized baseline noise). ! (level of digitized baseline noise).
-apply noise threshold (i.e., the value determined from the +Apply noise threshold (i.e., the value determined from the 
-! resting emg values fall below).  calculated by passing a+! resting EMG values fall below).  Calculated by passing a
 ! ceiling through data at successively higher levels until ! ceiling through data at successively higher levels until
 ! all data values for the 5 second duration fall below the ceiling. ! all data values for the 5 second duration fall below the ceiling.
 ! --------------------------------------------------------------- ! ---------------------------------------------------------------
  
-metric_maximum +Metric_Maximum 
-/result_metric_name=_rest +/RESULT_METRIC_NAME=_REST 
-/apply_as_suffix_to_signal_name=true +/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE 
-/result_metric_folder=::result +/RESULT_METRIC_FOLDER=::RESULT 
-/signal_types=analog +/SIGNAL_TYPES=ANALOG 
-/signal_names+/SIGNAL_NAMES
-/signal_folder=::result +/SIGNAL_FOLDER=::RESULT 
-/signal_components=x +/SIGNAL_COMPONENTS=X 
-/event_sequence+/EVENT_SEQUENCE
-/exclude_events+/EXCLUDE_EVENTS
-/generate_mean_and_stddev=false +/GENERATE_MEAN_AND_STDDEV=FALSE 
-! /append_to_existing_values=false +! /APPEND_TO_EXISTING_VALUES=FALSE 
-/create_global_maximum=true+/CREATE_GLOBAL_MAXIMUM=TRUE
 ; ;
 </code> </code>
  
-===== madonna emg remove background meta-command =====+==== Madonna EMG Remove Background Meta-Command ====
  
-the following meta command removes the background noise from the emg signals and can be cut-and-paste into a file named **madonna_emg_remove_background.v3m**+The following Meta Command removes the background noise from the EMG signals and can be Cut-and-Paste into a file named **Madonna_EMG_Remove_Background.v3m**
  
 <code> <code>
-begin_meta +BEGIN_META 
-meta_cmd_name=madonna emg remove background +META_CMD_NAME=Madonna EMG Remove Background 
-meta_paramsignal_names:string::yes +META_PARAMSIGNAL_NAMES:string::yes 
-meta_paramsignal_folder:string::yes +META_PARAMSIGNAL_FOLDER:string::yes 
-meta_paramresult_folder:string::yes +META_PARAMRESULT_FOLDER:string::yes 
-meta_parambackground_folder:string::yes +META_PARAMBACKGROUND_FOLDER:string::yes 
-end_meta+END_META
  
-set_pipeline_parameter +Set_Pipeline_Parameter 
-/parameter_name=folder +/PARAMETER_NAME=FOLDER 
-/parameter_value=::signal_folder+/PARAMETER_VALUE=::SIGNAL_FOLDER
  
  
-set_pipeline_parameter +Set_Pipeline_Parameter 
-/parameter_name=result +/PARAMETER_NAME=RESULT 
-/parameter_value=::result_folder+/PARAMETER_VALUE=::RESULT_FOLDER
  
  
 ! --------------------------------------------------------------- ! ---------------------------------------------------------------
-remove the emg background noise+Remove the EMG background noise
 ! ---------------------------------------------------------------  ! --------------------------------------------------------------- 
  
-for_each +For_Each 
-/iteration_parameter_name=index +/ITERATION_PARAMETER_NAME=INDEX 
-/items=::signal_names+/ITEMS=::SIGNAL_NAMES
  
  
-evaluate_expression +Evaluate_Expression 
-/expression=abs(analog&:&:&::folder&:&:&::index&& - global::metric&:&:&::background_folder&:&:&::index&_rest_max+/EXPRESSION=ABS(ANALOG&:&:&::FOLDER&:&:&::INDEX&& - GLOBAL::METRIC&:&:&::BACKGROUND_FOLDER&:&:&::INDEX&_REST_MAX
-/result_name=::index +/RESULT_NAME=::INDEX 
-/result_type=analog +/RESULT_TYPE=ANALOG 
-/result_folder=::result+/RESULT_FOLDER=::RESULT
  
  
-set_data_to_new_values +Set_Data_To_New_Values 
-/signal_types=analog +/SIGNAL_TYPES=ANALOG 
-/signal_names=::index +/SIGNAL_NAMES=::INDEX 
-/signal_folder=::result +/SIGNAL_FOLDER=::RESULT 
-! /signal_components=all_components +! /SIGNAL_COMPONENTS=ALL_COMPONENTS 
-! /result_suffix+! /RESULT_SUFFIX
-/result_folder=::result +/RESULT_FOLDER=::RESULT 
-! /event_sequence+! /EVENT_SEQUENCE
-! /exclude_events+! /EXCLUDE_EVENTS
-/start_frame=1 +/START_FRAME=1 
-/end_frame=eof +/END_FRAME=EOF 
-! /use_point_rate=true +! /USE_POINT_RATE=TRUE 
-/replacement_values=0 +/REPLACEMENT_VALUES=0 
-/threshold_high=data_not_found +/THRESHOLD_HIGH=DATA_NOT_FOUND 
-/threshold_low=global::metric&:&:&::background_folder&:&:&::index&_rest_max+/THRESHOLD_LOW=GLOBAL::METRIC&:&:&::BACKGROUND_FOLDER&:&:&::INDEX&_REST_MAX
  
  
-end_for_each +End_For_Each 
-/iteration_parameter_name=index+/ITERATION_PARAMETER_NAME=INDEX
 ; ;
 </code> </code>
  
-===== an example visual3d pipeline command to call these meta-commands =====+==== An example Visual3D Pipeline Command to call these Meta-Commands ====
  
-in this example, some files are tagged as restemg, and gait.+In this example, some files are TAGGED as RESTEMG, and GAIT.
  
 <code> <code>
-!make the resting trial the active file.+!Make the Resting Trial the Active File.
  
-for_each +For_Each 
-/iteration_parameter_name=tags +/ITERATION_PARAMETER_NAME=TAGS 
-/items=rest+/ITEMS=REST
 ; ;
  
-select_active_file +Select_Active_File 
-/file_name=::tags +/FILE_NAME=::TAGS 
-!/query=+!/QUERY=
 ; ;
  
-calculates resting background by calling the emg_resting_background meta-command+Calculates resting background by calling the EMG_Resting_Background Meta-Command
-emg_resting_background +EMG_Resting_Background 
-/signal_names=lgas+lglu+lmed+ltib+lvas+rgas+rglu+rmed+rtib+rvas +/SIGNAL_NAMES=LGAS+LGLU+LMED+LTIB+LVAS+RGAS+RGLU+RMED+RTIB+RVAS 
-/signal_folder=emg_filtered +/SIGNAL_FOLDER=EMG_FILTERED 
-/result_folder=emg_background+/RESULT_FOLDER=EMG_BACKGROUND
 ; ;
  
-end_for_each +End_For_Each 
-/iteration_parameter_name=tags+/ITERATION_PARAMETER_NAME=TAGS
 ; ;
  
-this loop will remove the resting background from the signals. +This loop will remove the resting background from the signals. 
-for_each +For_Each 
-/iteration_parameter_name=tags +/ITERATION_PARAMETER_NAME=TAGS 
-/items=emg+gait+/ITEMS=EMG+GAIT
 ; ;
  
-select_active_file +Select_Active_File 
-/file_name=::tags +/FILE_NAME=::TAGS 
-!/query=+!/QUERY=
 ; ;
  
-call the emg_remove_background meta-command +Call the EMG_Remove_Background Meta-Command 
-emg_remove_background +EMG_Remove_Background 
-/signal_names=lgas+lglu+lmed+ltib+lvas+rgas+rglu+rmed+rtib+rvas +/SIGNAL_NAMES=LGAS+LGLU+LMED+LTIB+LVAS+RGAS+RGLU+RMED+RTIB+RVAS 
-/signal_folder=emg_filtered +/SIGNAL_FOLDER=EMG_FILTERED 
-/background_folder=emg_background +/BACKGROUND_FOLDER=EMG_BACKGROUND 
-/result_folder=emg_processed+/RESULT_FOLDER=EMG_PROCESSED
 ; ;
  
-end_for_each +End_For_Each 
-/iteration_parameter_name=tags+/ITERATION_PARAMETER_NAME=TAGS
 ; ;
 </code> </code>
visual3d/documentation/emg/processing_tools.1718801258.txt.gz · Last modified: 2024/06/19 12:47 by sgranger