void MovingAverageFilter(TVec *Data, int MaskSize, int DataIndex = 0, int Len = - 1);
Filter data with a moving average filter.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Data | TVec * | |
| 2 | MaskSize | int | |
| 3 | DataIndex = 0 | int | |
| 4 | Len = - 1 | int |
Remarks:
Applies moving average filter to Data from DataIndex to DataIndex+Len. Set Len to -1 to use the full Data length. MaskSize defines the length of the filter in samples. This MovingAverageFilter routine can be used to filter a block of data (not for streaming).
Examples
#include "MtxExpr.h"
#include "Units.SignalUtils.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Signal;
using namespace Dew::Signal::Units::SignalUtils;
void Example()
{
Vector b(0);
Vector c(0);
b.Size(300);
Tone(b, 300, 5.0 / 300, 0, 1, false);
c.Copy(b);
MovingAverageFilter(b, 20, 0, MtxVecEOA); //from Index 0 to EndOfArray
}
See Also: SignalUtils::MovingAverageImpulse, SignalUtils::FirFilter, SignalUtils::KaiserImpulse, OptimalFir::RemezImpulse
Declared in Dew::Signal::Units::SignalUtils · Dew.Signal/Units.SignalUtils.h · Cross-compiler