Minor sin_f32_table correction and comments

This commit is contained in:
Brumi-2021 2022-12-29 23:27:15 +01:00
parent 297063873f
commit 64ca9f6a68

View File

@ -36,6 +36,9 @@ v = numpy.sin(w)
print(v)
*/
constexpr uint16_t sine_table_f32_period = 256;
// periode is 256 . means sine_table_f32[0]= sine_table_f32[0+256], sine_table_f32[1]=sine_table_f32[1+256] (those two added manualy)
// Then table has 257 values , [0,..255] + [256] and [257], those two are used when we interpolate[255] with [255+1], and [256] with [256+1]
// [256] index is needed in the function sin_f32() when we are inputing very small radian values , example , sin_f32((-1e-14) in radians)
static constexpr std::array<float, sine_table_f32_period + 2> sine_table_f32{
0.00000000e+00, 2.45412285e-02, 4.90676743e-02,
@ -123,7 +126,7 @@ static constexpr std::array<float, sine_table_f32_period + 2> sine_table_f32{
-2.42980180e-01, -2.19101240e-01, -1.95090322e-01,
-1.70961889e-01, -1.46730474e-01, -1.22410675e-01,
-9.80171403e-02, -7.35645636e-02, -4.90676743e-02,
-2.45412285e-02, 0.00000000e+00, 0.00000000e+00
-2.45412285e-02, 0.00000000e+00, 2.45412285e-02
};
inline float sin_f32(const float w) {