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.
sdrbase
util
fixedtraits.cpp
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
#include "
fixedtraits.h
"
20
21
// 1.0 = 2^28 internal representation
22
23
// ln(1/2^n), n = index+1 then list is reversed
24
const
int64_t
FixedTraits<28>::log_two_power_n_reversed
[35] = {
25
0x18429946ELL,
26
0x1791272EFLL,
27
0x16DFB516FLL,
28
0x162E42FF0LL,
29
0x157CD0E70LL,
30
0x14CB5ECF1LL,
31
0x1419ECB71LL,
32
0x13687A9F2LL,
33
0x12B708872LL,
34
0x1205966F3LL,
35
0x115424573LL,
36
0x10A2B23F4LL,
37
0xFF140274LL,
38
0xF3FCE0F5LL,
39
0xE8E5BF75LL,
40
0xDDCE9DF6LL,
41
0xD2B77C76LL,
42
0xC7A05AF7LL,
43
0xBC893977LL,
44
0xB17217F8LL,
45
0xA65AF679LL,
46
0x9B43D4F9LL,
47
0x902CB379LL,
48
0x851591FaLL,
49
0x79FE707bLL,
50
0x6EE74EFbLL,
51
0x63D02D7BLL,
52
0x58B90BFcLL,
53
0x4DA1EA7CLL,
54
0x428AC8FdLL,
55
0x3773A77DLL,
56
0x2C5C85FeLL,
57
0x2145647ELL,
58
0x162E42FfLL,
59
0xB17217FLL
60
};
61
62
// ln(1+2^-n), n = index+1
63
const
int64_t
FixedTraits<28>::log_one_plus_two_power_minus_n
[28] = {
64
0x67CC8FBLL,
65
0x391FEF9LL,
66
0x1E27077LL,
67
0xF85186LL,
68
0x7E0A6CLL,
69
0x3F8151LL,
70
0x1FE02ALL,
71
0xFF805LL,
72
0x7FE01LL,
73
0x3FF80LL,
74
0x1FFE0LL,
75
0xFFF8LL,
76
0x7FFELL,
77
0x4000LL,
78
0x2000LL,
79
0x1000LL,
80
0x800LL,
81
0x400LL,
82
0x200LL,
83
0x100LL,
84
0x80LL,
85
0x40LL,
86
0x20LL,
87
0x10LL,
88
0x8LL,
89
0x4LL,
90
0x2LL,
91
0x1LL
92
};
93
94
// ln(1/1-2^-n), n = index+1
95
const
int64_t
FixedTraits<28>::log_one_over_one_minus_two_power_minus_n
[28] = {
96
0xB172180LL,
97
0x49A5884LL,
98
0x222F1D0LL,
99
0x108598BLL,
100
0x820AECLL,
101
0x408159LL,
102
0x20202BLL,
103
0x100805LL,
104
0x80201LL,
105
0x40080LL,
106
0x20020LL,
107
0x10008LL,
108
0x8002LL,
109
0x4001LL,
110
0x2000LL,
111
0x1000LL,
112
0x800LL,
113
0x400LL,
114
0x200LL,
115
0x100LL,
116
0x80LL,
117
0x40LL,
118
0x20LL,
119
0x10LL,
120
0x8LL,
121
0x4LL,
122
0x2LL,
123
0x1LL
124
};
125
126
const
int64_t
FixedTraits<28>::arctantab
[32] = {
127
297197971,
128
210828714,
129
124459457,
130
65760959,
131
33381290,
132
16755422,
133
8385879,
134
4193963,
135
2097109,
136
1048571,
137
524287,
138
262144,
139
131072,
140
65536,
141
32768,
142
16384,
143
8192,
144
4096,
145
2048,
146
1024,
147
512,
148
256,
149
128,
150
64,
151
32,
152
16,
153
8,
154
4,
155
2,
156
1,
157
0,
158
0
159
};
160
161
// 1.0 = 2^16 internal representation
162
163
const
int64_t
FixedTraits<16>::log_two_power_n_reversed
[47] = {
164
2135026LL,
165
2089600LL,
166
2044174LL,
167
1998748LL,
168
1953322LL,
169
1907896LL,
170
1862470LL,
171
1817044LL,
172
1771618LL,
173
1726192LL,
174
1680765LL,
175
1635339LL,
176
1589913LL,
177
1544487LL,
178
1499061LL,
179
1453635LL,
180
1408209LL,
181
1362783LL,
182
1317357LL,
183
1271931LL,
184
1226505LL,
185
1181078LL,
186
1135652LL,
187
1090226LL,
188
1044800LL,
189
999374LL,
190
953948LL,
191
908522LL,
192
863096LL,
193
817670LL,
194
772244LL,
195
726817LL,
196
681391LL,
197
635965LL,
198
590539LL,
199
545113LL,
200
499687LL,
201
454261LL,
202
408835LL,
203
363409LL,
204
317983LL,
205
272557LL,
206
227130LL,
207
181704LL,
208
136278LL,
209
90852LL,
210
45426LL
211
};
212
213
const
int64_t
FixedTraits<16>::log_one_plus_two_power_minus_n
[16] = {
214
26573LL,
215
14624LL,
216
7719LL,
217
3973LL,
218
2017LL,
219
1016LL,
220
510LL,
221
256LL,
222
128LL,
223
64LL,
224
32LL,
225
16LL,
226
8LL,
227
4LL,
228
2LL,
229
1LL
230
};
231
232
const
int64_t
FixedTraits<16>::log_one_over_one_minus_two_power_minus_n
[16] = {
233
45426LL,
234
18854LL,
235
8751LL,
236
4230LL,
237
2081LL,
238
1032LL,
239
514LL,
240
257LL,
241
128LL,
242
64LL,
243
32LL,
244
16LL,
245
8LL,
246
4LL,
247
2LL,
248
1LL
249
};
250
251
const
int64_t
FixedTraits<16>::arctantab
[32] = {
252
72558LL,
253
51471LL,
254
30385LL,
255
16054LL,
256
8149LL,
257
4090LL,
258
2047LL,
259
1023LL,
260
511LL,
261
255LL,
262
127LL,
263
64LL,
264
32LL,
265
16LL,
266
8LL,
267
4LL,
268
2LL,
269
1LL,
270
0LL,
271
0LL,
272
0LL,
273
0LL,
274
0LL,
275
0LL,
276
0LL,
277
0LL,
278
0LL,
279
0LL,
280
0LL,
281
0LL,
282
0LL,
283
0LL
284
};
285
286
// 1.0 = 2^23 internal representation
287
288
const
int64_t
FixedTraits<23>::log_two_power_n_reversed
[40] = {
289
232581599LL,
290
226767059LL,
291
220952519LL,
292
215137979LL,
293
209323439LL,
294
203508899LL,
295
197694359LL,
296
191879819LL,
297
186065279LL,
298
180250740LL,
299
174436200LL,
300
168621660LL,
301
162807120LL,
302
156992580LL,
303
151178040LL,
304
145363500LL,
305
139548960LL,
306
133734420LL,
307
127919880LL,
308
122105340LL,
309
116290800LL,
310
110476260LL,
311
104661720LL,
312
98847180LL,
313
93032640LL,
314
87218100LL,
315
81403560LL,
316
75589020LL,
317
69774480LL,
318
63959940LL,
319
58145400LL,
320
52330860LL,
321
46516320LL,
322
40701780LL,
323
34887240LL,
324
29072700LL,
325
23258160LL,
326
17443620LL,
327
11629080LL,
328
5814540LL
329
};
330
331
const
int64_t
FixedTraits<23>::log_one_plus_two_power_minus_n
[23] = {
332
3401288LL,
333
1871864LL,
334
988036LL,
335
508556LL,
336
258131LL,
337
130059LL,
338
65281LL,
339
32704LL,
340
16368LL,
341
8188LL,
342
4095LL,
343
2048LL,
344
1024LL,
345
512LL,
346
256LL,
347
128LL,
348
64LL,
349
32LL,
350
16LL,
351
8LL,
352
4LL,
353
2LL,
354
1LL
355
};
356
357
const
int64_t
FixedTraits<23>::log_one_over_one_minus_two_power_minus_n
[23] = {
358
5814540LL,
359
2413252LL,
360
1120143LL,
361
541388LL,
362
266327LL,
363
132107LL,
364
65793LL,
365
32832LL,
366
16400LL,
367
8196LL,
368
4097LL,
369
2048LL,
370
1024LL,
371
512LL,
372
256LL,
373
128LL,
374
64LL,
375
32LL,
376
16LL,
377
8LL,
378
4LL,
379
2LL,
380
1LL
381
};
382
383
const
int64_t
FixedTraits<23>::arctantab
[32] = {
384
9287436LL,
385
6588397LL,
386
3889358LL,
387
2055029LL,
388
1043165LL,
389
523606LL,
390
262058LL,
391
131061LL,
392
65534LL,
393
32767LL,
394
16383LL,
395
8192LL,
396
4096LL,
397
2048LL,
398
1024LL,
399
512LL,
400
256LL,
401
128LL,
402
64LL,
403
32LL,
404
16LL,
405
8LL,
406
4LL,
407
2LL,
408
1LL,
409
0LL,
410
0LL,
411
0LL,
412
0LL,
413
0LL,
414
0LL,
415
0LL
416
};
417
418
// 1.0 = 2^24 internal representation
419
420
const
int64_t
FixedTraits<24>::log_two_power_n_reversed
[39] = {
421
453534119LL,
422
441905039LL,
423
430275959LL,
424
418646879LL,
425
407017799LL,
426
395388719LL,
427
383759639LL,
428
372130559LL,
429
360501479LL,
430
348872399LL,
431
337243319LL,
432
325614239LL,
433
313985159LL,
434
302356079LL,
435
290726999LL,
436
279097919LL,
437
267468839LL,
438
255839759LL,
439
244210679LL,
440
232581599LL,
441
220952519LL,
442
209323439LL,
443
197694359LL,
444
186065279LL,
445
174436200LL,
446
162807120LL,
447
151178040LL,
448
139548960LL,
449
127919880LL,
450
116290800LL,
451
104661720LL,
452
93032640LL,
453
81403560LL,
454
69774480LL,
455
58145400LL,
456
46516320LL,
457
34887240LL,
458
23258160LL,
459
11629080LL
460
};
461
462
const
int64_t
FixedTraits<24>::log_one_plus_two_power_minus_n
[24] = {
463
6802576LL,
464
3743728LL,
465
1976071LL,
466
1017112LL,
467
516263LL,
468
260117LL,
469
130563LL,
470
65408LL,
471
32736LL,
472
16376LL,
473
8190LL,
474
4096LL,
475
2048LL,
476
1024LL,
477
512LL,
478
256LL,
479
128LL,
480
64LL,
481
32LL,
482
16LL,
483
8LL,
484
4LL,
485
2LL,
486
1LL
487
};
488
489
const
int64_t
FixedTraits<24>::log_one_over_one_minus_two_power_minus_n
[24] = {
490
11629080LL,
491
4826504LL,
492
2240285LL,
493
1082777LL,
494
532655LL,
495
264214LL,
496
131587LL,
497
65664LL,
498
32800LL,
499
16392LL,
500
8194LL,
501
4097LL,
502
2048LL,
503
1024LL,
504
512LL,
505
256LL,
506
128LL,
507
64LL,
508
32LL,
509
16LL,
510
8LL,
511
4LL,
512
2LL,
513
1LL
514
};
515
516
const
int64_t
FixedTraits<24>::arctantab
[32] = {
517
18574873LL,
518
13176794LL,
519
7778716LL,
520
4110059LL,
521
2086330LL,
522
1047213LL,
523
524117LL,
524
262122LL,
525
131069LL,
526
65535LL,
527
32767LL,
528
16384LL,
529
8192LL,
530
4096LL,
531
2048LL,
532
1024LL,
533
512LL,
534
256LL,
535
128LL,
536
64LL,
537
32LL,
538
16LL,
539
8LL,
540
4LL,
541
2LL,
542
1LL,
543
0LL,
544
0LL,
545
0LL,
546
0LL,
547
0LL,
548
0LL
549
};
550
fixedtraits.h
int64_t
__int64 int64_t
Definition:
rtptypes_win.h:47
FixedTraits
Definition:
fixedtraits.h:27
Generated on Fri Aug 2 2019 17:56:33 for SDRAngel by
1.8.13