mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-14 04:04:34 +00:00
Merge pull request #774 from Brumi-2021/Minor_ADSB_Compas_sinf32_array_value_correction_and_comments
Minor sin_f32_table correction and comments
This commit is contained in:
commit
3291c7e2a0
@ -35,7 +35,10 @@ w = numpy.arange(length, dtype=numpy.float64) * (2 * numpy.pi / length)
|
||||
v = numpy.sin(w)
|
||||
print(v)
|
||||
*/
|
||||
constexpr uint16_t sine_table_f32_period = 256;
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user