|
LMMS
|
#include <biquad.h>
Public Types | |
| typedef std::complex< double > | cfloat |
Public Member Functions | |
| biquad_coeffs () | |
| void | set_null () |
| void | set_lp_rbj (float fc, float q, float sr, float gain=1.0) |
| void | set_lp_zoelzer (float fc, float q, float odsr, float gain=1.0) |
| void | set_hp_rbj (float fc, float q, float esr, float gain=1.0) |
| void | set_hp_rbj_optimized (float fc, float q, float esr, float gain=1.0) |
| void | set_bp_rbj (double fc, double q, double esr, double gain=1.0) |
| void | set_br_rbj (double fc, double q, double esr, double gain=1.0) |
| void | set_allpass (float freq, float pole_r, float sr) |
| void | set_bilinear (double aa0, double aa1, double aa2, double ab0, double ab1, double ab2) |
| set digital filter parameters based on given analog filter parameters | |
| void | set_bilinear_direct (double aa0, double aa1, double aa2, double ab1, double ab2) |
| set digital filter parameters directly | |
| void | set_peakeq_rbj (double freq, double q, double peak, double sr) |
| void | set_lowshelf_rbj (float freq, float q, float peak, float sr) |
| void | set_highshelf_rbj (float freq, float q, float peak, float sr) |
| void | copy_coeffs (const biquad_coeffs &src) |
| copy coefficients from another biquad | |
| float | freq_gain (float freq, float sr) const |
| cfloat | h_z (const cfloat &z) const |
Static Public Member Functions | |
| static double | prewarp (float freq, float sr) |
| prewarping for bilinear transform, maps given digital frequency to analog counterpart for analog filter design | |
| static double | unwarp (float omega, float sr) |
| convert analog angular frequency value to digital | |
| static double | unwarpf (float t, float sr) |
| convert analog filter time constant to digital counterpart | |
Public Attributes | |
| double | a0 |
| double | a1 |
| double | a2 |
| double | b1 |
| double | b2 |
Coefficients for two-pole two-zero filter, for floating point values, plus a bunch of functions to set them to typical values.
Coefficient calculation is based on famous Robert Bristow-Johnson's equations, except where it's not. The coefficient calculation is NOT mine, the only exception is the lossy optimization in Zoelzer and rbj HP filter code.
See http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt for reference.
don't use this for integers because it won't work
| typedef std::complex<double> dsp::biquad_coeffs::cfloat |
|
inline |
|
inline |
copy coefficients from another biquad
|
inline |
Return H(z) the filter's gain at frequency freq
| z | Z variable (e^jw) |
|
inlinestatic |
prewarping for bilinear transform, maps given digital frequency to analog counterpart for analog filter design
|
inline |
|
inline |
set digital filter parameters based on given analog filter parameters
|
inline |
set digital filter parameters directly
|
inline |
Bandpass filter based on Robert Bristow-Johnson's equations (normalized to 1.0 at center frequency)
| fc | center frequency (gain at fc = 1.0) |
| q | =~ fc/bandwidth (not quite, but close) - 1/Q = 2*sinh(ln(2)/2*BW*w0/sin(w0)) |
| sr | sample rate |
| gain | amplification (gain at sr/2) |
|
inline |
|
inline |
RBJ high shelf EQ - amplitication of 0dB at 0 Hz and of peak at sr/2 Hz
|
inline |
Highpass filter based on Robert Bristow-Johnson's equations
| fc | resonant frequency |
| q | resonance (gain at fc) |
| sr | sample rate |
| gain | amplification (gain at sr/2) |
|
inline |
|
inline |
RBJ low shelf EQ - amplitication of 'peak' at 0 Hz and of 1.0 (0dB) at sr/2 Hz
|
inline |
|
inline |
|
inline |
|
inline |
RBJ peaking EQ
| peak | peak gain (1.0 means no peak, >1.0 means a peak, less than 1.0 is a dip) |
|
inlinestatic |
convert analog angular frequency value to digital
|
inlinestatic |
convert analog filter time constant to digital counterpart
| double dsp::biquad_coeffs::a0 |
| double dsp::biquad_coeffs::a1 |
| double dsp::biquad_coeffs::a2 |
| double dsp::biquad_coeffs::b1 |
| double dsp::biquad_coeffs::b2 |