MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ resonator()

MAYAFLUX_API void MayaFlux::Kinesis::Discrete::resonator ( double  pole_radius,
double  pole_angle,
std::vector< double > &  a,
std::vector< double > &  b 
)

Two-pole resonator specified by z-plane pole position.

Places a conjugate pole pair at radius pole_radius and angle pole_angle rather than deriving them from a cutoff and Q. Ring time grows as the radius approaches 1.0; the resonant frequency is pole_angle * sample_rate / (2 * pi).

The numerator is a single scalar normalising peak magnitude to unity, so b has length 1 and no zeros are placed. For a resonator with zeros at DC and Nyquist, use biquad_bandpass instead.

Parameters
pole_radiusPole magnitude, clamped to [0, 0.9999]
pole_anglePole angle in radians, in [0, pi]
aDenominator output, resized to 3, a[0] == 1.0
bNumerator output, resized to 1

Definition at line 403 of file Coefficients.cpp.

405{
406 const double r = std::clamp(pole_radius, 0.0, 0.9999);
407 const double theta = std::clamp(pole_angle, 0.0, std::numbers::pi);
408 const double cos_theta = std::cos(theta);
409
410 a.assign({ 1.0, -2.0 * r * cos_theta, r * r });
411
412 const double gain = (1.0 - r)
413 * std::sqrt(1.0 - 2.0 * r * std::cos(2.0 * theta) + r * r);
414 b.assign({ gain });
415}
size_t a
size_t b
float gain

References a, b, and gain.