FastLED 3.10.8
Loading...
Searching...
No Matches

◆ computePinkNoiseGain()

float fl::audio::computePinkNoiseGain ( float freq_hz,
float f_ref )
inline

Compute pink noise compensation gain for a single frequency.

Pink noise has 1/f spectral density → equal power per octave. To flatten it: multiply by sqrt(f / f_ref).

Parameters
freq_hzBin center frequency in Hz
f_refReference frequency (typically geometric mean of all bins)
Returns
Compensation gain factor

Definition at line 285 of file mic_response_data.h.

285 {
286 if (freq_hz <= 0.0f || f_ref <= 0.0f) return 1.0f;
287 return fl::sqrtf(freq_hz / f_ref);
288}
float sqrtf(float value) FL_NO_EXCEPT
Definition math.h:461

References fl::FL_NO_EXCEPT, and fl::sqrtf().

Referenced by computePinkNoiseGains().

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