GNU Radio Manual and C++ API Reference  3.7.4.1
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
mpsk_receiver_cc.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2004,2007,2011,2012 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef INCLUDED_DIGITAL_MPSK_RECEIVER_CC_H
24 #define INCLUDED_DIGITAL_MPSK_RECEIVER_CC_H
25 
26 #include <gnuradio/digital/api.h>
27 #include <gnuradio/block.h>
29 
30 namespace gr {
31  namespace digital {
32 
33  /*!
34  * \brief This block takes care of receiving M-PSK modulated
35  * signals through phase, frequency, and symbol synchronization.
36  * \ingroup synchronizers_blk
37  *
38  * \details
39  * It performs carrier frequency and phase locking as well as
40  * symbol timing recovery. It works with (D)BPSK, (D)QPSK, and
41  * (D)8PSK as tested currently. It should also work for OQPSK and
42  * PI/4 DQPSK.
43  *
44  * The phase and frequency synchronization are based on a Costas
45  * loop that finds the error of the incoming signal point compared
46  * to its nearest constellation point. The frequency and phase of
47  * the NCO are updated according to this error. There are
48  * optimized phase error detectors for BPSK and QPSK, but 8PSK is
49  * done using a brute-force computation of the constellation
50  * points to find the minimum.
51  *
52  * The symbol synchronization is done using a modified Mueller and
53  * Muller circuit from the paper:
54  *
55  * "G. R. Danesfahani, T. G. Jeans, "Optimisation of modified Mueller
56  * and Muller algorithm," Electronics Letters, Vol. 31, no. 13, 22
57  * June 1995, pp. 1032 - 1033."
58  *
59  * This circuit interpolates the downconverted sample (using the
60  * NCO developed by the Costas loop) every mu samples, then it
61  * finds the sampling error based on this and the past symbols and
62  * the decision made on the samples. Like the phase error
63  * detector, there are optimized decision algorithms for BPSK and
64  * QPKS, but 8PSK uses another brute force computation against all
65  * possible symbols. The modifications to the M&M used here reduce
66  * self-noise.
67  *
68  */
70  : virtual public block,
71  virtual public blocks::control_loop
72  {
73  public:
74  // gr::digital::mpsk_receiver_cc::sptr
76 
77  /*!
78  * \brief Make a M-PSK receiver block.
79  *
80  * \param M modulation order of the M-PSK modulation
81  * \param theta any constant phase rotation from the real axis of the constellation
82  * \param loop_bw Loop bandwidth to set gains of phase/freq tracking loop
83  * \param fmin minimum normalized frequency value the loop can achieve
84  * \param fmax maximum normalized frequency value the loop can achieve
85  * \param mu initial parameter for the interpolator [0,1]
86  * \param gain_mu gain parameter of the M&M error signal to adjust mu (~0.05)
87  * \param omega initial value for the number of symbols between samples (~number of samples/symbol)
88  * \param gain_omega gain parameter to adjust omega based on the error (~omega^2/4)
89  * \param omega_rel sets the maximum (omega*(1+omega_rel)) and minimum (omega*(1+omega_rel)) omega (~0.005)
90  *
91  * The constructor also chooses which phase detector and
92  * decision maker to use in the work loop based on the value of
93  * M.
94  */
95  static sptr make(unsigned int M, float theta,
96  float loop_bw,
97  float fmin, float fmax,
98  float mu, float gain_mu,
99  float omega, float gain_omega, float omega_rel);
100 
101  //! Returns the modulation order (M) currently set
102  virtual float modulation_order() const = 0;
103 
104  //! Returns current value of theta
105  virtual float theta() const = 0;
106 
107  //! Returns current value of mu
108  virtual float mu() const = 0;
109 
110  //! Returns current value of omega
111  virtual float omega() const = 0;
112 
113  //! Returns mu gain factor
114  virtual float gain_mu() const = 0;
115 
116  //! Returns omega gain factor
117  virtual float gain_omega() const = 0;
118 
119  //! Returns the relative omega limit
120  virtual float gain_omega_rel() const = 0;
121 
122  //! Sets the modulation order (M) currently
123  virtual void set_modulation_order(unsigned int M) = 0;
124 
125  //! Sets value of theta
126  virtual void set_theta(float theta) = 0;
127 
128  //! Sets value of mu
129  virtual void set_mu(float mu) = 0;
130 
131  //! Sets value of omega and its min and max values
132  virtual void set_omega(float omega) = 0;
133 
134  //! Sets value for mu gain factor
135  virtual void set_gain_mu(float gain_mu) = 0;
136 
137  //! Sets value for omega gain factor
138  virtual void set_gain_omega(float gain_omega) = 0;
139 
140  //! Sets the relative omega limit and resets omega min/max values
141  virtual void set_gain_omega_rel(float omega_rel) = 0;
142  };
143 
144  } /* namespace digital */
145 } /* namespace gr */
146 
147 #endif /* INCLUDED_DIGITAL_MPSK_RECEIVER_CC_H */
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:30
shared_ptr documentation stub
Definition: shared_ptr_docstub.h:15
boost::shared_ptr< mpsk_receiver_cc > sptr
Definition: mpsk_receiver_cc.h:75
This block takes care of receiving M-PSK modulated signals through phase, frequency, and symbol synchronization.
Definition: mpsk_receiver_cc.h:69
A second-order control loop implementation class.
Definition: control_loop.h:61
The abstract base class for all 'terminal' processing blocks.A signal processing flow is constructed ...
Definition: block.h:60