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.
fftcorr.h
Go to the documentation of this file.
1 // Copyright (C) 2018 F4EXB //
3 // written by Edouard Griffiths //
4 // //
5 // FFT based cross correlation //
6 // //
7 // See: http://liquidsdr.org/blog/pll-howto/ //
8 // Fixed filter registers saturation //
9 // Added order for PSK locking. This brilliant idea actually comes from this //
10 // post: https://www.dsprelated.com/showthread/comp.dsp/36356-1.php //
11 // //
12 // This program is free software; you can redistribute it and/or modify //
13 // it under the terms of the GNU General Public License as published by //
14 // the Free Software Foundation as version 3 of the License, or //
15 // (at your option) any later version. //
16 // //
17 // This program is distributed in the hope that it will be useful, //
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
20 // GNU General Public License V3 for more details. //
21 // //
22 // You should have received a copy of the GNU General Public License //
23 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
25 
26 #ifndef SDRBASE_DSP_FFTCORR_H_
27 #define SDRBASE_DSP_FFTCORR_H_
28 
29 #include <complex>
30 #include "gfft.h"
31 #include "export.h"
32 
34 public:
35  typedef std::complex<float> cmplx;
36  fftcorr(int len);
37  ~fftcorr();
38 
39  int run(const cmplx& inA, const cmplx* inB, cmplx **out);
40  const cmplx& run(const cmplx& inA, const cmplx* inB);
41 
42 private:
43  void init_fft();
44  int flen;
45  int flen2;
48  cmplx *dataA; // from A input
49  cmplx *dataB; // from B input
50  cmplx *dataBj; // conjugate of B
51  cmplx *dataP; // product of A with conjugate of B
52  int inptrA;
53  int inptrB;
54  int outptr;
55 };
56 
57 
58 #endif /* SDRBASE_DSP_FFTCORR_H_ */
cmplx * dataBj
Definition: fftcorr.h:50
int inptrA
Definition: fftcorr.h:52
int flen2
half FFT length
Definition: fftcorr.h:45
int flen
FFT length.
Definition: fftcorr.h:44
std::complex< float > cmplx
Definition: fftcorr.h:35
g_fft< float > * fftA
Definition: fftcorr.h:46
cmplx * dataA
Definition: fftcorr.h:48
g_fft< float > * fftB
Definition: fftcorr.h:47
cmplx * dataP
Definition: fftcorr.h:51
#define SDRBASE_API
Definition: export.h:40
int inptrB
Definition: fftcorr.h:53
cmplx * dataB
Definition: fftcorr.h:49
int outptr
Definition: fftcorr.h:54