Class LowPass
Low-pass filtering of time-series.
This filter is in a recursive(feedback) IIR form that is simple to implement, has few coefficients,
requires litte memory and computation. This filter is causal, meaning that
for calcuating the filtered value at time k
it does not use future values such as k+1
, but
this is at the expense of introducing a time-shift/phase-shift.
Inherited Members
Namespace: TimeSeriesAnalysis
Assembly: TimeSeriesAnalysis.dll
Syntax
public class LowPass
Constructors
| Edit this page View SourceLowPass(double, double)
Constructor
Declaration
public LowPass(double TimeBase_s, double nanValue = -9999)
Parameters
Type | Name | Description |
---|---|---|
double | TimeBase_s | The time base, the time interval between each time step of the dataset, in seconds |
double | nanValue | value that is to be treated as NaN and ignored |
Methods
| Edit this page View SourceFilter(double, double, int, bool)
Adds a single data point to the filter
Declaration
public double Filter(double signal, double FilterTc_s, int order = 1, bool doReset = false)
Parameters
Type | Name | Description |
---|---|---|
double | signal | data point |
double | FilterTc_s | filter time constant in seconds |
int | order | filter order, either 1 or 2 is supported |
bool | doReset | usually false, setting to true causes filter to reset to the value of signal |
Returns
Type | Description |
---|---|
double |
Filter(double[], double, int, List<int>)
Filter an entire time-series in one command
Declaration
public double[] Filter(double[] signal, double FilterTc_s, int order = 1, List<int> indicesToIgnore = null)
Parameters
Type | Name | Description |
---|---|---|
double[] | signal | the vector of the entire time-series to be filtered |
double | FilterTc_s | filter time constant |
int | order | filter order, either 1 or 2 |
List<int> | indicesToIgnore | for these indices the of the signal, the filter should just "freeze" the value(can be null) |
Returns
Type | Description |
---|---|
double[] | a vector of the filtered time-series |