resurfemg.preprocessing.filtering module¶
Copyright 2022 Netherlands eScience Center and University of Twente Licensed under the Apache License, version 2.0. See LICENSE for details.
This file contains functions to filter EMG arrays.
- resurfemg.preprocessing.filtering.bad_end_cutter(data_emg, percent_to_cut=7, tolerance_percent=10)¶
This algorithm takes the end off of EMGs where the end is radically altered, or if not radically altered cuts the last 10 values but returns only the array, not an altered Poly5.
- resurfemg.preprocessing.filtering.bad_end_cutter_better(data_emg, percent_to_cut=7, tolerance_percent=10)¶
This algorithm takes the end off of EMGs where the end is radically altered, or if not radically altered cuts the last 10 values but returns only the array not an altered Poly5.
- resurfemg.preprocessing.filtering.bad_end_cutter_for_samples(data_emg, percent_to_cut=7, tolerance_percent=10)¶
This algorithm takes the end off of EMGs where the end is radically altered, or if not radically altered cuts the last 10 values but returns only the array.
- resurfemg.preprocessing.filtering.compute_power_loss(original_signal, original_signal_sampling_frequency, processed_signal, processed_signal_sampling_frequency)¶
This function computes the percentage of power loss after the processing of a signal. Inputs include the original_signal (signal before the processing),
original_signal_sampling_frequency
(sampling frequency of the signal before processing),processed_signal
(signal after processing),processed_signal_sampling_frequency
(sampling frequency of the signal after processing).Output is the percentage of power loss.
- resurfemg.preprocessing.filtering.emg_bandpass_butter(data_emg, low_pass, high_pass)¶
The parameter taken in here is the Poly5 file. Output is the EMG after a bandpass as made here.
- resurfemg.preprocessing.filtering.emg_bandpass_butter_sample(data_emg_samp, low_pass, high_pass, sample_rate, output='sos')¶
Output is the EMG after a bandpass as made here.
- Parameters:
- Returns:
The bandpass filtered EMG sample data
- Return type:
- resurfemg.preprocessing.filtering.emg_highpass_butter(data_emg, cut_above, sample_rate)¶
The parameter taken in here is the Poly5 file’s samples or another array. Output is the EMG after a bandpass as made here.
- resurfemg.preprocessing.filtering.emg_highpass_butter_sample(data_emg_samp, high_pass, sample_rate, order=3)¶
Output is the EMG after a bandpass as made here.
- resurfemg.preprocessing.filtering.emg_lowpass_butter(array, cutoff, fs, order=5)¶
This is a lowpass filter of butterworth design.
- resurfemg.preprocessing.filtering.emg_lowpass_butter_sample(data_emg_samp, low_pass, sample_rate, order=3)¶
Output is the EMG after a lowpass as made here.
- resurfemg.preprocessing.filtering.helper_lowpass(cutoff, fs, order=5)¶
This is a helper function inside the butter_lowpass_filter function.
- resurfemg.preprocessing.filtering.notch_filter(sample, sample_frequ, freq_to_pull, quality_factor_q)¶
This is a filter designed to take out a specific frequency. In the EU in some data electrical cords can interfere at around 50 Hertz. In some other locations the interference is at 60 Hertz. The specificities of a local power grid may neccesitate notch filtering.
- Parameters:
- Returns:
The filterered sample data
- Return type: