|
Apollo
6.0
Open source self driving car software
|
The MeanFilter class is used to smoothen a series of noisy numbers, such as sensor data or the output of a function that we wish to be smoother. More...
#include <mean_filter.h>

Public Member Functions | |
| MeanFilter (const std::uint_fast8_t window_size) | |
| Initializes a MeanFilter with a given window size. More... | |
| MeanFilter ()=default | |
| Default constructor; defers initialization. More... | |
| ~MeanFilter ()=default | |
| Default destructor. More... | |
| double | Update (const double measurement) |
| Processes a new measurement in amortized constant time. More... | |
The MeanFilter class is used to smoothen a series of noisy numbers, such as sensor data or the output of a function that we wish to be smoother.
This is achieved by keeping track of the last k measurements (where k is the window size), and returning the average of all but the minimum and maximum measurements, which are likely to be outliers.
|
explicit |
Initializes a MeanFilter with a given window size.
| window_size | The window size of the MeanFilter. Older measurements are discarded. |
|
default |
Default constructor; defers initialization.
|
default |
Default destructor.
| double apollo::common::MeanFilter::Update | ( | const double | measurement | ) |
Processes a new measurement in amortized constant time.
| measurement | The measurement to be processed by the filter. |
1.8.13