SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
fixedtraits.h
Go to the documentation of this file.
1 // Copyright (C) 2018 F4EXB //
3 // written by Edouard Griffiths //
4 // //
5 // This program is free software; you can redistribute it and/or modify //
6 // it under the terms of the GNU General Public License as published by //
7 // the Free Software Foundation as version 3 of the License, or //
8 // (at your option) any later version. //
9 // //
10 // This program is distributed in the hope that it will be useful, //
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
13 // GNU General Public License V3 for more details. //
14 // //
15 // You should have received a copy of the GNU General Public License //
16 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
18 
19 #ifndef SDRBASE_UTIL_FIXEDTRAITS_H_
20 #define SDRBASE_UTIL_FIXEDTRAITS_H_
21 
22 #include <stdint.h>
23 
24 #include "export.h"
25 
26 template<uint32_t IntBits>
28 {
29 };
30 
31 template<>
33 {
34  static const uint32_t fixed_resolution_shift = 28;
35  static const int64_t fixed_resolution = 1LL << fixed_resolution_shift;
36  static const int32_t max_power = 63 - fixed_resolution_shift;
37  static const int64_t internal_pi = 0x3243f6a8;
38  static const int64_t internal_two_pi = 0x6487ed51;
39  static const int64_t internal_half_pi = 0x1921fb54;
40  static const int64_t internal_quarter_pi = 0xc90fdaa;
41  static const int64_t log_two_power_n_reversed[35]; // 35 = 63 - 28
42  static const int64_t log_one_plus_two_power_minus_n[28];
43  static const int64_t log_one_over_one_minus_two_power_minus_n[28];
44  static const int64_t arctantab[32];
45 };
46 
47 template<>
49 {
50  static const uint32_t fixed_resolution_shift = 16;
51  static const int64_t fixed_resolution = 1LL << fixed_resolution_shift;
52  static const int32_t max_power = 63 - fixed_resolution_shift;
53  static const int64_t internal_pi = 205887;
54  static const int64_t internal_two_pi = 411775;
55  static const int64_t internal_half_pi = 102944;
56  static const int64_t internal_quarter_pi = 51472;
57  static const int64_t log_two_power_n_reversed[47]; // 47 = 63 - 16
58  static const int64_t log_one_plus_two_power_minus_n[16];
59  static const int64_t log_one_over_one_minus_two_power_minus_n[16];
60  static const int64_t arctantab[32];
61 };
62 
63 template<>
65 {
66  static const uint32_t fixed_resolution_shift = 23;
67  static const int64_t fixed_resolution = 1LL << fixed_resolution_shift;
68  static const int32_t max_power = 63 - fixed_resolution_shift;
69  static const int64_t internal_pi = 26353589;
70  static const int64_t internal_two_pi = 52707179;
71  static const int64_t internal_half_pi = 13176795;
72  static const int64_t internal_quarter_pi = 6588397;
73  static const int64_t log_two_power_n_reversed[40]; // 40 = 63 - 23
74  static const int64_t log_one_plus_two_power_minus_n[23];
75  static const int64_t log_one_over_one_minus_two_power_minus_n[23];
76  static const int64_t arctantab[32];
77 };
78 
79 template<>
81 {
82  static const uint32_t fixed_resolution_shift = 24;
83  static const int64_t fixed_resolution = 1LL << fixed_resolution_shift;
84  static const int32_t max_power = 63 - fixed_resolution_shift;
85  static const int64_t internal_pi = 52707179;
86  static const int64_t internal_two_pi = 105414357;
87  static const int64_t internal_half_pi = 26353589;
88  static const int64_t internal_quarter_pi = 13176795;
89  static const int64_t log_two_power_n_reversed[39]; // 39 = 63 - 24
90  static const int64_t log_one_plus_two_power_minus_n[24];
91  static const int64_t log_one_over_one_minus_two_power_minus_n[24];
92  static const int64_t arctantab[32];
93 };
94 
95 #endif /* SDRBASE_UTIL_FIXEDTRAITS_H_ */
__int64 int64_t
Definition: rtptypes_win.h:47
unsigned int uint32_t
Definition: rtptypes_win.h:46
int int32_t
Definition: rtptypes_win.h:45
#define SDRBASE_API
Definition: export.h:40