|
DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
|
A first or second order analog section, in radians per second: (b2 s^2 + b1 s + b0) / (a2 s^2 + a1 s + a0). More...
#include <FilterDesign.h>
Public Member Functions | |
| double | magnitudeSquared (double omega) const noexcept |
| Squared magnitude at an angular frequency (rad/s). | |
| double | magnitudeDb (double hz) const noexcept |
| Magnitude in decibels at a frequency in hertz. | |
| bool | isSecondOrder () const noexcept |
| Whether the denominator is of second order. | |
| double | poleFrequency () const noexcept |
| The frequency of the poles, in hertz (the corner of a first-order section). | |
Static Public Member Functions | |
| static AnalogSection | lowPass (double hz, double q=0.7071067811865476) noexcept |
| Second-order low-pass, gain Q at the corner. | |
| static AnalogSection | highPass (double hz, double q=0.7071067811865476) noexcept |
| Second-order high-pass, gain Q at the corner. | |
| static AnalogSection | bandPass (double hz, double q=0.7071067811865476) noexcept |
| Band-pass, 0 dB at the centre. | |
| static AnalogSection | notch (double hz, double q=0.7071067811865476) noexcept |
| Notch at the centre, 0 dB away from it. | |
| static AnalogSection | allPass (double hz, double q=0.7071067811865476) noexcept |
| Second-order all-pass (the magnitude is 1; only the phase turns). | |
| static AnalogSection | peak (double hz, double q, double gainDb) noexcept |
| Bell: gainDb at the centre, bandwidth hz / Q at half that gain in decibels. | |
| static AnalogSection | lowShelf (double hz, double gainDb, double slope=1.0) noexcept |
| Second-order low shelf: gainDb below the corner, half of it (in decibels) at the corner. | |
| static AnalogSection | highShelf (double hz, double gainDb, double slope=1.0) noexcept |
| Second-order high shelf: gainDb above the corner, half of it (in decibels) at the corner. | |
| static AnalogSection | lowShelfQ (double hz, double gainDb, double q) noexcept |
| Second-order low shelf by its Q: gainDb below the corner, half of it (in decibels) at the corner whatever the Q. At 0.7071 it is lowShelf() at a slope of 1; above, the response rises over the plateau before the corner and dips under 0 dB after it, more the higher the Q; a cut is the exact inverse of the boost. | |
| static AnalogSection | highShelfQ (double hz, double gainDb, double q) noexcept |
| Second-order high shelf by its Q: lowShelfQ() mirrored about the corner. | |
| static AnalogSection | tiltSecondOrder (double hz, double gainDb, double q=0.7071067811865476) noexcept |
| Second-order tilt: 0 dB at the pivot, half of gainDb down far below it and half of it up far above, 12 dB per octave at most on the way; the Q as in lowShelfQ(). | |
| static AnalogSection | firstOrderLowPass (double hz) noexcept |
| First-order low-pass, -3 dB at the corner. | |
| static AnalogSection | firstOrderHighPass (double hz) noexcept |
| First-order high-pass, -3 dB at the corner. | |
| static AnalogSection | firstOrderLowShelf (double hz, double gainDb) noexcept |
| First-order low shelf: gainDb at DC, half of it (in decibels) at the corner. | |
| static AnalogSection | firstOrderHighShelf (double hz, double gainDb) noexcept |
| First-order high shelf: gainDb at the top, half of it (in decibels) at the corner. | |
| static AnalogSection | tilt (double hz, double gainDb) noexcept |
| First-order tilt: 0 dB at the pivot, half of gainDb down far below it and half of it up far above. | |
| static AnalogSection | make (double b2, double b1, double b0, double a2, double a1, double a0) noexcept |
| Builds a section from its six coefficients. | |
Public Attributes | |
| double | b2 = 0.0 |
| double | b1 = 0.0 |
| double | b0 = 1.0 |
| double | a2 = 0.0 |
| double | a1 = 0.0 |
| double | a0 = 1.0 |
A first or second order analog section, in radians per second: (b2 s^2 + b1 s + b0) / (a2 s^2 + a1 s + a0).
Definition at line 69 of file FilterDesign.h.
|
inlinestaticnoexcept |
Second-order all-pass (the magnitude is 1; only the phase turns).
Definition at line 130 of file FilterDesign.h.
|
inlinestaticnoexcept |
Band-pass, 0 dB at the centre.
Definition at line 116 of file FilterDesign.h.
|
inlinestaticnoexcept |
First-order high-pass, -3 dB at the corner.
Definition at line 197 of file FilterDesign.h.
|
inlinestaticnoexcept |
First-order high shelf: gainDb at the top, half of it (in decibels) at the corner.
Definition at line 211 of file FilterDesign.h.
|
inlinestaticnoexcept |
First-order low-pass, -3 dB at the corner.
Definition at line 190 of file FilterDesign.h.
|
inlinestaticnoexcept |
First-order low shelf: gainDb at DC, half of it (in decibels) at the corner.
Definition at line 204 of file FilterDesign.h.
|
inlinestaticnoexcept |
Second-order high-pass, gain Q at the corner.
Definition at line 109 of file FilterDesign.h.
|
inlinestaticnoexcept |
Second-order high shelf: gainDb above the corner, half of it (in decibels) at the corner.
Definition at line 151 of file FilterDesign.h.
|
inlinestaticnoexcept |
Second-order high shelf by its Q: lowShelfQ() mirrored about the corner.
Definition at line 171 of file FilterDesign.h.
|
inlinenoexcept |
Whether the denominator is of second order.
Definition at line 90 of file FilterDesign.h.
|
inlinestaticnoexcept |
Second-order low-pass, gain Q at the corner.
Definition at line 102 of file FilterDesign.h.
|
inlinestaticnoexcept |
Second-order low shelf: gainDb below the corner, half of it (in decibels) at the corner.
Definition at line 144 of file FilterDesign.h.
|
inlinestaticnoexcept |
Second-order low shelf by its Q: gainDb below the corner, half of it (in decibels) at the corner whatever the Q. At 0.7071 it is lowShelf() at a slope of 1; above, the response rises over the plateau before the corner and dips under 0 dB after it, more the higher the Q; a cut is the exact inverse of the boost.
Definition at line 164 of file FilterDesign.h.
|
inlinenoexcept |
Magnitude in decibels at a frequency in hertz.
Definition at line 84 of file FilterDesign.h.
|
inlinenoexcept |
Squared magnitude at an angular frequency (rad/s).
Definition at line 75 of file FilterDesign.h.
|
inlinestaticnoexcept |
Builds a section from its six coefficients.
Definition at line 225 of file FilterDesign.h.
|
inlinestaticnoexcept |
Notch at the centre, 0 dB away from it.
Definition at line 123 of file FilterDesign.h.
|
inlinestaticnoexcept |
Bell: gainDb at the centre, bandwidth hz / Q at half that gain in decibels.
Definition at line 137 of file FilterDesign.h.
|
inlinenoexcept |
The frequency of the poles, in hertz (the corner of a first-order section).
Definition at line 93 of file FilterDesign.h.
|
inlinestaticnoexcept |
First-order tilt: 0 dB at the pivot, half of gainDb down far below it and half of it up far above.
Definition at line 218 of file FilterDesign.h.
|
inlinestaticnoexcept |
Second-order tilt: 0 dB at the pivot, half of gainDb down far below it and half of it up far above, 12 dB per octave at most on the way; the Q as in lowShelfQ().
Definition at line 182 of file FilterDesign.h.
| double dspark::AnalogSection::a0 = 1.0 |
Definition at line 72 of file FilterDesign.h.
| double dspark::AnalogSection::a1 = 0.0 |
Definition at line 72 of file FilterDesign.h.
| double dspark::AnalogSection::a2 = 0.0 |
Definition at line 72 of file FilterDesign.h.
| double dspark::AnalogSection::b0 = 1.0 |
Definition at line 71 of file FilterDesign.h.
| double dspark::AnalogSection::b1 = 0.0 |
Definition at line 71 of file FilterDesign.h.
| double dspark::AnalogSection::b2 = 0.0 |
Definition at line 71 of file FilterDesign.h.