Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
constants.hpp
Go to the documentation of this file.
1// sbl/dsp/math/constants.hpp — The numbers every layer reaches for
2//
3// One definition of pi for the whole audio stack, so no header carries its
4// own literal (style guide: no magic numbers; RPT-032 D3 / backlog #48).
5
6#ifndef SBL_DSP_MATH_CONSTANTS_HPP_
7#define SBL_DSP_MATH_CONSTANTS_HPP_
8
9namespace sbl::dsp::math {
10
11inline constexpr float PI = 3.14159265358979323846f;
12inline constexpr float TWO_PI = 2.0f * PI;
13inline constexpr float HALF_PI = 0.5f * PI;
14
15/// The phase accumulator's full range: uint32_t [0, 2^32) is one cycle.
16inline constexpr float PHASE_ACCUMULATOR_RANGE = 4294967296.0f;
17
18} // namespace sbl::dsp::math
19
20#endif // SBL_DSP_MATH_CONSTANTS_HPP_
Cross-cutting math used at every audio layer.
Definition clamp.hpp:10
constexpr float PI
Definition constants.hpp:11
constexpr float PHASE_ACCUMULATOR_RANGE
The phase accumulator's full range: uint32_t [0, 2^32) is one cycle.
Definition constants.hpp:16
constexpr float TWO_PI
Definition constants.hpp:12
constexpr float HALF_PI
Definition constants.hpp:13