sensbiotk.algorithms package

« sensbiotk package | sensbiotk.algorithms package | sensbiotk.calib package »

sensbiotk.algorithms package

Submodules

sensbiotk.algorithms.basic module

Basic algo for sensors data

sensbiotk.algorithms.basic.compute_norm(sig_raw)[source]

Norm on a signal

Returns:

sig_norm : numpy array of float

norm of the signal

sensbiotk.algorithms.basic.cut_signal(sig_time, sig_raw, time0, timef)[source]

Cut the signal on a windows between time0 and timef.

Returns:

sig_time:numpy array of float :

time signal between time0 and timef

sig_cut : numpy array of float

signal cutted in a window time0 and timef.

sensbiotk.algorithms.basic.find_peaks(sig_raw, min_peak_height, min_peak_distance, max_peak_distance)[source]
Find locations and peak values in a 1D numpy array,
taking into account a minimal peak height, min distance
and max distance.
Returns:

sig_raw[locs] : numpy array of float

detected peaks values

locs : numpy array of float

detected peaks locations

sensbiotk.algorithms.basic.find_static_periods(sig_raw, static_threshold, min_sample_duration)[source]

Find locations of static periods in a 1D numpy array, taking into account a minimal static threshold (ex: 3 deg/s), and a minimum nb of samples for the static duration.

Returns:

start_idx : numpy array of float

start periods locations

end_idx : numpy array of float

end periods locations

sensbiotk.algorithms.basic.find_static_periods_3D(sig_raw, static_threshold, min_sample_duration)[source]

Find locations of static periods in a 3D numpy array, taking into account a minimal static threshold (ex: 3 deg/s), and a minimum nb of samples for the static duration.

Returns:

start_idx : numpy array of float

start periods locations

end_idx : numpy array of float

end periods locations

sensbiotk.algorithms.basic.lowpass_filter(sig_raw, cuttoff_freq, samp_freq)[source]

Low pass filter (butterworth order 6) on a signal

Returns:

sig_filt : numpy array of float of dim N

signal filtered :

sensbiotk.algorithms.basic.lowpass_filter2(sig_raw, cuttoff_freq, samp_freq)[source]

Simple low pass filter on a signal

Returns:

sig_filt : numpy array of float of dim N

signal filtered :

sensbiotk.algorithms.basic.moving_average(sig_raw, fen)[source]

Moving Average on a signal

Returns:

sig_filt : numpy array of float

signal filtered :

sensbiotk.algorithms.basic.moving_average2(sig_raw, fen)[source]

Moving Average using convolution on a signal

Returns:

sig_filt : numpy array of float

signal filtered :

sensbiotk.algorithms.basic.search_maxpeak(sig_raw)[source]

Search max peak

Returns:

time_peak : numpy array of float

time where a max peak has been detected

index_peak : numpy array of float

index where a max peak has been detected

sensbiotk.algorithms.basic.threshold_signal(sig_time, sig_raw, threshold)[source]

Threshold signal

Returns:

time_thresh : numpy array of float

time signal thresholed

index_peak : numpy array of float

signal thresholed

sensbiotk.algorithms.basic.threshold_under_signal(sig_time, sig_raw, threshold)[source]

Threshold under signal

Returns:

time_thresh : numpy array of float

time signal thresholed

index_peak : numpy array of float

signal thresholed

sensbiotk.algorithms.basic.window_mean(sig_time, sig_raw, time0, timef)[source]

Mean of the signal on a windows between time0 and timef.

Returns:

sig_mean : numpy array of float

mean of the signal assumed to be constant between time0 and timef.

sensbiotk.algorithms.goniometer module

Computes rotation angle between two quaternions

@author: bsijober

sensbiotk.algorithms.goniometer.compute(q_0, q_1, q_offset=[1, 0, 0, 0])[source]

Computes rotation angle between two quaternions

Returns:

angle : float

the angle of rotation between q_0 and q_1 (rad)

rot_axis : numpy array of float

the axis of rotation

sensbiotk.algorithms.integration_gyro module

Gyrometer integration signal

sensbiotk.algorithms.integration_gyro.compute(data, freqs=200)[source]

Compute a minimized drift integration of the gyrometer signal

sensbiotk.algorithms.madgwick_ahrs module

This algorithms is based on the work of Sebastian Madgwick described in :

Madgwick, Estimation of IMU and MARG orientation using a gradient descent algorithm. 2011 Ieee International Conference on Rehabilitation Robotics (Icorr), 2011.

It has been implemented in Python from the original Matlab author code.

It enables the computation of a quaternion from magneto-inertial measurements.

sensbiotk.algorithms.madgwick_ahrs.norm(x)[source]

Computes the norm of x

sensbiotk.algorithms.madgwick_ahrs.update(q, z, fs=200)[source]

Updates the computed q quaternion

sensbiotk.algorithms.mahony_ahrs module

This algorithms is based on the work of Robert Mahony described in :

Mahony, R., T. Hamel, and J.-M. Pflimlin, Nonlinear Complementary Filters on the Special Orthogonal Group. Automatic Control, IEEE Transactions on, 2008. 53(5): p. 1203-1218.

It enables the computation of a quaternion from magneto-inertial measurements.

sensbiotk.algorithms.mahony_ahrs.norm(x)[source]
class sensbiotk.algorithms.mahony_ahrs.obj[source]
eInt = 0
sensbiotk.algorithms.mahony_ahrs.update(q, z, fs=200)[source]

sensbiotk.algorithms.markley module

Fast Quaternion Attitude Estimation from Accelerometer and Magnetometers

sensbiotk.algorithms.markley.compute(z, a=array([ 0.5, 0.5]))[source]

Fast Quaternion Attitude Estimation from Accelerometer and Magnetometers 3D measures.

See Publication : Fast Quaternion Attitude Estimation from Two Vector Measurements, L. Markley, NASA Tech Doc, 2001 https://archive.org/details/nasa_techdoc_20010068636

Returns:

q : numpy array of float (dim 4)

attitude quaternion

sensbiotk.algorithms.martin_ahrs module

Martin Salaun observer implementation

This algorithms is based on the following work :

Martin, P. and E. Salaün, Design and implementation of a low-cost observer-based attitude and heading reference system. Control Engineering Practice, 2010. 18(7): p. 712-722.

It enables the computation of a quaternion from magneto-inertial measurements.

class sensbiotk.algorithms.martin_ahrs.martin_ahrs[source]

Bases: object

Martin Salaun observer class

Methods

init_observer(z)[source]

Martin Salaun init observer

update(z, sample_period)[source]

Martin Salaun iteration observer

Module contents