|void||SetF3dB(double f3dB, double frequency)|
Reimplemented Public Functions
|virtual void||Create(const char *shortName, CDPBaseObject *pParent)|
|virtual std::string||GetNodeTypeName() const override|
- 42 public functions inherited from CDPBaseObject
- 18 public functions inherited from CDP::StudioAPI::CDPNode
- 16 public functions inherited from CDP::StudioAPI::ICDPNode
Additional Inherited Members
- 1 static public member inherited from CDPBaseObject
- 1 protected function inherited from CDPBaseObject
- 1 protected function inherited from CDP::StudioAPI::CDPNode
- 10 protected variables inherited from CDPBaseObject
The IIRFilter class is the 1st order IIR low-pass filter. Implements the difference equation:
y[n] = b0 * x[n] + (1-b0) * y[n-1];
or in C++ form:
y_n = b0 * x + (1.0 - b0) * y_n1; or y_n += b0*(x - y_n)
Selecting a suitable cut-off frequency
SetF3dB() sets a new b0 using the following formula:
b = 2 * PI * f3dB / fs
This relationship between b and the cut-off frequency is valid only for b << 1.
It is recommended to use SetF3db(), as this will prevent the filter characteristic from changing if the sampling freqency is changed.
Note: The stability requirement for the first order filter is that b>0 and b<=1. This leads to the following requirement on f3db:
f3db < fs / (2 * PI)
or, expressed as digital frequency F = f/Fs:
F3db < 1 / (2 * PI)'
Member Function Documentation
Constructor. Initializes members to safe values.
Calculates filter output from x. Call this function periodically at a fixed sample interval, exacly once each period. Returns output value from filter.
Note: To read output from filter more than once each period, use Value() method to prevent a new output from being calculated again.
[virtual] void IIRFilter::Create(const char *shortName, CDPBaseObject *pParent)
Reimplemented from CDPBaseObject::Create().
Creates the IIRFilter with shortName and pParent object.
Returns filter constant b0 value.
Reimplemented from ICDPNode::GetNodeTypeName().
Initializes the filter and sets filter b0. This function can also be used to reset the filter memory and output. For a frequency-invariant filter,
See also SetF3dB().
Sets new filter constant b0 from newb0
Sets new filter constant b0 by specifying cut-off frequency f3db and frequency (both in Hz).
Sets the output directly from newValue
Returns current output value.