pyCGM_Single.Pipelines.filt

pyCGM_Single.Pipelines.filt(data, cutoff, Fs)

Applies a Butterworth filter.

Filt applies standard Butterworth filter to signals. Useful when filtering (x,y,z) timeseries.

Parameters
datandarray

Numpy array of signals to be filtered.

cutoffint

Desired cutoff frequency.

Fsint

Sampling frequency at which signal was acquired.

Returns
filteredndarray

Filtered data.

Examples

>>> from numpy import array, around
>>> data = array([[-1003.58, 81.00, 1522.23],
...               [-1003.50, 81.02, 1522.18],
...               [-1003.42, 81.05, 1522.13],
...               [-1003.34, 81.07, 1522.09],
...               [-1003.26, 81.09, 1522.04],
...               [-1003.17, 81.11, 1522.00],
...               [-1003.09, 81.13, 1521.97],
...               [-1003.01, 81.15, 1521.93],
...               [-1002.92, 81.17, 1521.90],
...               [-1002.84, 81.19, 1521.88],
...               [-1002.75, 81.21, 1521.85],
...               [-1002.66, 81.23, 1521.83],
...               [-1002.57, 81.25, 1521.81],
...               [-1002.49, 81.27, 1521.80],
...               [-1002.40, 81.29, 1521.79],
...               [-1002.31, 81.30, 1521.78]])
>>> cutoff = 20
>>> Fs = 120
>>> around(filt(data, cutoff, Fs), 2) 
array([[-1003.58,    81.  ,  1522.23],
       [-1003.5 ,    81.02,  1522.18],
       [-1003.42,    81.05,  1522.13],
       [-1003.34,    81.07,  1522.09],
       [-1003.26,    81.09,  1522.04],
       [-1003.17,    81.11,  1522.  ],
       [-1003.09,    81.13,  1521.97],
       [-1003.01,    81.15,  1521.93],
       [-1002.92,    81.17,  1521.9 ],
       [-1002.84,    81.19,  1521.88],
       [-1002.75,    81.21,  1521.85],
       [-1002.66,    81.23,  1521.83],
       [-1002.57,    81.25,  1521.81],
       [-1002.49,    81.27,  1521.8 ],
       [-1002.4 ,    81.29,  1521.79],
       [-1002.31,    81.3 ,  1521.78]])