MCPcopy Create free account
hub / github.com/FastLED/FastLED / applyScaling

Function applyScaling

src/fl/audio/detector/equalizer.cpp.hpp:25–36  ·  view source on GitHub ↗

Apply fft::FFT scaling mode to a single bin value

Source from the content-addressed store, hash-verified

23
24/// Apply fft::FFT scaling mode to a single bin value
25inline float applyScaling(float value, FFTScalingMode mode) {
26 switch (mode) {
27 case FFTScalingMode::SquareRoot:
28 return fl::sqrtf(value);
29 case FFTScalingMode::Logarithmic:
30 return fl::logf(1.0f + value);
31 case FFTScalingMode::None:
32 case FFTScalingMode::Linear:
33 default:
34 return value;
35 }
36}
37
38} // namespace
39

Callers 2

processSampleMethod · 0.85
updateMethod · 0.85

Calls 2

sqrtfFunction · 0.85
logfFunction · 0.85

Tested by

no test coverage detected