pyCGM2.Lib.emg.processEMG#
- pyCGM2.Lib.emg.processEMG(DATA_PATH: str, gaitTrials: List, emgChannels: List, highPassFrequencies: List = [20, 200], envelopFrequency: float = 6.0, fileSuffix: str | None = None, outDataPath: str | None = None)#
Process and filter EMG data from c3d files.
This function applies basic EMG filtering to specified c3d files. It supports high-pass and low-pass filtering and allows exporting the processed data.
- Parameters:
DATA_PATH (str) – The folder path containing c3d files.
gaitTrials (List[str]) – A list of c3d file names to process.
emgChannels (List[str]) – A list of EMG channel names to be processed.
highPassFrequencies (List[int]) – The boundaries of the bandpass filter. Defaults to [20, 200].
envelopFrequency (float) – The cut-off frequency for the low pass filter. Defaults to 6.0.
fileSuffix (Optional[str]) – A suffix for the exported c3d files. Defaults to None.
outDataPath (Optional[str]) – The path to save the exported c3d files. Defaults to None.
Example
>>> processEMG("/data/path", ["gaitTrial1.c3d", "gaitTrial2.c3d"], ["Voltage.EMG1", "Voltage.EMG2"])
The code loads 2 c3d files, then processes the analog channel name Voltage.EMG1 and Voltage.EMG2