pyins.transform.smooth_state

pyins.transform.smooth_state(state, smoothing_time)

Smooth state data.

Smoothing is done in 3 steps: first the state is resampled to the constant time step using resample_state, then the data is smoothed with FIR filter and then the smoothed data is resampled back to the original time.

The smoothing is done by applying FIR filter constructed using scipy.signal.firwin with the number of coefficients computed as:

num_taps = 2 * round(smoothing_time / dt) + 1

The first num_taps - 1 filtered samples are removed as they cannot be computed using actual data and the edge effects are hard to eliminate. The group delay is compensated by appropriately adjusting time index.

Rotations (‘roll’, ‘pitch’, ‘heading’ columns) are smoothed by smooth_rotations.

Parameters:
stateDataFrame

State date indexed by time.

smoothing_timefloat

Smoothing time.

Returns:
DataFrame

Smoothed data.