AR + GPS Location  3.0.0
All Classes Namespaces Functions Variables Properties Events Pages
LowPassFilter.cs
1 namespace ARLocation
2 {
3  public class LowPassFilter
4  {
5  private double lastValue;
6  public double smoothFactor;
7 
8  public LowPassFilter(double smoothFactor = 0.5f)
9  {
10  this.smoothFactor = smoothFactor;
11  }
12 
13  public double Apply(double value)
14  {
15  if (!(smoothFactor > 0.0))
16  {
17  return value;
18  }
19 
20  lastValue = smoothFactor * lastValue + (1 - smoothFactor) * value;
21 
22  return lastValue;
23  }
24  }
25 }
ARLocation.LowPassFilter
Definition: LowPassFilter.cs:4
ARLocation
Definition: ARLocationConfigInspector.cs:7