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.
samplesinkfifodecimator.h
Go to the documentation of this file.
1 // Copyright (C) 2015 Edouard Griffiths, F4EXB //
3 // //
4 // This program is free software; you can redistribute it and/or modify //
5 // it under the terms of the GNU General Public License as published by //
6 // the Free Software Foundation as version 3 of the License, or //
7 // (at your option) any later version. //
8 // //
9 // This program is distributed in the hope that it will be useful, //
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12 // GNU General Public License V3 for more details. //
13 // //
14 // You should have received a copy of the GNU General Public License //
15 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
17 
18 #ifndef INCLUDE_DSP_SAMPLESINKFIFODECIMATOR_H_
19 #define INCLUDE_DSP_SAMPLESINKFIFODECIMATOR_H_
20 
21 #include <stdint.h>
22 #include "dsp/dsptypes.h"
23 #include "dsp/inthalfbandfilter.h"
25 
26 template<uint32_t SdrBits, uint32_t InputBits>
27 struct decimation_shifts
28 {
29  static const uint32_t pre1 = 0;
30  static const uint32_t pre2 = 0;
31  static const uint32_t post2 = 0;
32  static const uint32_t pre4 = 0;
33  static const uint32_t post4 = 0;
34  static const uint32_t pre8 = 0;
35  static const uint32_t post8 = 0;
36  static const uint32_t pre16 = 0;
37  static const uint32_t post16 = 0;
38  static const uint32_t pre32 = 0;
39  static const uint32_t post32 = 0;
40  static const uint32_t pre64 = 0;
41  static const uint32_t post64 = 0;
42 };
43 
44 template<>
45 struct decimation_shifts<16, 16>
46 {
47  static const uint32_t pre1 = 0;
48  static const uint32_t pre2 = 0;
49  static const uint32_t post2 = 1;
50  static const uint32_t pre4 = 0;
51  static const uint32_t post4 = 2;
52  static const uint32_t pre8 = 0;
53  static const uint32_t post8 = 3;
54  static const uint32_t pre16 = 0;
55  static const uint32_t post16 = 4;
56  static const uint32_t pre32 = 0;
57  static const uint32_t post32 = 5;
58  static const uint32_t pre64 = 0;
59  static const uint32_t post64 = 6;
60 };
61 
62 template<>
63 struct decimation_shifts<16, 12>
64 {
65  static const uint32_t pre1 = 4;
66  static const uint32_t pre2 = 3;
67  static const uint32_t post2 = 0;
68  static const uint32_t pre4 = 2;
69  static const uint32_t post4 = 0;
70  static const uint32_t pre8 = 1;
71  static const uint32_t post8 = 0;
72  static const uint32_t pre16 = 0;
73  static const uint32_t post16 = 0;
74  static const uint32_t pre32 = 0;
75  static const uint32_t post32 = 1;
76  static const uint32_t pre64 = 0;
77  static const uint32_t post64 = 2;
78 };
79 
80 template<>
81 struct decimation_shifts<16, 8>
82 {
83  static const uint32_t pre1 = 6;
84  static const uint32_t pre2 = 5;
85  static const uint32_t post2 = 0;
86  static const uint32_t pre4 = 4;
87  static const uint32_t post4 = 0;
88  static const uint32_t pre8 = 3;
89  static const uint32_t post8 = 0;
90  static const uint32_t pre16 = 2;
91  static const uint32_t post16 = 0;
92  static const uint32_t pre32 = 1;
93  static const uint32_t post32 = 0;
94  static const uint32_t pre64 = 0;
95  static const uint32_t post64 = 0;
96 };
97 
98 template<typename T, uint32_t SdrBits, uint32_t InputBits>
100 {
101 public:
102  void decimate1(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
103  void decimate2_u(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
104  void decimate2_inf(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
105  void decimate2_sup(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
106  void decimate2_cen(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
107  void decimate4_inf(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
108  void decimate4_sup(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
109  void decimate4_cen(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
110  void decimate8_inf(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
111  void decimate8_sup(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
112  void decimate8_cen(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
113  void decimate16_inf(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
114  void decimate16_sup(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
115  void decimate16_cen(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
116  void decimate32_inf(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
117  void decimate32_sup(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
118  void decimate32_cen(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
119  void decimate64_inf(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
120  void decimate64_sup(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
121  void decimate64_cen(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len);
122 
123 private:
130 };
131 
132 template<typename T, uint32_t SdrBits, uint32_t InputBits>
134 {
135  qint32 xreal, yimag;
136  SampleVector::iterator it;
137 
138  fifo.getWriteIterator(it);
139 
140  for (int pos = 0; pos < len - 1; pos += 2)
141  {
142  xreal = buf[pos+0];
143  yimag = buf[pos+1];
144  (*it).setReal(xreal << decimation_shifts<SdrBits, InputBits>::pre1); // Valgrind optim (2 - comment not repeated)
145  (*it).setImag(yimag << decimation_shifts<SdrBits, InputBits>::pre1);
146  fifo.bumpIndex(it);
147  }
148 }
149 
150 template<typename T, uint32_t SdrBits, uint32_t InputBits>
152 {
153  qint32 xreal, yimag;
154  SampleVector::iterator it;
155 
156  fifo.getWriteIterator(it);
157 
158  for (int pos = 0; pos < len - 7; pos += 8)
159  {
160  xreal = (buf[pos+0] - buf[pos+3]) << decimation_shifts<SdrBits, InputBits>::pre2;
161  yimag = (buf[pos+1] + buf[pos+2] - 255) << decimation_shifts<SdrBits, InputBits>::pre2;
162  (*it).setReal(xreal >> decimation_shifts<SdrBits, InputBits>::post2);
163  (*it).setImag(yimag >> decimation_shifts<SdrBits, InputBits>::post2);
164  fifo.bumpIndex(it);
165 
166  xreal = (buf[pos+7] - buf[pos+4]) << decimation_shifts<SdrBits, InputBits>::pre2;
167  yimag = (255 - buf[pos+5] - buf[pos+6]) << decimation_shifts<SdrBits, InputBits>::pre2;
168  (*it).setReal(xreal >> decimation_shifts<SdrBits, InputBits>::post2);
169  (*it).setImag(yimag >> decimation_shifts<SdrBits, InputBits>::post2);
170  fifo.bumpIndex(it);
171  }
172 }
173 
174 template<typename T, uint32_t SdrBits, uint32_t InputBits>
176 {
177  qint32 xreal, yimag;
178  SampleVector::iterator it;
179 
180  fifo.getWriteIterator(it);
181 
182  for (int pos = 0; pos < len - 7; pos += 8)
183  {
184  xreal = (buf[pos+0] - buf[pos+3]) << decimation_shifts<SdrBits, InputBits>::pre2;
185  yimag = (buf[pos+1] + buf[pos+2]) << decimation_shifts<SdrBits, InputBits>::pre2;
186  (*it).setReal(xreal >> decimation_shifts<SdrBits, InputBits>::post2);
187  (*it).setImag(yimag >> decimation_shifts<SdrBits, InputBits>::post2);
188  fifo.bumpIndex(it);
189 
190  xreal = (buf[pos+7] - buf[pos+4]) << decimation_shifts<SdrBits, InputBits>::pre2;
191  yimag = (- buf[pos+5] - buf[pos+6]) << decimation_shifts<SdrBits, InputBits>::pre2;
192  (*it).setReal(xreal >> decimation_shifts<SdrBits, InputBits>::post2);
193  (*it).setImag(yimag >> decimation_shifts<SdrBits, InputBits>::post2);
194  fifo.bumpIndex(it);
195  }
196 }
197 
198 template<typename T, uint32_t SdrBits, uint32_t InputBits>
200 {
201  qint32 xreal, yimag;
202  SampleVector::iterator it;
203 
204  fifo.getWriteIterator(it);
205 
206  for (int pos = 0; pos < len - 7; pos += 8)
207  {
208  xreal = (buf[pos+1] - buf[pos+2]) << decimation_shifts<SdrBits, InputBits>::pre2;
209  yimag = (- buf[pos+0] - buf[pos+3]) << decimation_shifts<SdrBits, InputBits>::pre2;
210  (*it).setReal(xreal >> decimation_shifts<SdrBits, InputBits>::post2);
211  (*it).setImag(yimag >> decimation_shifts<SdrBits, InputBits>::post2);
212  fifo.bumpIndex(it);
213 
214  xreal = (buf[pos+6] - buf[pos+5]) << decimation_shifts<SdrBits, InputBits>::pre2;
215  yimag = (buf[pos+4] + buf[pos+7]) << decimation_shifts<SdrBits, InputBits>::pre2;
216  (*it).setReal(xreal >> decimation_shifts<SdrBits, InputBits>::post2);
217  (*it).setImag(yimag >> decimation_shifts<SdrBits, InputBits>::post2);
218  fifo.bumpIndex(it);
219  }
220 }
221 
222 template<typename T, uint32_t SdrBits, uint32_t InputBits>
224 {
225  qint32 xreal, yimag;
226  SampleVector::iterator it;
227 
228  fifo.getWriteIterator(it);
229 
230  for (int pos = 0; pos < len - 7; pos += 8)
231  {
232  xreal = (buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4]) << decimation_shifts<SdrBits, InputBits>::pre4;
233  yimag = (buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6]) << decimation_shifts<SdrBits, InputBits>::pre4;
234 
235  (*it).setReal(xreal >> decimation_shifts<SdrBits, InputBits>::post4);
236  (*it).setImag(yimag >> decimation_shifts<SdrBits, InputBits>::post4);
237 
238  fifo.bumpIndex(it);
239  }
240 }
241 
242 template<typename T, uint32_t SdrBits, uint32_t InputBits>
244 {
245  // Sup (USB):
246  // x y x y x y x y / x -> 1,-2,-5,6 / y -> -0,-3,4,7
247  // [ rotate: 1, 0, -2, 3, -5, -4, 6, -7]
248  // Inf (LSB):
249  // x y x y x y x y / x -> 0,-3,-4,7 / y -> 1,2,-5,-6
250  // [ rotate: 0, 1, -3, 2, -4, -5, 7, -6]
251  qint32 xreal, yimag;
252  SampleVector::iterator it;
253 
254  fifo.getWriteIterator(it);
255 
256  for (int pos = 0; pos < len - 7; pos += 8)
257  {
258  xreal = (buf[pos+1] - buf[pos+2] - buf[pos+5] + buf[pos+6]) << decimation_shifts<SdrBits, InputBits>::pre4;
259  yimag = (- buf[pos+0] - buf[pos+3] + buf[pos+4] + buf[pos+7]) << decimation_shifts<SdrBits, InputBits>::pre4;
260 
261  (*it).setReal(xreal >> decimation_shifts<SdrBits, InputBits>::post4);
262  (*it).setImag(yimag >> decimation_shifts<SdrBits, InputBits>::post4);
263 
264  fifo.bumpIndex(it);
265  }
266 }
267 
268 template<typename T, uint32_t SdrBits, uint32_t InputBits>
270 {
271  qint32 xreal[2], yimag[2];
272  SampleVector::iterator it;
273 
274  fifo.getWriteIterator(it);
275 
276  for (int pos = 0; pos < len - 15; pos += 8)
277  {
278  xreal[0] = (buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4]) << decimation_shifts<SdrBits, InputBits>::pre8;
279  yimag[0] = (buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6]) << decimation_shifts<SdrBits, InputBits>::pre8;
280  pos += 8;
281 
282  xreal[1] = (buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4]) << decimation_shifts<SdrBits, InputBits>::pre8;
283  yimag[1] = (buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6]) << decimation_shifts<SdrBits, InputBits>::pre8;
284 
285  m_decimator2.myDecimate(xreal[0], yimag[0], &xreal[1], &yimag[1]);
286 
287  (*it).setReal(xreal[1] >> decimation_shifts<SdrBits, InputBits>::post8);
288  (*it).setImag(yimag[1] >> decimation_shifts<SdrBits, InputBits>::post8);
289 
290  fifo.bumpIndex(it);
291  }
292 }
293 
294 template<typename T, uint32_t SdrBits, uint32_t InputBits>
296 {
297  qint32 xreal[2], yimag[2];
298  SampleVector::iterator it;
299 
300  fifo.getWriteIterator(it);
301 
302  for (int pos = 0; pos < len - 15; pos += 8)
303  {
304  xreal[0] = (buf[pos+1] - buf[pos+2] - buf[pos+5] + buf[pos+6]) << decimation_shifts<SdrBits, InputBits>::pre8;
305  yimag[0] = (- buf[pos+0] - buf[pos+3] + buf[pos+4] + buf[pos+7]) << decimation_shifts<SdrBits, InputBits>::pre8;
306  pos += 8;
307 
308  xreal[1] = (buf[pos+1] - buf[pos+2] - buf[pos+5] + buf[pos+6]) << decimation_shifts<SdrBits, InputBits>::pre8;
309  yimag[1] = (- buf[pos+0] - buf[pos+3] + buf[pos+4] + buf[pos+7]) << decimation_shifts<SdrBits, InputBits>::pre8;
310 
311  m_decimator2.myDecimate(xreal[0], yimag[0], &xreal[1], &yimag[1]);
312 
313  (*it).setReal(xreal[1] >> decimation_shifts<SdrBits, InputBits>::post8);
314  (*it).setImag(yimag[1] >> decimation_shifts<SdrBits, InputBits>::post8);
315 
316  fifo.bumpIndex(it);
317  }
318 }
319 
320 template<typename T, uint32_t SdrBits, uint32_t InputBits>
322 {
323  // Offset tuning: 4x downsample and rotate, then
324  // downsample 4x more. [ rotate: 0, 1, -3, 2, -4, -5, 7, -6]
325  qint32 xreal[4], yimag[4];
326  SampleVector::iterator it;
327 
328  fifo.getWriteIterator(it);
329 
330  for (int pos = 0; pos < len - 31; )
331  {
332  for (int i = 0; i < 4; i++)
333  {
334  xreal[i] = (buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4]) << decimation_shifts<SdrBits, InputBits>::pre16;
335  yimag[i] = (buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6]) << decimation_shifts<SdrBits, InputBits>::pre16;
336  pos += 8;
337  }
338 
339  m_decimator2.myDecimate(xreal[0], yimag[0], &xreal[1], &yimag[1]);
340  m_decimator2.myDecimate(xreal[2], yimag[2], &xreal[3], &yimag[3]);
341 
342  m_decimator4.myDecimate(xreal[1], yimag[1], &xreal[3], &yimag[3]);
343 
344  (*it).setReal(xreal[3] >> decimation_shifts<SdrBits, InputBits>::post16);
345  (*it).setImag(yimag[3] >> decimation_shifts<SdrBits, InputBits>::post16);
346 
347  fifo.bumpIndex(it);
348  }
349 }
350 
351 template<typename T, uint32_t SdrBits, uint32_t InputBits>
353 {
354  // Offset tuning: 4x downsample and rotate, then
355  // downsample 4x more. [ rotate: 1, 0, -2, 3, -5, -4, 6, -7]
356  qint32 xreal[4], yimag[4];
357  SampleVector::iterator it;
358 
359  fifo.getWriteIterator(it);
360 
361  for (int pos = 0; pos < len - 31; )
362  {
363  for (int i = 0; i < 4; i++)
364  {
365  xreal[i] = (buf[pos+1] - buf[pos+2] - buf[pos+5] + buf[pos+6]) << decimation_shifts<SdrBits, InputBits>::pre16;
366  yimag[i] = (buf[pos+4] + buf[pos+7] - buf[pos+0] - buf[pos+3]) << decimation_shifts<SdrBits, InputBits>::pre16;
367  pos += 8;
368  }
369 
370  m_decimator2.myDecimate(xreal[0], yimag[0], &xreal[1], &yimag[1]);
371  m_decimator2.myDecimate(xreal[2], yimag[2], &xreal[3], &yimag[3]);
372 
373  m_decimator4.myDecimate(xreal[1], yimag[1], &xreal[3], &yimag[3]);
374 
375  (*it).setReal(xreal[3] >> decimation_shifts<SdrBits, InputBits>::post16);
376  (*it).setImag(yimag[3] >> decimation_shifts<SdrBits, InputBits>::post16);
377 
378  fifo.bumpIndex(it);
379  }
380 }
381 
382 template<typename T, uint32_t SdrBits, uint32_t InputBits>
384 {
385  qint32 xreal[8], yimag[8];
386  SampleVector::iterator it;
387 
388  fifo.getWriteIterator(it);
389 
390  for (int pos = 0; pos < len - 63; )
391  {
392  for (int i = 0; i < 8; i++)
393  {
394  xreal[i] = (buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4]) << decimation_shifts<SdrBits, InputBits>::pre32;
395  yimag[i] = (buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6]) << decimation_shifts<SdrBits, InputBits>::pre32;
396  pos += 8;
397  }
398 
399  m_decimator2.myDecimate(xreal[0], yimag[0], &xreal[1], &yimag[1]);
400  m_decimator2.myDecimate(xreal[2], yimag[2], &xreal[3], &yimag[3]);
401  m_decimator2.myDecimate(xreal[4], yimag[4], &xreal[5], &yimag[5]);
402  m_decimator2.myDecimate(xreal[6], yimag[6], &xreal[7], &yimag[7]);
403 
404  m_decimator4.myDecimate(xreal[1], yimag[1], &xreal[3], &yimag[3]);
405  m_decimator4.myDecimate(xreal[5], yimag[5], &xreal[7], &yimag[7]);
406 
407  m_decimator8.myDecimate(xreal[3], yimag[3], &xreal[7], &yimag[7]);
408 
409  (*it).setReal(xreal[7] >> decimation_shifts<SdrBits, InputBits>::post32);
410  (*it).setImag(yimag[7] >> decimation_shifts<SdrBits, InputBits>::post32);
411 
412  fifo.bumpIndex(it);
413  }
414 }
415 
416 template<typename T, uint32_t SdrBits, uint32_t InputBits>
418 {
419  qint32 xreal[8], yimag[8];
420  SampleVector::iterator it;
421 
422  fifo.getWriteIterator(it);
423 
424  for (int pos = 0; pos < len - 63; )
425  {
426  for (int i = 0; i < 8; i++)
427  {
428  xreal[i] = (buf[pos+1] - buf[pos+2] - buf[pos+5] + buf[pos+6]) << decimation_shifts<SdrBits, InputBits>::pre32;
429  yimag[i] = (buf[pos+4] + buf[pos+7] - buf[pos+0] - buf[pos+3]) << decimation_shifts<SdrBits, InputBits>::pre32;
430  pos += 8;
431  }
432 
433  m_decimator2.myDecimate(xreal[0], yimag[0], &xreal[1], &yimag[1]);
434  m_decimator2.myDecimate(xreal[2], yimag[2], &xreal[3], &yimag[3]);
435  m_decimator2.myDecimate(xreal[4], yimag[4], &xreal[5], &yimag[5]);
436  m_decimator2.myDecimate(xreal[6], yimag[6], &xreal[7], &yimag[7]);
437 
438  m_decimator4.myDecimate(xreal[1], yimag[1], &xreal[3], &yimag[3]);
439  m_decimator4.myDecimate(xreal[5], yimag[5], &xreal[7], &yimag[7]);
440 
441  m_decimator8.myDecimate(xreal[3], yimag[3], &xreal[7], &yimag[7]);
442 
443  (*it).setReal(xreal[7] >> decimation_shifts<SdrBits, InputBits>::post32);
444  (*it).setImag(yimag[7] >> decimation_shifts<SdrBits, InputBits>::post32);
445 
446  fifo.bumpIndex(it);
447  }
448 }
449 
450 template<typename T, uint32_t SdrBits, uint32_t InputBits>
452 {
453  qint32 xreal[16], yimag[16];
454  SampleVector::iterator it;
455 
456  fifo.getWriteIterator(it);
457 
458  for (int pos = 0; pos < len - 127; )
459  {
460  for (int i = 0; i < 16; i++)
461  {
462  xreal[i] = (buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4]) << decimation_shifts<SdrBits, InputBits>::pre64;
463  yimag[i] = (buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6]) << decimation_shifts<SdrBits, InputBits>::pre64;
464  pos += 8;
465  }
466 
467  m_decimator2.myDecimate(xreal[0], yimag[0], &xreal[1], &yimag[1]);
468  m_decimator2.myDecimate(xreal[2], yimag[2], &xreal[3], &yimag[3]);
469  m_decimator2.myDecimate(xreal[4], yimag[4], &xreal[5], &yimag[5]);
470  m_decimator2.myDecimate(xreal[6], yimag[6], &xreal[7], &yimag[7]);
471  m_decimator2.myDecimate(xreal[8], yimag[8], &xreal[9], &yimag[9]);
472  m_decimator2.myDecimate(xreal[10], yimag[10], &xreal[11], &yimag[11]);
473  m_decimator2.myDecimate(xreal[12], yimag[12], &xreal[13], &yimag[13]);
474  m_decimator2.myDecimate(xreal[14], yimag[14], &xreal[15], &yimag[15]);
475 
476  m_decimator4.myDecimate(xreal[1], yimag[1], &xreal[3], &yimag[3]);
477  m_decimator4.myDecimate(xreal[5], yimag[5], &xreal[7], &yimag[7]);
478  m_decimator4.myDecimate(xreal[9], yimag[9], &xreal[11], &yimag[11]);
479  m_decimator4.myDecimate(xreal[13], yimag[13], &xreal[15], &yimag[15]);
480 
481  m_decimator8.myDecimate(xreal[3], yimag[3], &xreal[7], &yimag[7]);
482  m_decimator8.myDecimate(xreal[11], yimag[11], &xreal[15], &yimag[15]);
483 
484  m_decimator16.myDecimate(xreal[7], yimag[7], &xreal[15], &yimag[15]);
485 
486  (*it).setReal(xreal[15] >> decimation_shifts<SdrBits, InputBits>::post64);
487  (*it).setImag(yimag[15] >> decimation_shifts<SdrBits, InputBits>::post64);
488 
489  fifo.bumpIndex(it);
490  }
491 }
492 
493 template<typename T, uint32_t SdrBits, uint32_t InputBits>
495 {
496  qint32 xreal[16], yimag[16];
497  SampleVector::iterator it;
498 
499  fifo.getWriteIterator(it);
500 
501  for (int pos = 0; pos < len - 127; )
502  {
503  for (int i = 0; i < 16; i++)
504  {
505  xreal[i] = (buf[pos+1] - buf[pos+2] - buf[pos+5] + buf[pos+6]) << decimation_shifts<SdrBits, InputBits>::pre32;
506  yimag[i] = (buf[pos+4] + buf[pos+7] - buf[pos+0] - buf[pos+3]) << decimation_shifts<SdrBits, InputBits>::pre32;
507  pos += 8;
508  }
509 
510  m_decimator2.myDecimate(xreal[0], yimag[0], &xreal[1], &yimag[1]);
511  m_decimator2.myDecimate(xreal[2], yimag[2], &xreal[3], &yimag[3]);
512  m_decimator2.myDecimate(xreal[4], yimag[4], &xreal[5], &yimag[5]);
513  m_decimator2.myDecimate(xreal[6], yimag[6], &xreal[7], &yimag[7]);
514  m_decimator2.myDecimate(xreal[8], yimag[8], &xreal[9], &yimag[9]);
515  m_decimator2.myDecimate(xreal[10], yimag[10], &xreal[11], &yimag[11]);
516  m_decimator2.myDecimate(xreal[12], yimag[12], &xreal[13], &yimag[13]);
517  m_decimator2.myDecimate(xreal[14], yimag[14], &xreal[15], &yimag[15]);
518 
519  m_decimator4.myDecimate(xreal[1], yimag[1], &xreal[3], &yimag[3]);
520  m_decimator4.myDecimate(xreal[5], yimag[5], &xreal[7], &yimag[7]);
521  m_decimator4.myDecimate(xreal[9], yimag[9], &xreal[11], &yimag[11]);
522  m_decimator4.myDecimate(xreal[13], yimag[13], &xreal[15], &yimag[15]);
523 
524  m_decimator8.myDecimate(xreal[3], yimag[3], &xreal[7], &yimag[7]);
525  m_decimator8.myDecimate(xreal[11], yimag[11], &xreal[15], &yimag[15]);
526 
527  m_decimator16.myDecimate(xreal[7], yimag[7], &xreal[15], &yimag[15]);
528 
529  (*it).setReal(xreal[15] >> decimation_shifts<SdrBits, InputBits>::post64);
530  (*it).setImag(yimag[15] >> decimation_shifts<SdrBits, InputBits>::post64);
531 
532  fifo.bumpIndex(it);
533  }
534 }
535 
536 template<typename T, uint32_t SdrBits, uint32_t InputBits>
538 {
539  qint32 intbuf[2];
540  SampleVector::iterator it;
541 
542  fifo.getWriteIterator(it);
543 
544  for (int pos = 0; pos < len - 3; pos += 4)
545  {
546  intbuf[0] = buf[pos+2] << decimation_shifts<SdrBits, InputBits>::pre2;
547  intbuf[1] = buf[pos+3] << decimation_shifts<SdrBits, InputBits>::pre2;
548 
549  m_decimator2.myDecimate(
550  buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre2,
551  buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre2,
552  &intbuf[0],
553  &intbuf[1]);
554 
555  (*it).setReal(intbuf[0] >> decimation_shifts<SdrBits, InputBits>::post2);
556  (*it).setImag(intbuf[1] >> decimation_shifts<SdrBits, InputBits>::post2);
557  fifo.bumpIndex(it);
558  }
559 }
560 
561 template<typename T, uint32_t SdrBits, uint32_t InputBits>
563 {
564  qint32 intbuf[4];
565  SampleVector::iterator it;
566 
567  fifo.getWriteIterator(it);
568 
569  for (int pos = 0; pos < len - 7; pos += 8)
570  {
571  intbuf[0] = buf[pos+2] << decimation_shifts<SdrBits, InputBits>::pre4;
572  intbuf[1] = buf[pos+3] << decimation_shifts<SdrBits, InputBits>::pre4;
573  intbuf[2] = buf[pos+6] << decimation_shifts<SdrBits, InputBits>::pre4;
574  intbuf[3] = buf[pos+7] << decimation_shifts<SdrBits, InputBits>::pre4;
575 
576  m_decimator2.myDecimate(
577  buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre4,
578  buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre4,
579  &intbuf[0],
580  &intbuf[1]);
581  m_decimator2.myDecimate(
582  buf[pos+4] << decimation_shifts<SdrBits, InputBits>::pre4,
583  buf[pos+5] << decimation_shifts<SdrBits, InputBits>::pre4,
584  &intbuf[2],
585  &intbuf[3]);
586 
587  m_decimator4.myDecimate(
588  intbuf[0],
589  intbuf[1],
590  &intbuf[2],
591  &intbuf[3]);
592 
593  (*it).setReal(intbuf[2] >> decimation_shifts<SdrBits, InputBits>::post4);
594  (*it).setImag(intbuf[3] >> decimation_shifts<SdrBits, InputBits>::post4);
595  fifo.bumpIndex(it);
596  }
597 }
598 
599 template<typename T, uint32_t SdrBits, uint32_t InputBits>
601 {
602  qint32 intbuf[8];
603  SampleVector::iterator it;
604 
605  fifo.getWriteIterator(it);
606 
607  for (int pos = 0; pos < len - 15; pos += 16)
608  {
609  intbuf[0] = buf[pos+2] << decimation_shifts<SdrBits, InputBits>::pre8;
610  intbuf[1] = buf[pos+3] << decimation_shifts<SdrBits, InputBits>::pre8;
611  intbuf[2] = buf[pos+6] << decimation_shifts<SdrBits, InputBits>::pre8;
612  intbuf[3] = buf[pos+7] << decimation_shifts<SdrBits, InputBits>::pre8;
613  intbuf[4] = buf[pos+10] << decimation_shifts<SdrBits, InputBits>::pre8;
614  intbuf[5] = buf[pos+11] << decimation_shifts<SdrBits, InputBits>::pre8;
615  intbuf[6] = buf[pos+14] << decimation_shifts<SdrBits, InputBits>::pre8;
616  intbuf[7] = buf[pos+15] << decimation_shifts<SdrBits, InputBits>::pre8;
617 
618  m_decimator2.myDecimate(
619  buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre8,
620  buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre8,
621  &intbuf[0],
622  &intbuf[1]);
623  m_decimator2.myDecimate(
624  buf[pos+4] << decimation_shifts<SdrBits, InputBits>::pre8,
625  buf[pos+5] << decimation_shifts<SdrBits, InputBits>::pre8,
626  &intbuf[2],
627  &intbuf[3]);
628  m_decimator2.myDecimate(
629  buf[pos+8] << decimation_shifts<SdrBits, InputBits>::pre8,
630  buf[pos+9] << decimation_shifts<SdrBits, InputBits>::pre8,
631  &intbuf[4],
632  &intbuf[5]);
633  m_decimator2.myDecimate(
634  buf[pos+12] << decimation_shifts<SdrBits, InputBits>::pre8,
635  buf[pos+13] << decimation_shifts<SdrBits, InputBits>::pre8,
636  &intbuf[6],
637  &intbuf[7]);
638 
639  m_decimator4.myDecimate(
640  intbuf[0],
641  intbuf[1],
642  &intbuf[2],
643  &intbuf[3]);
644  m_decimator4.myDecimate(
645  intbuf[4],
646  intbuf[5],
647  &intbuf[6],
648  &intbuf[7]);
649 
650  m_decimator8.myDecimate(
651  intbuf[2],
652  intbuf[3],
653  &intbuf[6],
654  &intbuf[7]);
655 
656  (*it).setReal(intbuf[6] >> decimation_shifts<SdrBits, InputBits>::post8);
657  (*it).setImag(intbuf[7] >> decimation_shifts<SdrBits, InputBits>::post8);
658  fifo.bumpIndex(it);
659  }
660 }
661 
662 template<typename T, uint32_t SdrBits, uint32_t InputBits>
664 {
665  qint32 intbuf[16];
666  SampleVector::iterator it;
667 
668  fifo.getWriteIterator(it);
669 
670  for (int pos = 0; pos < len - 31; pos += 32)
671  {
672  intbuf[0] = buf[pos+2] << decimation_shifts<SdrBits, InputBits>::pre16;
673  intbuf[1] = buf[pos+3] << decimation_shifts<SdrBits, InputBits>::pre16;
674  intbuf[2] = buf[pos+6] << decimation_shifts<SdrBits, InputBits>::pre16;
675  intbuf[3] = buf[pos+7] << decimation_shifts<SdrBits, InputBits>::pre16;
676  intbuf[4] = buf[pos+10] << decimation_shifts<SdrBits, InputBits>::pre16;
677  intbuf[5] = buf[pos+11] << decimation_shifts<SdrBits, InputBits>::pre16;
678  intbuf[6] = buf[pos+14] << decimation_shifts<SdrBits, InputBits>::pre16;
679  intbuf[7] = buf[pos+15] << decimation_shifts<SdrBits, InputBits>::pre16;
680  intbuf[8] = buf[pos+18] << decimation_shifts<SdrBits, InputBits>::pre16;
681  intbuf[9] = buf[pos+19] << decimation_shifts<SdrBits, InputBits>::pre16;
682  intbuf[10] = buf[pos+22] << decimation_shifts<SdrBits, InputBits>::pre16;
683  intbuf[11] = buf[pos+23] << decimation_shifts<SdrBits, InputBits>::pre16;
684  intbuf[12] = buf[pos+26] << decimation_shifts<SdrBits, InputBits>::pre16;
685  intbuf[13] = buf[pos+27] << decimation_shifts<SdrBits, InputBits>::pre16;
686  intbuf[14] = buf[pos+30] << decimation_shifts<SdrBits, InputBits>::pre16;
687  intbuf[15] = buf[pos+31] << decimation_shifts<SdrBits, InputBits>::pre16;
688 
689  m_decimator2.myDecimate(
690  buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre16,
691  buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre16,
692  &intbuf[0],
693  &intbuf[1]);
694  m_decimator2.myDecimate(
695  buf[pos+4] << decimation_shifts<SdrBits, InputBits>::pre16,
696  buf[pos+5] << decimation_shifts<SdrBits, InputBits>::pre16,
697  &intbuf[2],
698  &intbuf[3]);
699  m_decimator2.myDecimate(
700  buf[pos+8] << decimation_shifts<SdrBits, InputBits>::pre16,
701  buf[pos+9] << decimation_shifts<SdrBits, InputBits>::pre16,
702  &intbuf[4],
703  &intbuf[5]);
704  m_decimator2.myDecimate(
705  buf[pos+12] << decimation_shifts<SdrBits, InputBits>::pre16,
706  buf[pos+13] << decimation_shifts<SdrBits, InputBits>::pre16,
707  &intbuf[6],
708  &intbuf[7]);
709  m_decimator2.myDecimate(
710  buf[pos+16] << decimation_shifts<SdrBits, InputBits>::pre16,
711  buf[pos+17] << decimation_shifts<SdrBits, InputBits>::pre16,
712  &intbuf[8],
713  &intbuf[9]);
714  m_decimator2.myDecimate(
715  buf[pos+20] << decimation_shifts<SdrBits, InputBits>::pre16,
716  buf[pos+21] << decimation_shifts<SdrBits, InputBits>::pre16,
717  &intbuf[10],
718  &intbuf[11]);
719  m_decimator2.myDecimate(
720  buf[pos+24] << decimation_shifts<SdrBits, InputBits>::pre16,
721  buf[pos+25] << decimation_shifts<SdrBits, InputBits>::pre16,
722  &intbuf[12],
723  &intbuf[13]);
724  m_decimator2.myDecimate(
725  buf[pos+28] << decimation_shifts<SdrBits, InputBits>::pre16,
726  buf[pos+29] << decimation_shifts<SdrBits, InputBits>::pre16,
727  &intbuf[14],
728  &intbuf[15]);
729 
730  m_decimator4.myDecimate(
731  intbuf[0],
732  intbuf[1],
733  &intbuf[2],
734  &intbuf[3]);
735  m_decimator4.myDecimate(
736  intbuf[4],
737  intbuf[5],
738  &intbuf[6],
739  &intbuf[7]);
740  m_decimator4.myDecimate(
741  intbuf[8],
742  intbuf[9],
743  &intbuf[10],
744  &intbuf[11]);
745  m_decimator4.myDecimate(
746  intbuf[12],
747  intbuf[13],
748  &intbuf[14],
749  &intbuf[15]);
750 
751  m_decimator8.myDecimate(
752  intbuf[2],
753  intbuf[3],
754  &intbuf[6],
755  &intbuf[7]);
756  m_decimator8.myDecimate(
757  intbuf[10],
758  intbuf[11],
759  &intbuf[14],
760  &intbuf[15]);
761 
762  m_decimator16.myDecimate(
763  intbuf[6],
764  intbuf[7],
765  &intbuf[14],
766  &intbuf[15]);
767 
768  (*it).setReal(intbuf[14] >> decimation_shifts<SdrBits, InputBits>::post16);
769  (*it).setImag(intbuf[15] >> decimation_shifts<SdrBits, InputBits>::post16);
770  fifo.bumpIndex(it);
771  }
772 }
773 
774 template<typename T, uint32_t SdrBits, uint32_t InputBits>
776 {
777  qint32 intbuf[32];
778  SampleVector::iterator it;
779 
780  fifo.getWriteIterator(it);
781 
782  for (int pos = 0; pos < len - 63; pos += 64)
783  {
784  intbuf[0] = buf[pos+2] << decimation_shifts<SdrBits, InputBits>::pre32;
785  intbuf[1] = buf[pos+3] << decimation_shifts<SdrBits, InputBits>::pre32;
786  intbuf[2] = buf[pos+6] << decimation_shifts<SdrBits, InputBits>::pre32;
787  intbuf[3] = buf[pos+7] << decimation_shifts<SdrBits, InputBits>::pre32;
788  intbuf[4] = buf[pos+10] << decimation_shifts<SdrBits, InputBits>::pre32;
789  intbuf[5] = buf[pos+11] << decimation_shifts<SdrBits, InputBits>::pre32;
790  intbuf[6] = buf[pos+14] << decimation_shifts<SdrBits, InputBits>::pre32;
791  intbuf[7] = buf[pos+15] << decimation_shifts<SdrBits, InputBits>::pre32;
792  intbuf[8] = buf[pos+18] << decimation_shifts<SdrBits, InputBits>::pre32;
793  intbuf[9] = buf[pos+19] << decimation_shifts<SdrBits, InputBits>::pre32;
794  intbuf[10] = buf[pos+22] << decimation_shifts<SdrBits, InputBits>::pre32;
795  intbuf[11] = buf[pos+23] << decimation_shifts<SdrBits, InputBits>::pre32;
796  intbuf[12] = buf[pos+26] << decimation_shifts<SdrBits, InputBits>::pre32;
797  intbuf[13] = buf[pos+27] << decimation_shifts<SdrBits, InputBits>::pre32;
798  intbuf[14] = buf[pos+30] << decimation_shifts<SdrBits, InputBits>::pre32;
799  intbuf[15] = buf[pos+31] << decimation_shifts<SdrBits, InputBits>::pre32;
800  intbuf[16] = buf[pos+34] << decimation_shifts<SdrBits, InputBits>::pre32;
801  intbuf[17] = buf[pos+35] << decimation_shifts<SdrBits, InputBits>::pre32;
802  intbuf[18] = buf[pos+38] << decimation_shifts<SdrBits, InputBits>::pre32;
803  intbuf[19] = buf[pos+39] << decimation_shifts<SdrBits, InputBits>::pre32;
804  intbuf[20] = buf[pos+42] << decimation_shifts<SdrBits, InputBits>::pre32;
805  intbuf[21] = buf[pos+43] << decimation_shifts<SdrBits, InputBits>::pre32;
806  intbuf[22] = buf[pos+46] << decimation_shifts<SdrBits, InputBits>::pre32;
807  intbuf[23] = buf[pos+47] << decimation_shifts<SdrBits, InputBits>::pre32;
808  intbuf[24] = buf[pos+50] << decimation_shifts<SdrBits, InputBits>::pre32;
809  intbuf[25] = buf[pos+51] << decimation_shifts<SdrBits, InputBits>::pre32;
810  intbuf[26] = buf[pos+54] << decimation_shifts<SdrBits, InputBits>::pre32;
811  intbuf[27] = buf[pos+55] << decimation_shifts<SdrBits, InputBits>::pre32;
812  intbuf[28] = buf[pos+58] << decimation_shifts<SdrBits, InputBits>::pre32;
813  intbuf[29] = buf[pos+59] << decimation_shifts<SdrBits, InputBits>::pre32;
814  intbuf[30] = buf[pos+62] << decimation_shifts<SdrBits, InputBits>::pre32;
815  intbuf[31] = buf[pos+63] << decimation_shifts<SdrBits, InputBits>::pre32;
816 
817  m_decimator2.myDecimate(
818  buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre32,
819  buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre32,
820  &intbuf[0],
821  &intbuf[1]);
822  m_decimator2.myDecimate(
823  buf[pos+4] << decimation_shifts<SdrBits, InputBits>::pre32,
824  buf[pos+5] << decimation_shifts<SdrBits, InputBits>::pre32,
825  &intbuf[2],
826  &intbuf[3]);
827  m_decimator2.myDecimate(
828  buf[pos+8] << decimation_shifts<SdrBits, InputBits>::pre32,
829  buf[pos+9] << decimation_shifts<SdrBits, InputBits>::pre32,
830  &intbuf[4],
831  &intbuf[5]);
832  m_decimator2.myDecimate(
833  buf[pos+12] << decimation_shifts<SdrBits, InputBits>::pre32,
834  buf[pos+13] << decimation_shifts<SdrBits, InputBits>::pre32,
835  &intbuf[6],
836  &intbuf[7]);
837  m_decimator2.myDecimate(
838  buf[pos+16] << decimation_shifts<SdrBits, InputBits>::pre32,
839  buf[pos+17] << decimation_shifts<SdrBits, InputBits>::pre32,
840  &intbuf[8],
841  &intbuf[9]);
842  m_decimator2.myDecimate(
843  buf[pos+20] << decimation_shifts<SdrBits, InputBits>::pre32,
844  buf[pos+21] << decimation_shifts<SdrBits, InputBits>::pre32,
845  &intbuf[10],
846  &intbuf[11]);
847  m_decimator2.myDecimate(
848  buf[pos+24] << decimation_shifts<SdrBits, InputBits>::pre32,
849  buf[pos+25] << decimation_shifts<SdrBits, InputBits>::pre32,
850  &intbuf[12],
851  &intbuf[13]);
852  m_decimator2.myDecimate(
853  buf[pos+28] << decimation_shifts<SdrBits, InputBits>::pre32,
854  buf[pos+29] << decimation_shifts<SdrBits, InputBits>::pre32,
855  &intbuf[14],
856  &intbuf[15]);
857  m_decimator2.myDecimate(
858  buf[pos+32] << decimation_shifts<SdrBits, InputBits>::pre32,
859  buf[pos+33] << decimation_shifts<SdrBits, InputBits>::pre32,
860  &intbuf[16],
861  &intbuf[17]);
862  m_decimator2.myDecimate(
863  buf[pos+36] << decimation_shifts<SdrBits, InputBits>::pre32,
864  buf[pos+37] << decimation_shifts<SdrBits, InputBits>::pre32,
865  &intbuf[18],
866  &intbuf[19]);
867  m_decimator2.myDecimate(
868  buf[pos+40] << decimation_shifts<SdrBits, InputBits>::pre32,
869  buf[pos+41] << decimation_shifts<SdrBits, InputBits>::pre32,
870  &intbuf[20],
871  &intbuf[21]);
872  m_decimator2.myDecimate(
873  buf[pos+44] << decimation_shifts<SdrBits, InputBits>::pre32,
874  buf[pos+45] << decimation_shifts<SdrBits, InputBits>::pre32,
875  &intbuf[22],
876  &intbuf[23]);
877  m_decimator2.myDecimate(
878  buf[pos+48] << decimation_shifts<SdrBits, InputBits>::pre32,
879  buf[pos+49] << decimation_shifts<SdrBits, InputBits>::pre32,
880  &intbuf[24],
881  &intbuf[25]);
882  m_decimator2.myDecimate(
883  buf[pos+52] << decimation_shifts<SdrBits, InputBits>::pre32,
884  buf[pos+53] << decimation_shifts<SdrBits, InputBits>::pre32,
885  &intbuf[26],
886  &intbuf[27]);
887  m_decimator2.myDecimate(
888  buf[pos+56] << decimation_shifts<SdrBits, InputBits>::pre32,
889  buf[pos+57] << decimation_shifts<SdrBits, InputBits>::pre32,
890  &intbuf[28],
891  &intbuf[29]);
892  m_decimator2.myDecimate(
893  buf[pos+60] << decimation_shifts<SdrBits, InputBits>::pre32,
894  buf[pos+61] << decimation_shifts<SdrBits, InputBits>::pre32,
895  &intbuf[30],
896  &intbuf[31]);
897 
898  m_decimator4.myDecimate(
899  intbuf[0],
900  intbuf[1],
901  &intbuf[2],
902  &intbuf[3]);
903  m_decimator4.myDecimate(
904  intbuf[4],
905  intbuf[5],
906  &intbuf[6],
907  &intbuf[7]);
908  m_decimator4.myDecimate(
909  intbuf[8],
910  intbuf[9],
911  &intbuf[10],
912  &intbuf[11]);
913  m_decimator4.myDecimate(
914  intbuf[12],
915  intbuf[13],
916  &intbuf[14],
917  &intbuf[15]);
918  m_decimator4.myDecimate(
919  intbuf[16],
920  intbuf[17],
921  &intbuf[18],
922  &intbuf[19]);
923  m_decimator4.myDecimate(
924  intbuf[20],
925  intbuf[21],
926  &intbuf[22],
927  &intbuf[23]);
928  m_decimator4.myDecimate(
929  intbuf[24],
930  intbuf[25],
931  &intbuf[26],
932  &intbuf[27]);
933  m_decimator4.myDecimate(
934  intbuf[28],
935  intbuf[29],
936  &intbuf[30],
937  &intbuf[31]);
938 
939  m_decimator8.myDecimate(
940  intbuf[2],
941  intbuf[3],
942  &intbuf[6],
943  &intbuf[7]);
944  m_decimator8.myDecimate(
945  intbuf[10],
946  intbuf[11],
947  &intbuf[14],
948  &intbuf[15]);
949  m_decimator8.myDecimate(
950  intbuf[18],
951  intbuf[19],
952  &intbuf[22],
953  &intbuf[23]);
954  m_decimator8.myDecimate(
955  intbuf[26],
956  intbuf[27],
957  &intbuf[30],
958  &intbuf[31]);
959 
960  m_decimator16.myDecimate(
961  intbuf[6],
962  intbuf[7],
963  &intbuf[14],
964  &intbuf[15]);
965  m_decimator16.myDecimate(
966  intbuf[22],
967  intbuf[23],
968  &intbuf[30],
969  &intbuf[31]);
970 
971  m_decimator32.myDecimate(
972  intbuf[14],
973  intbuf[15],
974  &intbuf[30],
975  &intbuf[31]);
976 
977  (**it).setReal(intbuf[30] >> decimation_shifts<SdrBits, InputBits>::post32);
978  (**it).setImag(intbuf[31] >> decimation_shifts<SdrBits, InputBits>::post32);
979  fifo.bumpIndex(it);
980  }
981 }
982 
983 
984 template<typename T, uint32_t SdrBits, uint32_t InputBits>
986 {
987  qint32 intbuf[64];
988  SampleVector::iterator it;
989 
990  fifo.getWriteIterator(it);
991 
992  for (int pos = 0; pos < len - 127; pos += 128)
993  {
994  intbuf[0] = buf[pos+2] << decimation_shifts<SdrBits, InputBits>::pre64;
995  intbuf[1] = buf[pos+3] << decimation_shifts<SdrBits, InputBits>::pre64;
996  intbuf[2] = buf[pos+6] << decimation_shifts<SdrBits, InputBits>::pre64;
997  intbuf[3] = buf[pos+7] << decimation_shifts<SdrBits, InputBits>::pre64;
998  intbuf[4] = buf[pos+10] << decimation_shifts<SdrBits, InputBits>::pre64;
999  intbuf[5] = buf[pos+11] << decimation_shifts<SdrBits, InputBits>::pre64;
1000  intbuf[6] = buf[pos+14] << decimation_shifts<SdrBits, InputBits>::pre64;
1001  intbuf[7] = buf[pos+15] << decimation_shifts<SdrBits, InputBits>::pre64;
1002  intbuf[8] = buf[pos+18] << decimation_shifts<SdrBits, InputBits>::pre64;
1003  intbuf[9] = buf[pos+19] << decimation_shifts<SdrBits, InputBits>::pre64;
1004  intbuf[10] = buf[pos+22] << decimation_shifts<SdrBits, InputBits>::pre64;
1005  intbuf[11] = buf[pos+23] << decimation_shifts<SdrBits, InputBits>::pre64;
1006  intbuf[12] = buf[pos+26] << decimation_shifts<SdrBits, InputBits>::pre64;
1007  intbuf[13] = buf[pos+27] << decimation_shifts<SdrBits, InputBits>::pre64;
1008  intbuf[14] = buf[pos+30] << decimation_shifts<SdrBits, InputBits>::pre64;
1009  intbuf[15] = buf[pos+31] << decimation_shifts<SdrBits, InputBits>::pre64;
1010  intbuf[16] = buf[pos+34] << decimation_shifts<SdrBits, InputBits>::pre64;
1011  intbuf[17] = buf[pos+35] << decimation_shifts<SdrBits, InputBits>::pre64;
1012  intbuf[18] = buf[pos+38] << decimation_shifts<SdrBits, InputBits>::pre64;
1013  intbuf[19] = buf[pos+39] << decimation_shifts<SdrBits, InputBits>::pre64;
1014  intbuf[20] = buf[pos+42] << decimation_shifts<SdrBits, InputBits>::pre64;
1015  intbuf[21] = buf[pos+43] << decimation_shifts<SdrBits, InputBits>::pre64;
1016  intbuf[22] = buf[pos+46] << decimation_shifts<SdrBits, InputBits>::pre64;
1017  intbuf[23] = buf[pos+47] << decimation_shifts<SdrBits, InputBits>::pre64;
1018  intbuf[24] = buf[pos+50] << decimation_shifts<SdrBits, InputBits>::pre64;
1019  intbuf[25] = buf[pos+51] << decimation_shifts<SdrBits, InputBits>::pre64;
1020  intbuf[26] = buf[pos+54] << decimation_shifts<SdrBits, InputBits>::pre64;
1021  intbuf[27] = buf[pos+55] << decimation_shifts<SdrBits, InputBits>::pre64;
1022  intbuf[28] = buf[pos+58] << decimation_shifts<SdrBits, InputBits>::pre64;
1023  intbuf[29] = buf[pos+59] << decimation_shifts<SdrBits, InputBits>::pre64;
1024  intbuf[30] = buf[pos+62] << decimation_shifts<SdrBits, InputBits>::pre64;
1025  intbuf[31] = buf[pos+63] << decimation_shifts<SdrBits, InputBits>::pre64;
1026 
1027  intbuf[32] = buf[pos+66] << decimation_shifts<SdrBits, InputBits>::pre64;
1028  intbuf[33] = buf[pos+67] << decimation_shifts<SdrBits, InputBits>::pre64;
1029  intbuf[34] = buf[pos+70] << decimation_shifts<SdrBits, InputBits>::pre64;
1030  intbuf[35] = buf[pos+71] << decimation_shifts<SdrBits, InputBits>::pre64;
1031  intbuf[36] = buf[pos+74] << decimation_shifts<SdrBits, InputBits>::pre64;
1032  intbuf[37] = buf[pos+75] << decimation_shifts<SdrBits, InputBits>::pre64;
1033  intbuf[38] = buf[pos+78] << decimation_shifts<SdrBits, InputBits>::pre64;
1034  intbuf[39] = buf[pos+79] << decimation_shifts<SdrBits, InputBits>::pre64;
1035  intbuf[40] = buf[pos+82] << decimation_shifts<SdrBits, InputBits>::pre64;
1036  intbuf[41] = buf[pos+83] << decimation_shifts<SdrBits, InputBits>::pre64;
1037  intbuf[42] = buf[pos+86] << decimation_shifts<SdrBits, InputBits>::pre64;
1038  intbuf[43] = buf[pos+87] << decimation_shifts<SdrBits, InputBits>::pre64;
1039  intbuf[44] = buf[pos+90] << decimation_shifts<SdrBits, InputBits>::pre64;
1040  intbuf[45] = buf[pos+91] << decimation_shifts<SdrBits, InputBits>::pre64;
1041  intbuf[46] = buf[pos+94] << decimation_shifts<SdrBits, InputBits>::pre64;
1042  intbuf[47] = buf[pos+95] << decimation_shifts<SdrBits, InputBits>::pre64;
1043  intbuf[48] = buf[pos+98] << decimation_shifts<SdrBits, InputBits>::pre64;
1044  intbuf[49] = buf[pos+99] << decimation_shifts<SdrBits, InputBits>::pre64;
1045  intbuf[50] = buf[pos+102] << decimation_shifts<SdrBits, InputBits>::pre64;
1046  intbuf[51] = buf[pos+103] << decimation_shifts<SdrBits, InputBits>::pre64;
1047  intbuf[52] = buf[pos+106] << decimation_shifts<SdrBits, InputBits>::pre64;
1048  intbuf[53] = buf[pos+107] << decimation_shifts<SdrBits, InputBits>::pre64;
1049  intbuf[54] = buf[pos+110] << decimation_shifts<SdrBits, InputBits>::pre64;
1050  intbuf[55] = buf[pos+111] << decimation_shifts<SdrBits, InputBits>::pre64;
1051  intbuf[56] = buf[pos+114] << decimation_shifts<SdrBits, InputBits>::pre64;
1052  intbuf[57] = buf[pos+115] << decimation_shifts<SdrBits, InputBits>::pre64;
1053  intbuf[58] = buf[pos+118] << decimation_shifts<SdrBits, InputBits>::pre64;
1054  intbuf[59] = buf[pos+119] << decimation_shifts<SdrBits, InputBits>::pre64;
1055  intbuf[60] = buf[pos+122] << decimation_shifts<SdrBits, InputBits>::pre64;
1056  intbuf[61] = buf[pos+123] << decimation_shifts<SdrBits, InputBits>::pre64;
1057  intbuf[62] = buf[pos+126] << decimation_shifts<SdrBits, InputBits>::pre64;
1058  intbuf[63] = buf[pos+127] << decimation_shifts<SdrBits, InputBits>::pre64;
1059 
1060  m_decimator2.myDecimate(
1061  buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre64,
1062  buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre64,
1063  &intbuf[0],
1064  &intbuf[1]);
1065  m_decimator2.myDecimate(
1066  buf[pos+4] << decimation_shifts<SdrBits, InputBits>::pre64,
1067  buf[pos+5] << decimation_shifts<SdrBits, InputBits>::pre64,
1068  &intbuf[2],
1069  &intbuf[3]);
1070  m_decimator2.myDecimate(
1071  buf[pos+8] << decimation_shifts<SdrBits, InputBits>::pre64,
1072  buf[pos+9] << decimation_shifts<SdrBits, InputBits>::pre64,
1073  &intbuf[4],
1074  &intbuf[5]);
1075  m_decimator2.myDecimate(
1076  buf[pos+12] << decimation_shifts<SdrBits, InputBits>::pre64,
1077  buf[pos+13] << decimation_shifts<SdrBits, InputBits>::pre64,
1078  &intbuf[6],
1079  &intbuf[7]);
1080  m_decimator2.myDecimate(
1081  buf[pos+16] << decimation_shifts<SdrBits, InputBits>::pre64,
1082  buf[pos+17] << decimation_shifts<SdrBits, InputBits>::pre64,
1083  &intbuf[8],
1084  &intbuf[9]);
1085  m_decimator2.myDecimate(
1086  buf[pos+20] << decimation_shifts<SdrBits, InputBits>::pre64,
1087  buf[pos+21] << decimation_shifts<SdrBits, InputBits>::pre64,
1088  &intbuf[10],
1089  &intbuf[11]);
1090  m_decimator2.myDecimate(
1091  buf[pos+24] << decimation_shifts<SdrBits, InputBits>::pre64,
1092  buf[pos+25] << decimation_shifts<SdrBits, InputBits>::pre64,
1093  &intbuf[12],
1094  &intbuf[13]);
1095  m_decimator2.myDecimate(
1096  buf[pos+28] << decimation_shifts<SdrBits, InputBits>::pre64,
1097  buf[pos+29] << decimation_shifts<SdrBits, InputBits>::pre64,
1098  &intbuf[14],
1099  &intbuf[15]);
1100  m_decimator2.myDecimate(
1101  buf[pos+32] << decimation_shifts<SdrBits, InputBits>::pre64,
1102  buf[pos+33] << decimation_shifts<SdrBits, InputBits>::pre64,
1103  &intbuf[16],
1104  &intbuf[17]);
1105  m_decimator2.myDecimate(
1106  buf[pos+36] << decimation_shifts<SdrBits, InputBits>::pre64,
1107  buf[pos+37] << decimation_shifts<SdrBits, InputBits>::pre64,
1108  &intbuf[18],
1109  &intbuf[19]);
1110  m_decimator2.myDecimate(
1111  buf[pos+40] << decimation_shifts<SdrBits, InputBits>::pre64,
1112  buf[pos+41] << decimation_shifts<SdrBits, InputBits>::pre64,
1113  &intbuf[20],
1114  &intbuf[21]);
1115  m_decimator2.myDecimate(
1116  buf[pos+44] << decimation_shifts<SdrBits, InputBits>::pre64,
1117  buf[pos+45] << decimation_shifts<SdrBits, InputBits>::pre64,
1118  &intbuf[22],
1119  &intbuf[23]);
1120  m_decimator2.myDecimate(
1121  buf[pos+48] << decimation_shifts<SdrBits, InputBits>::pre64,
1122  buf[pos+49] << decimation_shifts<SdrBits, InputBits>::pre64,
1123  &intbuf[24],
1124  &intbuf[25]);
1125  m_decimator2.myDecimate(
1126  buf[pos+52] << decimation_shifts<SdrBits, InputBits>::pre64,
1127  buf[pos+53] << decimation_shifts<SdrBits, InputBits>::pre64,
1128  &intbuf[26],
1129  &intbuf[27]);
1130  m_decimator2.myDecimate(
1131  buf[pos+56] << decimation_shifts<SdrBits, InputBits>::pre64,
1132  buf[pos+57] << decimation_shifts<SdrBits, InputBits>::pre64,
1133  &intbuf[28],
1134  &intbuf[29]);
1135  m_decimator2.myDecimate(
1136  buf[pos+60] << decimation_shifts<SdrBits, InputBits>::pre64,
1137  buf[pos+61] << decimation_shifts<SdrBits, InputBits>::pre64,
1138  &intbuf[30],
1139  &intbuf[31]);
1140  m_decimator2.myDecimate(
1141  buf[pos+64] << decimation_shifts<SdrBits, InputBits>::pre64,
1142  buf[pos+65] << decimation_shifts<SdrBits, InputBits>::pre64,
1143  &intbuf[32],
1144  &intbuf[33]);
1145  m_decimator2.myDecimate(
1146  buf[pos+68] << decimation_shifts<SdrBits, InputBits>::pre64,
1147  buf[pos+69] << decimation_shifts<SdrBits, InputBits>::pre64,
1148  &intbuf[34],
1149  &intbuf[35]);
1150  m_decimator2.myDecimate(
1151  buf[pos+72] << decimation_shifts<SdrBits, InputBits>::pre64,
1152  buf[pos+73] << decimation_shifts<SdrBits, InputBits>::pre64,
1153  &intbuf[36],
1154  &intbuf[37]);
1155  m_decimator2.myDecimate(
1156  buf[pos+76] << decimation_shifts<SdrBits, InputBits>::pre64,
1157  buf[pos+77] << decimation_shifts<SdrBits, InputBits>::pre64,
1158  &intbuf[38],
1159  &intbuf[39]);
1160  m_decimator2.myDecimate(
1161  buf[pos+80] << decimation_shifts<SdrBits, InputBits>::pre64,
1162  buf[pos+81] << decimation_shifts<SdrBits, InputBits>::pre64,
1163  &intbuf[40],
1164  &intbuf[41]);
1165  m_decimator2.myDecimate(
1166  buf[pos+84] << decimation_shifts<SdrBits, InputBits>::pre64,
1167  buf[pos+85] << decimation_shifts<SdrBits, InputBits>::pre64,
1168  &intbuf[42],
1169  &intbuf[43]);
1170  m_decimator2.myDecimate(
1171  buf[pos+88] << decimation_shifts<SdrBits, InputBits>::pre64,
1172  buf[pos+89] << decimation_shifts<SdrBits, InputBits>::pre64,
1173  &intbuf[44],
1174  &intbuf[45]);
1175  m_decimator2.myDecimate(
1176  buf[pos+92] << decimation_shifts<SdrBits, InputBits>::pre64,
1177  buf[pos+93] << decimation_shifts<SdrBits, InputBits>::pre64,
1178  &intbuf[46],
1179  &intbuf[47]);
1180  m_decimator2.myDecimate(
1181  buf[pos+96] << decimation_shifts<SdrBits, InputBits>::pre64,
1182  buf[pos+97] << decimation_shifts<SdrBits, InputBits>::pre64,
1183  &intbuf[48],
1184  &intbuf[49]);
1185  m_decimator2.myDecimate(
1186  buf[pos+100] << decimation_shifts<SdrBits, InputBits>::pre64,
1187  buf[pos+101] << decimation_shifts<SdrBits, InputBits>::pre64,
1188  &intbuf[50],
1189  &intbuf[51]);
1190  m_decimator2.myDecimate(
1191  buf[pos+104] << decimation_shifts<SdrBits, InputBits>::pre64,
1192  buf[pos+105] << decimation_shifts<SdrBits, InputBits>::pre64,
1193  &intbuf[52],
1194  &intbuf[53]);
1195  m_decimator2.myDecimate(
1196  buf[pos+108] << decimation_shifts<SdrBits, InputBits>::pre64,
1197  buf[pos+109] << decimation_shifts<SdrBits, InputBits>::pre64,
1198  &intbuf[54],
1199  &intbuf[55]);
1200  m_decimator2.myDecimate(
1201  buf[pos+112] << decimation_shifts<SdrBits, InputBits>::pre64,
1202  buf[pos+113] << decimation_shifts<SdrBits, InputBits>::pre64,
1203  &intbuf[56],
1204  &intbuf[57]);
1205  m_decimator2.myDecimate(
1206  buf[pos+116] << decimation_shifts<SdrBits, InputBits>::pre64,
1207  buf[pos+117] << decimation_shifts<SdrBits, InputBits>::pre64,
1208  &intbuf[58],
1209  &intbuf[59]);
1210  m_decimator2.myDecimate(
1211  buf[pos+120] << decimation_shifts<SdrBits, InputBits>::pre64,
1212  buf[pos+121] << decimation_shifts<SdrBits, InputBits>::pre64,
1213  &intbuf[60],
1214  &intbuf[61]);
1215  m_decimator2.myDecimate(
1216  buf[pos+124] << decimation_shifts<SdrBits, InputBits>::pre64,
1217  buf[pos+125] << decimation_shifts<SdrBits, InputBits>::pre64,
1218  &intbuf[62],
1219  &intbuf[63]);
1220 
1221  m_decimator4.myDecimate(
1222  intbuf[0],
1223  intbuf[1],
1224  &intbuf[2],
1225  &intbuf[3]);
1226  m_decimator4.myDecimate(
1227  intbuf[4],
1228  intbuf[5],
1229  &intbuf[6],
1230  &intbuf[7]);
1231  m_decimator4.myDecimate(
1232  intbuf[8],
1233  intbuf[9],
1234  &intbuf[10],
1235  &intbuf[11]);
1236  m_decimator4.myDecimate(
1237  intbuf[12],
1238  intbuf[13],
1239  &intbuf[14],
1240  &intbuf[15]);
1241  m_decimator4.myDecimate(
1242  intbuf[16],
1243  intbuf[17],
1244  &intbuf[18],
1245  &intbuf[19]);
1246  m_decimator4.myDecimate(
1247  intbuf[20],
1248  intbuf[21],
1249  &intbuf[22],
1250  &intbuf[23]);
1251  m_decimator4.myDecimate(
1252  intbuf[24],
1253  intbuf[25],
1254  &intbuf[26],
1255  &intbuf[27]);
1256  m_decimator4.myDecimate(
1257  intbuf[28],
1258  intbuf[29],
1259  &intbuf[30],
1260  &intbuf[31]);
1261  m_decimator4.myDecimate(
1262  intbuf[32],
1263  intbuf[33],
1264  &intbuf[34],
1265  &intbuf[35]);
1266  m_decimator4.myDecimate(
1267  intbuf[36],
1268  intbuf[37],
1269  &intbuf[38],
1270  &intbuf[39]);
1271  m_decimator4.myDecimate(
1272  intbuf[40],
1273  intbuf[41],
1274  &intbuf[42],
1275  &intbuf[43]);
1276  m_decimator4.myDecimate(
1277  intbuf[44],
1278  intbuf[45],
1279  &intbuf[46],
1280  &intbuf[47]);
1281  m_decimator4.myDecimate(
1282  intbuf[48],
1283  intbuf[49],
1284  &intbuf[50],
1285  &intbuf[51]);
1286  m_decimator4.myDecimate(
1287  intbuf[52],
1288  intbuf[53],
1289  &intbuf[54],
1290  &intbuf[55]);
1291  m_decimator4.myDecimate(
1292  intbuf[56],
1293  intbuf[57],
1294  &intbuf[58],
1295  &intbuf[59]);
1296  m_decimator4.myDecimate(
1297  intbuf[60],
1298  intbuf[61],
1299  &intbuf[62],
1300  &intbuf[63]);
1301 
1302  m_decimator8.myDecimate(
1303  intbuf[2],
1304  intbuf[3],
1305  &intbuf[6],
1306  &intbuf[7]);
1307  m_decimator8.myDecimate(
1308  intbuf[10],
1309  intbuf[11],
1310  &intbuf[14],
1311  &intbuf[15]);
1312  m_decimator8.myDecimate(
1313  intbuf[18],
1314  intbuf[19],
1315  &intbuf[22],
1316  &intbuf[23]);
1317  m_decimator8.myDecimate(
1318  intbuf[26],
1319  intbuf[27],
1320  &intbuf[30],
1321  &intbuf[31]);
1322  m_decimator8.myDecimate(
1323  intbuf[34],
1324  intbuf[35],
1325  &intbuf[38],
1326  &intbuf[39]);
1327  m_decimator8.myDecimate(
1328  intbuf[42],
1329  intbuf[43],
1330  &intbuf[46],
1331  &intbuf[47]);
1332  m_decimator8.myDecimate(
1333  intbuf[50],
1334  intbuf[51],
1335  &intbuf[54],
1336  &intbuf[55]);
1337  m_decimator8.myDecimate(
1338  intbuf[58],
1339  intbuf[59],
1340  &intbuf[62],
1341  &intbuf[63]);
1342 
1343  m_decimator16.myDecimate(
1344  intbuf[6],
1345  intbuf[7],
1346  &intbuf[14],
1347  &intbuf[15]);
1348  m_decimator16.myDecimate(
1349  intbuf[22],
1350  intbuf[23],
1351  &intbuf[30],
1352  &intbuf[31]);
1353  m_decimator16.myDecimate(
1354  intbuf[38],
1355  intbuf[39],
1356  &intbuf[46],
1357  &intbuf[47]);
1358  m_decimator16.myDecimate(
1359  intbuf[54],
1360  intbuf[55],
1361  &intbuf[62],
1362  &intbuf[63]);
1363 
1364  m_decimator32.myDecimate(
1365  intbuf[14],
1366  intbuf[15],
1367  &intbuf[30],
1368  &intbuf[31]);
1369  m_decimator32.myDecimate(
1370  intbuf[46],
1371  intbuf[47],
1372  &intbuf[62],
1373  &intbuf[63]);
1374 
1375  m_decimator64.myDecimate(
1376  intbuf[30],
1377  intbuf[31],
1378  &intbuf[62],
1379  &intbuf[63]);
1380 
1381  (*it).setReal(intbuf[62] >> decimation_shifts<SdrBits, InputBits>::post64);
1382  (*it).setImag(intbuf[63] >> decimation_shifts<SdrBits, InputBits>::post64);
1383  fifo.bumpIndex(it);
1384  }
1385 }
1386 
1387 
1388 #endif /* INCLUDE_DSP_SAMPLESINKFIFODECIMATOR_H_ */
static const uint pre64
Definition: decimators.h:40
void decimate32_sup(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
void decimate8_sup(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
static const uint pre1
Definition: decimators.h:29
static const uint pre32
Definition: decimators.h:38
static const uint pre16
Definition: decimators.h:36
void decimate16_cen(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
void decimate4_cen(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
IntHalfbandFilter< qint32, 32 > m_decimator64
IntHalfbandFilter< qint32, 32 > m_decimator4
void decimate16_sup(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
IntHalfbandFilter< qint32, 32 > m_decimator16
static const uint post8
Definition: decimators.h:35
void decimate32_inf(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
static const uint post32
Definition: decimators.h:39
void decimate8_cen(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
unsigned int uint32_t
Definition: rtptypes_win.h:46
void decimate8_inf(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
IntHalfbandFilter< qint32, 32 > m_decimator8
void getWriteIterator(SampleVector::iterator &it1)
void decimate4_inf(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
static const uint post2
Definition: decimators.h:31
void decimate64_inf(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
static const uint pre2
Definition: decimators.h:30
void decimate2_sup(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
int32_t i
Definition: decimators.h:244
static const uint pre4
Definition: decimators.h:32
void decimate2_inf(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
static const uint pre8
Definition: decimators.h:34
void decimate64_sup(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
void decimate64_cen(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
void decimate1(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
static const uint post4
Definition: decimators.h:33
void decimate4_sup(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
static const uint post16
Definition: decimators.h:37
void decimate2_cen(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
void decimate2_u(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
void decimate32_cen(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
void decimate16_inf(SampleSinkFifoDoubleBuffered &fifo, const T *buf, qint32 len)
IntHalfbandFilter< qint32, 32 > m_decimator32
void bumpIndex(SampleVector::iterator &it1)
static const uint post64
Definition: decimators.h:41
IntHalfbandFilter< qint32, 32 > m_decimator2