#include <butterworth_filter.h>
Class ButterworthFilter - Implementation of a signal filter to soften jerks. This is a first-order Butterworth low-pass filter. First-order was chosen for 2 reasons:
- It doesn't overshoot
- Computational efficiency This filter has been parameterized so there is only one parameter to tune. See "Digital Implementation of Butterworth First–Order Filter Type IIR" by Horvath, Cervenanska, and Kotianova, 2019 and Mienkina, M., Filter-Based Algorithm for Metering Applications, https://www.nxp.com/docs/en/application-note/AN4265.pdf, 2016 It comes from finding the bilinear transform equivalent of the analog transfer function and further applying the inverse z-transform. The parameter "low_pass_filter_coeff" equals (2*pi / tan(omega_d * T)) where omega_d is the cutoff frequency and T is the sampling period in sec.
Definition at line 65 of file butterworth_filter.h.
◆ ButterworthFilter() [1/2]
online_signal_smoothing::ButterworthFilter::ButterworthFilter |
( |
double |
low_pass_filter_coeff | ) |
|
Constructor.
- Parameters
-
low_pass_filter_coeff | Larger filter_coeff-> more smoothing of commands, but more lag. low_pass_filter_coeff = (2*pi / tan(omega_d * T)) where omega_d is the cutoff frequency and T is the sampling period in sec. |
Definition at line 53 of file butterworth_filter.cpp.
◆ ButterworthFilter() [2/2]
online_signal_smoothing::ButterworthFilter::ButterworthFilter |
( |
| ) |
|
|
delete |
◆ filter()
double online_signal_smoothing::ButterworthFilter::filter |
( |
double |
new_measurement | ) |
|
◆ reset()
void online_signal_smoothing::ButterworthFilter::reset |
( |
const double |
data | ) |
|
The documentation for this class was generated from the following files: