MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / coeffFromMs

Function coeffFromMs

src/core/ClientComp.cpp:24–29  ·  view source on GitHub ↗

Classic time-constant coefficient: y += α·(target - y) with α = 1 - exp(-1 / (fs · τ)). Hits ≈63 % of the step in τ seconds.

Source from the content-addressed store, hash-verified

22// Classic time-constant coefficient: y += α·(target - y) with
23// α = 1 - exp(-1 / (fs · τ)). Hits ≈63 % of the step in τ seconds.
24float coeffFromMs(float ms, double sampleRate) noexcept
25{
26 if (ms <= 0.0f) return 1.0f;
27 const float tau = ms * 0.001f;
28 return 1.0f - std::exp(-1.0f / static_cast<float>(sampleRate * tau));
29}
30
31} // namespace
32

Callers 1

recacheIfDirtyMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected