![]() |
:)
|
Variable state IIR Filter. More...
#include <RustyFilter.hpp>
Public Member Functions | |
| RustyFilter (RustyFilterType type, float frequency, float q) | |
| Constructor for RustyFilter. | |
| void | process (float *sample) override |
| Performs DSP on an audio sample. | |
| void | setModulatorForParameter (std::string parameter, RustyModulator *modulator) override |
| Binds a RustyModulator to a RustyProcessor instance parameter. | |
| void | setParameter (std::string parameter, std::string value) override |
| Sets RustyProcessor parameter to new value. | |
| std::string | getProcessorType () override |
| Function to get processor type. | |
| std::string | getParams () override |
| Function to get processor params. | |
Public Member Functions inherited from RustyProcessor | |
| virtual void | process (float *sample)=0 |
| Performs DSP on an audio sample. | |
| virtual void | setModulatorForParameter (std::string parameter, RustyModulator *modulator)=0 |
| Binds a RustyModulator to a RustyProcessor instance parameter. | |
| virtual void | setParameter (std::string parameter, std::string value)=0 |
| Sets RustyProcessor parameter to new value. | |
| bool | isNumeric (const std::string &str) |
| Function to test if value contains numeric characters. | |
| virtual std::string | getProcessorType ()=0 |
| Function to get processor type. | |
| virtual std::string | getParams ()=0 |
| Function to get processor params. | |
Private Member Functions | |
| void | calcCoefficients () |
| Biquad variable calculator. | |
| float | constrain (float val, float min, float max) |
| Constrain function between a min and max. | |
Private Attributes | |
| float | _a1 = 0 |
| Biquad variable. | |
| float | _a2 = 0 |
| Biquad variable. | |
| float | _b0 = 1 |
| Biquad variable. | |
| float | _b1 = 0 |
| Biquad variable. | |
| float | _b2 = 0 |
| Biquad variable. | |
| float | _x1 |
| Current input sample. | |
| float | _y1 |
| Previous output sample. | |
| float | _x2 |
| Previous input sample. | |
| float | _y2 |
| Previous output sample value -1. | |
| float | _k |
| Biquad variable. | |
| float | _norm |
| Biquad variable. | |
| float | _sum |
| Filter output. | |
| float | _sampleRate |
| float | _frequency |
| float | _q |
| Filter variables. | |
| RustyFilterType | _type |
| Filter type. | |
Additional Inherited Members | |
Public Attributes inherited from RustyProcessor | |
| std::map< std::string, RustyModulator * > | _modulators |
| Map of processors affecting derived RustyProcessor. | |
Variable state IIR Filter.
2-order IIR filter with four states LOW_PASS, HIGH_PASS, BAND_PASS, NOTCH.
Inherited from RustyProcessor.
Definition at line 19 of file RustyFilter.hpp.
| RustyFilter::RustyFilter | ( | RustyFilterType | type, |
| float | frequency, | ||
| float | q | ||
| ) |
Constructor for RustyFilter.
Takes initial parameters for RustyFilter and preps the unit for sample processing.
| type | RustyFilterType to define filter type. |
| frequency | Float of filter cutoff frequency. |
| ratio | Float of q ratio. |
Definition at line 3 of file RustyFilter.cpp.
|
overridevirtual |
Performs DSP on an audio sample.
This pure virtual function performs DSP algorithms on a sample by sample basis. A pointer to a 32bitFloat audio sample is passed as an argument and this will be the value used as the input to the DSP function f(x).
| sample | Pointer to a 32bitFloat audio sample value. |
Implements RustyProcessor.
Definition at line 11 of file RustyFilter.cpp.
|
overridevirtual |
Binds a RustyModulator to a RustyProcessor instance parameter.
This is pure virtual function assigns modulator manipulation to parameters within the DSP unit. Each RustyProcessor derived DSP unit will check the parameter name against suitable parameters, if there is a match the modulator will affect the parameter.
| parameter | String of the parameter to affect. |
| modulator | Pointer to instance of RustyModulator. |
Implements RustyProcessor.
Definition at line 45 of file RustyFilter.cpp.
|
overridevirtual |
Sets RustyProcessor parameter to new value.
This is pure virtual function that assigns a new value to a parameter of RustyProcessor derived DSP units. This function is used at runtime from CLI interaction.
| parameter | String of the parameter to affect. |
| modulator | Pointer to instance of RustyModulator. |
Implements RustyProcessor.
Definition at line 56 of file RustyFilter.cpp.
|
overridevirtual |
Function to get processor type.
Simple function allows CLI to test Processor types for user interaction.
Implements RustyProcessor.
Definition at line 138 of file RustyFilter.cpp.
|
overridevirtual |
Function to get processor params.
Simple function allows CLI to get available params for RustyProcessor child.
Implements RustyProcessor.
Definition at line 143 of file RustyFilter.cpp.
|
private |
Biquad variable calculator.
Calculates filter biquads based on user's input variables or modulator changes.
Definition at line 98 of file RustyFilter.cpp.
|
inlineprivate |
Constrain function between a min and max.
Constrains particular variables that would break IIR Filter.
Definition at line 56 of file RustyFilter.hpp.
|
private |
Biquad variable.
Definition at line 59 of file RustyFilter.hpp.
|
private |
Biquad variable.
Definition at line 60 of file RustyFilter.hpp.
|
private |
Biquad variable.
Definition at line 61 of file RustyFilter.hpp.
|
private |
Biquad variable.
Definition at line 62 of file RustyFilter.hpp.
|
private |
Biquad variable.
Definition at line 63 of file RustyFilter.hpp.
|
private |
Current input sample.
Definition at line 64 of file RustyFilter.hpp.
|
private |
Previous output sample.
Definition at line 65 of file RustyFilter.hpp.
|
private |
Previous input sample.
Definition at line 66 of file RustyFilter.hpp.
|
private |
Previous output sample value -1.
Definition at line 67 of file RustyFilter.hpp.
|
private |
Biquad variable.
Definition at line 68 of file RustyFilter.hpp.
|
private |
Biquad variable.
Definition at line 69 of file RustyFilter.hpp.
|
private |
Filter output.
Definition at line 70 of file RustyFilter.hpp.
|
private |
Definition at line 72 of file RustyFilter.hpp.
|
private |
Definition at line 72 of file RustyFilter.hpp.
|
private |
Filter variables.
Definition at line 72 of file RustyFilter.hpp.
|
private |
Filter type.
Definition at line 73 of file RustyFilter.hpp.