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.
hbfiltertraits.h
Go to the documentation of this file.
1 // Copyright (C) 2016 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_DSP_HBFILTERTRAITS_H_
20 #define SDRBASE_DSP_HBFILTERTRAITS_H_
21 
22 #include <stdint.h>
23 #include "export.h"
24 
25 // uses Q1.14 format internally, input and output are S16
26 
27 /*
28  * supported filter orders: 96, 80, 64, 48, 32
29  * any usage of another value will be prevented by compilation errors
30  */
31 template<uint32_t HBFilterOrder>
33 {
34 };
35 
36 template<>
38 {
39  static const int32_t hbOrder = 16;
40  static const int32_t hbShift = 12;
41  static const int16_t hbMod[16+6];
42 #ifdef _MSC_VER
43  __declspec(align(16)) static const int32_t hbCoeffs[4];
44 #else
45  static const int32_t hbCoeffs[4] __attribute__ ((aligned (16)));
46 #endif
47  static const double hbCoeffsF[4];
48 };
49 
50 template<>
52 {
53  static const int32_t hbOrder = 32;
54  static const int32_t hbShift = 12;
55  static const int16_t hbMod[32+6];
56 #ifdef _MSC_VER
57  __declspec(align(32)) static const int32_t hbCoeffs[8];
58 #else
59  static const int32_t hbCoeffs[8] __attribute__ ((aligned (32)));
60 #endif
61  static const double hbCoeffsF[8];
62 };
63 
64 template<>
66 {
67  static const int32_t hbOrder = 48;
68  static const int32_t hbShift = 12;
69  static const int16_t hbMod[48+6];
70 #ifdef _MSC_VER
71  __declspec(align(16)) static const int32_t hbCoeffs[12];
72 #else
73  static const int32_t hbCoeffs[12] __attribute__ ((aligned (16)));
74 #endif
75  static const double hbCoeffsF[12];
76 };
77 
78 template<>
80 {
81  static const int32_t hbOrder = 64;
82  static const int32_t hbShift = 12;
83  static const int16_t hbMod[64+6];
84 #ifdef _MSC_VER
85  __declspec(align(32)) static const int32_t hbCoeffs[16];
86 #else
87  static const int32_t hbCoeffs[16] __attribute__ ((aligned (32)));
88 #endif
89  static const float hbCoeffsF[16];
90 };
91 
92 template<>
94 {
95  static const int32_t hbOrder = 80;
96  static const int32_t hbShift = 14;
97  static const int16_t hbMod[80+6];
98 #ifdef _MSC_VER
99  __declspec(align(16)) static const int32_t hbCoeffs[20];
100 #else
101  static const int32_t hbCoeffs[20] __attribute__ ((aligned (16)));
102 #endif
103  static const double hbCoeffsF[20];
104 };
105 
106 template<>
108 {
109  static const int32_t hbOrder = 96;
110  static const int32_t hbShift = 16;
111  static const int16_t hbMod[96+6];
112 #ifdef _MSC_VER
113  __declspec(align(32)) static const int32_t hbCoeffs[24];
114 #else
115  static const int32_t hbCoeffs[24] __attribute__ ((aligned (32)));
116 #endif
117  static const double hbCoeffsF[24];
118 };
119 
120 template<>
122 {
123  static const int32_t hbOrder = 112;
124  static const int32_t hbShift = 18;
125  static const int16_t hbMod[112+6];
126 #ifdef _MSC_VER
127  __declspec(align(16)) static const int32_t hbCoeffs[28];
128 #else
129  static const int32_t hbCoeffs[28] __attribute__ ((aligned (16)));
130 #endif
131  static const double hbCoeffsF[28];
132 };
133 
134 template<>
136 {
137  static const int32_t hbOrder = 128;
138  static const int32_t hbShift = 20;
139  static const int16_t hbMod[128+6];
140 #ifdef _MSC_VER
141  __declspec(align(16)) static const int32_t hbCoeffs[32];
142 #else
143  static const int32_t hbCoeffs[32] __attribute__ ((aligned (16)));
144 #endif
145  static const double hbCoeffsF[32];
146 };
147 
148 #endif /* SDRBASE_DSP_HBFILTERTRAITS_H_ */
short int16_t
Definition: rtptypes_win.h:43
int int32_t
Definition: rtptypes_win.h:45
typedef __attribute__
#define SDRBASE_API
Definition: export.h:40