User Tools

Site Tools


visual3d:documentation:emg:filtering:emg_envelope_version_2

EMG Envelope Version 2

Download

Script Description

Create a pipeline that performs an EMG envelope with the following specifics:

  1. Prompt for:
    1. High pass filter cutoff (default 20Hz)
    2. Smoothing RMS (default 50 ms)
  2. Plot average EMG signal:
    1. Normalize time to stance
    2. +/- 1 SD range as shaded area behind the mean curve

Sample Script

! Prompt the User for the Highpass Filter Cutoff Frequency, and the size of the RMS Window.
! Note that Visual3D restricts the size of the RMS window to integer values (e.g. frames)

Prompt_For_Multiple_Pipeline_Parameter_Values
/PIPELINE_PARAMETER_NAME=HIGHPASS_CUTOFF+RMS_TIME_WINDOW
/DATATYPE=float+int
/DEFAULT_VALUE=20+50
! /DEFAULT_VALUE_COUNT=1
/PROMPT_TEXT=Specify highpass cutoff and RMS time window (milliseconds)
;

Select_Active_File
/FILE_NAME=ALL_FILES
! /QUERY=
;

! Highpass filter EMG Signals

Highpass_Filter
/SIGNAL_TYPES=ANALOG
/SIGNAL_FOLDER=ORIGINAL
/SIGNAL_NAMES=EMG_A+EMG_B+EMG_C
/RESULT_FOLDER=HIGHPASS
! /RESULT_SUFFIX=
! /FILTER_CLASS=BUTTERWORTH
/FREQUENCY_CUTOFF=::HIGHPASS_CUTOFF
/NUM_REFLECTED=0
! /NUM_EXTRAPOLATED=0
/TOTAL_BUFFER_SIZE=30
! /NUM_BIDIRECTIONAL_PASSES=1
;

! RMS for EMG signals

Moving_RMS
/SIGNAL_TYPES=ANALOG
/SIGNAL_FOLDER=HIGHPASS
/SIGNAL_NAMES=EMG_A+EMG_B+EMG_C
! /RESULT_TYPES=
/RESULT_FOLDERS=RMS
! /RESULT_NAME=
! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=
/NUM_WINDOW_FRAMES=( &::RMS_TIME_WINDOW&/100) * PARAMETER::ANALOG::RATE + 1
;

!-----------------------------------------------------------------------------------
! Create a graphs with an average with cycle time normalization and +/- 1 SD range 
! as shaded area behind the mean curve.
!-----------------------------------------------------------------------------------

Set_Report_Page_Title
/PAGE_NUMBER=1
/PAGE_TITLE=EMG
/PAGE_TITLE_COLOR=Black
;

Make_Line_Graph
/PAGE_NUMBER=1
/COLUMN_NUMBER=1
/ROW_NUMBER=1
! /COLUMN_SPAN=1
! /ROW_SPAN=1
/GRAPH_TITLE=
/FILES_TO_GRAPH=ALL_FILES
! /DISPLAY_LEGEND=FALSE
! /LEGEND_LOCATION=UR
! /LEGEND_TEXT=
/LINE_STYLE=Dash
/LINE_COLOR=Black
! /LINE_BOLD=FALSE
! /SHOW_POINTS=FALSE
/GRAPH_MEAN=TRUE
/GRAPH_STDDEV=TRUE
/MEAN_STDDEV_LINE_STYLE=Solid
/MEAN_STDDEV_LINE_COLOR=Black
/MEAN_STDDEV_LINE_BOLD=TRUE
/USE_EVENT_RANGE=TRUE
/START_EVENT_LABEL=RON
/END_EVENT_LABEL=ROFF
! /INTERMEDIATE_EVENTS=
! /EXCLUDE_EVENTS=
/X_AXIS_LABEL=% Stance
/X_DATA_TYPE=FRAME_NUMBERS
/X_DATA_NAME=TIME
!/X_DATA_COMPONENT=
! /X_DATA_PROCESSED=ORIGINAL
/X_AXIS_SCALE=Normalize 0% to 100%
/Y_AXIS_LABEL=EMG_A
/Y_DATA_TYPE=ANALOG
/Y_DATA_NAME=EMG_A
!/Y_DATA_COMPONENT=
/Y_DATA_PROCESSED=RMS
! /Y_AXIS_SCALE=Global Min to Max
! /Y_USE_SCIENTIFIC_NOTATION=FALSE
;

Make_Line_Graph
/PAGE_NUMBER=1
/COLUMN_NUMBER=1
/ROW_NUMBER=2
! /COLUMN_SPAN=1
! /ROW_SPAN=1
/GRAPH_TITLE=
/FILES_TO_GRAPH=ALL_FILES
! /DISPLAY_LEGEND=FALSE
! /LEGEND_LOCATION=UR
! /LEGEND_TEXT=
/LINE_STYLE=Dash
/LINE_COLOR=Black
! /LINE_BOLD=FALSE
! /SHOW_POINTS=FALSE
/GRAPH_MEAN=TRUE
/GRAPH_STDDEV=TRUE
/MEAN_STDDEV_LINE_STYLE=Solid
/MEAN_STDDEV_LINE_COLOR=Black
/MEAN_STDDEV_LINE_BOLD=TRUE
/USE_EVENT_RANGE=TRUE
/START_EVENT_LABEL=RON
/END_EVENT_LABEL=ROFF
! /INTERMEDIATE_EVENTS=
! /EXCLUDE_EVENTS=
/X_AXIS_LABEL=% Stance
/X_DATA_TYPE=FRAME_NUMBERS
/X_DATA_NAME=TIME
!/X_DATA_COMPONENT=
! /X_DATA_PROCESSED=ORIGINAL
/X_AXIS_SCALE=Normalize 0% to 100%
/Y_AXIS_LABEL=EMG_B
/Y_DATA_TYPE=ANALOG
/Y_DATA_NAME=EMG_B
!/Y_DATA_COMPONENT=
/Y_DATA_PROCESSED=RMS
! /Y_AXIS_SCALE=Global Min to Max
! /Y_USE_SCIENTIFIC_NOTATION=FALSE
;

Make_Line_Graph
/PAGE_NUMBER=1
/COLUMN_NUMBER=1
/ROW_NUMBER=3
! /COLUMN_SPAN=1
! /ROW_SPAN=1
/GRAPH_TITLE=
/FILES_TO_GRAPH=ALL_FILES
! /DISPLAY_LEGEND=FALSE
! /LEGEND_LOCATION=UR
! /LEGEND_TEXT=
/LINE_STYLE=Dash
/LINE_COLOR=Black
! /LINE_BOLD=FALSE
! /SHOW_POINTS=FALSE
/GRAPH_MEAN=TRUE
/GRAPH_STDDEV=TRUE
/MEAN_STDDEV_LINE_STYLE=Solid
/MEAN_STDDEV_LINE_COLOR=Black
/MEAN_STDDEV_LINE_BOLD=TRUE
/USE_EVENT_RANGE=TRUE
/START_EVENT_LABEL=RON
/END_EVENT_LABEL=ROFF
! /INTERMEDIATE_EVENTS=
! /EXCLUDE_EVENTS=
/X_AXIS_LABEL=% Stance
/X_DATA_TYPE=FRAME_NUMBERS
/X_DATA_NAME=TIME
!/X_DATA_COMPONENT=
! /X_DATA_PROCESSED=ORIGINAL
/X_AXIS_SCALE=Normalize 0% to 100%
/Y_AXIS_LABEL=EMG_C
/Y_DATA_TYPE=ANALOG
/Y_DATA_NAME=EMG_C
!/Y_DATA_COMPONENT=
/Y_DATA_PROCESSED=RMS
! /Y_AXIS_SCALE=Global Min to Max
! /Y_USE_SCIENTIFIC_NOTATION=FALSE
;

Manually Create 2D Graph

The graphs do NOT need to be done in the pipeline. This can be accomplished as a report graph as displayed in the following image of the edit report dialog.


visual3d/documentation/emg/filtering/emg_envelope_version_2.txt · Last modified: 2024/07/17 11:45 by sgranger