AntiMicroX
Public Member Functions | Static Public Attributes | Private Attributes
PT1Filter Class Reference

Implementation of a first order lag or PT1 filter. Can be used for example to smooth noisy values a bit or detect envelopes. More...

#include <pt1filter.h>

Public Member Functions

 PT1Filter (double tau=1, double rate=1)
 
double process (double value)
 Processes a new sample. More...
 
double getValue () const
 Get the current filter output value. More...
 
void reset ()
 Resets the filter state to default. More...
 

Static Public Attributes

static const double FALLBACK_RATE = 200
 

Private Attributes

double m_dt_tau
 
double m_value
 

Detailed Description

Implementation of a first order lag or PT1 filter. Can be used for example to smooth noisy values a bit or detect envelopes.

See also
https://en.wikipedia.org/wiki/Low-pass_filter

Constructor & Destructor Documentation

◆ PT1Filter()

PT1Filter::PT1Filter ( double  tau = 1,
double  rate = 1 
)
Here is the call graph for this function:

Member Function Documentation

◆ getValue()

double PT1Filter::getValue ( ) const
inline

Get the current filter output value.

Returns
Current filter output value.
Here is the caller graph for this function:

◆ process()

double PT1Filter::process ( double  value)

Processes a new sample.

Returns
New filter output value.
Here is the caller graph for this function:

◆ reset()

void PT1Filter::reset ( )

Resets the filter state to default.

Here is the caller graph for this function:

Field Documentation

◆ FALLBACK_RATE

const double PT1Filter::FALLBACK_RATE = 200
static

◆ m_dt_tau

double PT1Filter::m_dt_tau
private

◆ m_value

double PT1Filter::m_value
private

The documentation for this class was generated from the following files: