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.
freqlockcomplex.h
Go to the documentation of this file.
1 // Copyright (C) 2018 F4EXB //
3 // written by Edouard Griffiths //
4 // //
5 // See: http://liquidsdr.org/blog/pll-howto/ //
6 // Fixed filter registers saturation //
7 // Added order for PSK locking. This brilliant idea actually comes from this //
8 // post: https://www.dsprelated.com/showthread/comp.dsp/36356-1.php //
9 // //
10 // This program is free software; you can redistribute it and/or modify //
11 // it under the terms of the GNU General Public License as published by //
12 // the Free Software Foundation as version 3 of the License, or //
13 // (at your option) any later version. //
14 // //
15 // This program is distributed in the hope that it will be useful, //
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
18 // GNU General Public License V3 for more details. //
19 // //
20 // You should have received a copy of the GNU General Public License //
21 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
23 
24 #ifndef SDRBASE_DSP_FREQLOCKCOMPLEX_H_
25 #define SDRBASE_DSP_FREQLOCKCOMPLEX_H_
26 
27 #include "dsp/dsptypes.h"
28 #include "export.h"
29 
32 {
33 public:
35  ~FreqLockComplex();
36 
37  void reset();
38  void setSampleRate(unsigned int sampleRate);
40  void feed(float re, float im);
41  const std::complex<float>& getComplex() const { return m_y; }
42  float getReal() const { return m_yRe; }
43  float getImag() const { return m_yIm; }
44  float getFreq() const { return m_freq; }
45 
46 private:
48  static float normalizeAngle(float angle);
49 
50  float m_a0;
51  float m_a1;
52  std::complex<float> m_y;
53  float m_yRe;
54  float m_yIm;
55  float m_freq;
56  float m_phi;
57  float m_phiX0;
58  float m_phiX1;
59  float m_y1;
60 };
61 
62 
63 #endif /* SDRBASE_DSP_FREQLOCKCOMPLEX_H_ */
std::complex< float > m_y
const std::complex< float > & getComplex() const
float getFreq() const
float getReal() const
float getImag() const
#define SDRBASE_API
Definition: export.h:40