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

◆ q_from_decay()

MAYAFLUX_API double MayaFlux::Kinesis::Discrete::q_from_decay ( double  frequency,
double  seconds,
double  sample_rate 
)
noexcept

Q that gives the bandpass section a stated ring time.

Parameters
frequencyCentre frequency in Hz
secondsTime for the ring to fall by 1/e
sample_rateSample rate in Hz

Exact for the biquad_bandpass family, whose pole radius squared is (1 - alpha) / (1 + alpha). The result is not limited to any range.

Definition at line 157 of file Coefficients.cpp.

158{
159 const double radius = pole_radius_from_decay(seconds, sample_rate);
160 const double radius_sq = radius * radius;
161 const double alpha = (1.0 - radius_sq) / (1.0 + radius_sq);
162 const auto t = terms(frequency, 1.0, sample_rate);
163 return t.sinw0 / (2.0 * alpha);
164}
double alpha
float radius
double frequency
double pole_radius_from_decay(double seconds, double sample_rate) noexcept
Pole radius whose impulse response falls by 1/e in a given time.

References alpha, frequency, pole_radius_from_decay(), and radius.

Referenced by MayaFlux::Nodes::Network::ResonatorNetwork::set_decay().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: