skdh.features.DetailPowerRatio#
- class skdh.features.DetailPowerRatio(wavelet='coif4', freq_band=None)#
The ratio of the power in the detail signals that span the specified frequency band. Uses the discrete wavelet transform to break down the signal into constituent components at different frequencies.
- Parameters:
- waveletstr
Wavelet to use. Options are the discrete wavelets in PyWavelets. Default is ‘coif4’.
- freq_bandarray_like
2-element array-like of the frequency band (Hz) to get the power in. Default is [1, 10].
- Attributes:
- f_band
- wave
Methods
compute(signal[, fs, axis])Compute the detail power ratio
Notes
In the original paper [1], the result is multiplied by 100 to obtain a percentage. This final multiplication is not included in order to obtain results that have a scale that closer matches the typical 0-1 (or -1 to 1) scale for machine learning features. NOTE that this does not mean that the values will be in this range - since the scaling factor is the original acceleration and not the wavelet detail values.
References
[1]Sekine, M. et al. “Classification of waist-acceleration signals in a continuous walking record.” Medical Engineering & Physics. Vol. 22. Pp 285-291. 2000.
- compute(signal, fs=1.0, *, axis=-1)#
Compute the detail power ratio
- Parameters:
- signalarray-like
Array-like containing values to compute the detail power ratio for.
- fsfloat, optional
Sampling frequency in Hz. If not provided, default is 1.0Hz.
- axisint, optional
Axis along which the signal entropy will be computed. Ignored if signal is a pandas.DataFrame. Default is last (-1).
- Returns:
- power_rationumpy.ndarray
Computed detail power ratio.