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.
complex.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // complex.h -- Complex arithmetic
3 //
4 // Copyright (C) 2006-2008
5 // Dave Freese, W1HKJ
6 // Copyright (C) 2008
7 // Stelios Bounanos, M0GLD
8 //
9 // This file is part of fldigi.
10 //
11 // Fldigi is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // Fldigi is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with fldigi. If not, see <http://www.gnu.org/licenses/>.
23 // ----------------------------------------------------------------------------
24 
25 #ifndef _COMPLEX_H
26 #define _COMPLEX_H
27 
28 #include <cmath>
29 #include <complex>
30 
31 typedef std::complex<float> cmplx;
32 
33 inline cmplx cmac (const cmplx *a, const cmplx *b, int ptr, int len) {
34  cmplx z;
35  ptr %= len;
36  for (int i = 0; i < len; i++) {
37  z += a[i] * b[ptr];
38  ptr = (ptr + 1) % len;
39  }
40  return z;
41 }
42 
43 #endif
cmplx cmac(const cmplx *a, const cmplx *b, int ptr, int len)
Definition: complex.h:33
std::complex< float > cmplx
Definition: complex.h:31
int32_t i
Definition: decimators.h:244