chrono::utils::ChMovingAverage Class Reference

Description

Moving average filter for smoothing a data array.

#include <ChFilters.h>

Public Member Functions

 ChMovingAverage (const std::valarray< double > &data, int n)
 Construct a moving average filter (centered). More...
 
const std::valarray< double > & Get () const
 Return the filtered output.
 
double Get (int i) const
 Return the specified component of the filtered output.
 

Constructor & Destructor Documentation

chrono::utils::ChMovingAverage::ChMovingAverage ( const std::valarray< double > &  data,
int  n 
)

Construct a moving average filter (centered).

The average is calculated over 2*n+1 points

Parameters
datainput data
nfilter half-span