Signal
anomaly
- pyCGM2.Signal.anomaly.anomaly_rolling(values, aprioriError=0, window=10, threshold=3, method='median', plot=False, label='Unknow', referenceValues=None)
anomaly detection from rolling windows
- Parameters
values (np.array) – values
aprioriError (int,Optional[0]) – a priori error.
window (int,Optional[10]) – size of the window.
threshold (int,Optional[3]) – standard deviation factor
method (str,Optional[median]) – descriptive statistic method
plot (bool,Optional[False]) – enable plot
label (str,Optional[Unknown]) – Description of parameter label
referenceValues (np.array,Optional[None]) – values used as reference instead of the values computing from the rolling windows
detect_changes
The module only contains the function “detect_changes” implemenented by Marcos Duarte, available in [BMC](https://github.com/demotu/BMC)
see BMC documentation for details
- pyCGM2.Signal.detect_changes.detect_cusum(x, threshold=1, drift=0, ending=False, show=True, ax=None)
Cumulative sum algorithm (CUSUM) to detect abrupt changes in data
detect_onset
The module only contains the function “detect_onset” implemenented by Marcos Duarte, available in [BMC](https://github.com/demotu/BMC)
see BMC documentation for details
- pyCGM2.Signal.detect_onset.detect_onset(x, threshold=0, n_above=1, n_below=0, threshold2=None, n_above2=1, show=False, ax=None)
Detects onset in data based on amplitude threshold.
detect_peaks
The module only contains the function “detect_peaks” implemenented by Marcos Duarte, available in [BMC](https://github.com/demotu/BMC)
see BMC documentation for details
- pyCGM2.Signal.detect_peaks.detect_peaks(x, mph=None, mpd=1, threshold=0, edge='rising', kpsh=False, valley=False, show=False, ax=None)
Detect peaks in data based on their amplitude and other features.
signal_processing
The module only contains functions for filtering data
- pyCGM2.Signal.signal_processing.arrayLowPassFiltering(valuesArray, freq, order=2, fc=6)
Low-pass filtering of a numpy.array
- Parameters
valuesArray (numpy.array(n,n)) –
fc (float,Optional) – cut-off frequency. Default set to 6 Hz
order (int,optional) – order of the low-pass filter, Default set to 2
- pyCGM2.Signal.signal_processing.enveloppe(array, fc, fa)
Get signal enveloppe from a low pass filter
- Parameters
array (numpy.array(n,n)) – array
fc (float) – cut-off frequency
fa (float) – sample frequency
- pyCGM2.Signal.signal_processing.forcePlateFiltering(btkAcq, order=4, fc=5)
Low-pass filtering of Force plate outputs
- Parameters
btkAcq (btk.Acquisition) – btk acquisition instance
fc (float,Optional) – cut-off frequency. Default set to 5 Hz
order (int,optional) – order of the low-pass filter, Default set to 4
- pyCGM2.Signal.signal_processing.highPass(array, lowerFreq, upperFreq, fa)
butterworth bandpass filter.
- Parameters
array (numpy.array(n,n)) – array
lowerFreq (float) – lower frequency
upperFreq (float) – upper frequency
fa (float) – sample frequency
- pyCGM2.Signal.signal_processing.markerFiltering(btkAcq, markers, order=2, fc=6, zerosFiltering=True)
Low-pass filtering of all points in an acquisition
- Parameters
btkAcq (btk.Acquisition) – btk acquisition instance
fc (float,Optional) – cut-off frequency. Default set to 6 Hz
order (int,optional) – order of the low-pass filter, Default set to 2
zerosFiltering (bool,optional) – enable zero filtering, Default set to True
- pyCGM2.Signal.signal_processing.rectify(array)
rectify a signal ( i.e get absolute values)
- Parameters
array (numpy.array(n,n)) – array
- pyCGM2.Signal.signal_processing.remove50hz(array, fa)
Remove the 50Hz signal
- Args
array (array(n,n): array fa (float): sample frequency