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.
rdsdemod.h
Go to the documentation of this file.
1 // Copyright (C) 2015 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 
20 #ifndef PLUGINS_CHANNEL_BFM_RDSDEMOD_H_
21 #define PLUGINS_CHANNEL_BFM_RDSDEMOD_H_
22 
23 #include <QObject>
24 //#include "util/udpsink.h" // UDP debug
25 
26 #include "dsp/dsptypes.h"
27 
28 class RDSDemod : public QObject
29 {
30  Q_OBJECT
31 public:
32  RDSDemod();
33  ~RDSDemod();
34 
35  void setSampleRate(int srate);
36  bool process(Real rdsSample, bool &bit);
37 
38  struct{
42  } m_report;
43 
44 protected:
45  bool biphase(Real acc, bool &bit, Real d_cphi);
46  Real filter_lp_2400_iq(Real in, int iqIndex);
47  Real filter_lp_pll(Real input);
48  int sign(Real a);
49 
50 private:
51  struct
52  {
53  double subcarr_phi;
55  double clock_offset;
56  double clock_phi;
61  double d_cphi;
62  Real acc;
65  int counter;
67  int tot_errs[2];
68  int dbit;
69  } m_parms;
70 
71  Real m_xv[2][2+1];
72  Real m_yv[2][2+1];
73  Real m_xw[1+1];
74  Real m_yw[1+1];
76 
77  int m_srate;
78 
79  static const Real m_pllBeta;
80  static const Real m_fsc;
81 };
82 
83 #endif /* PLUGINS_CHANNEL_BFM_RDSDEMOD_H_ */
double subcarr_phi
Definition: rdsdemod.h:53
bool biphase(Real acc, bool &bit, Real d_cphi)
Definition: rdsdemod.cpp:138
bool process(Real rdsSample, bool &bit)
Definition: rdsdemod.cpp:75
Real filter_lp_pll(Real input)
Definition: rdsdemod.cpp:201
static const Real m_fsc
Definition: rdsdemod.h:80
int reading_frame
Definition: rdsdemod.h:66
double clock_phi
Definition: rdsdemod.h:56
Real fclk
Definition: rdsdemod.h:41
Real lo_clock
Definition: rdsdemod.h:58
struct RDSDemod::@1 m_report
int counter
Definition: rdsdemod.h:65
Real prev_bb
Definition: rdsdemod.h:60
int tot_errs[2]
Definition: rdsdemod.h:67
Real filter_lp_2400_iq(Real in, int iqIndex)
Definition: rdsdemod.cpp:186
int numsamples
Definition: rdsdemod.h:63
Real m_yw[1+1]
Definition: rdsdemod.h:74
int dbit
Definition: rdsdemod.h:68
int sign(Real a)
Definition: rdsdemod.cpp:211
Real acc
Definition: rdsdemod.h:39
Real m_prev
Definition: rdsdemod.h:75
Real subcarr_bb[2]
Definition: rdsdemod.h:54
Real m_xv[2][2+1]
Definition: rdsdemod.h:71
int m_srate
Definition: rdsdemod.h:77
Real m_yv[2][2+1]
Definition: rdsdemod.h:72
RDSDemod()
Definition: rdsdemod.cpp:34
Real qua
Definition: rdsdemod.h:40
Real prev_acc
Definition: rdsdemod.h:64
double clock_offset
Definition: rdsdemod.h:55
static const Real m_pllBeta
Definition: rdsdemod.h:79
double prev_clock_phi
Definition: rdsdemod.h:57
~RDSDemod()
Definition: rdsdemod.cpp:65
struct RDSDemod::@2 m_parms
Real m_xw[1+1]
Definition: rdsdemod.h:73
void setSampleRate(int srate)
FIXME: fix rate for now.
Definition: rdsdemod.cpp:70
float Real
Definition: dsptypes.h:42
double d_cphi
Definition: rdsdemod.h:61
Real prev_lo_clock
Definition: rdsdemod.h:59