GNU Radio 3.7.1 C++ API
|
00001 /* -*- c++ -*- */ 00002 /* 00003 * Copyright 2004,2007,2011,2012 Free Software Foundation, Inc. 00004 * 00005 * This file is part of GNU Radio 00006 * 00007 * GNU Radio is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 3, or (at your option) 00010 * any later version. 00011 * 00012 * GNU Radio is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with GNU Radio; see the file COPYING. If not, write to 00019 * the Free Software Foundation, Inc., 51 Franklin Street, 00020 * Boston, MA 02110-1301, USA. 00021 */ 00022 00023 #ifndef INCLUDED_DIGITAL_MPSK_RECEIVER_CC_H 00024 #define INCLUDED_DIGITAL_MPSK_RECEIVER_CC_H 00025 00026 #include <gnuradio/digital/api.h> 00027 #include <gnuradio/block.h> 00028 00029 namespace gr { 00030 namespace digital { 00031 00032 /*! 00033 * \brief This block takes care of receiving M-PSK modulated 00034 * signals through phase, frequency, and symbol synchronization. 00035 * \ingroup synchronizers_blk 00036 * 00037 * \details 00038 * It performs carrier frequency and phase locking as well as 00039 * symbol timing recovery. It works with (D)BPSK, (D)QPSK, and 00040 * (D)8PSK as tested currently. It should also work for OQPSK and 00041 * PI/4 DQPSK. 00042 * 00043 * The phase and frequency synchronization are based on a Costas 00044 * loop that finds the error of the incoming signal point compared 00045 * to its nearest constellation point. The frequency and phase of 00046 * the NCO are updated according to this error. There are 00047 * optimized phase error detectors for BPSK and QPSK, but 8PSK is 00048 * done using a brute-force computation of the constellation 00049 * points to find the minimum. 00050 * 00051 * The symbol synchronization is done using a modified Mueller and 00052 * Muller circuit from the paper: 00053 * 00054 * "G. R. Danesfahani, T. G. Jeans, "Optimisation of modified Mueller 00055 * and Muller algorithm," Electronics Letters, Vol. 31, no. 13, 22 00056 * June 1995, pp. 1032 - 1033." 00057 * 00058 * This circuit interpolates the downconverted sample (using the 00059 * NCO developed by the Costas loop) every mu samples, then it 00060 * finds the sampling error based on this and the past symbols and 00061 * the decision made on the samples. Like the phase error 00062 * detector, there are optimized decision algorithms for BPSK and 00063 * QPKS, but 8PSK uses another brute force computation against all 00064 * possible symbols. The modifications to the M&M used here reduce 00065 * self-noise. 00066 * 00067 */ 00068 class DIGITAL_API mpsk_receiver_cc : virtual public block 00069 { 00070 public: 00071 // gr::digital::mpsk_receiver_cc::sptr 00072 typedef boost::shared_ptr<mpsk_receiver_cc> sptr; 00073 00074 /*! 00075 * \brief Make a M-PSK receiver block. 00076 * 00077 * \param M modulation order of the M-PSK modulation 00078 * \param theta any constant phase rotation from the real axis of the constellation 00079 * \param loop_bw Loop bandwidth to set gains of phase/freq tracking loop 00080 * \param fmin minimum normalized frequency value the loop can achieve 00081 * \param fmax maximum normalized frequency value the loop can achieve 00082 * \param mu initial parameter for the interpolator [0,1] 00083 * \param gain_mu gain parameter of the M&M error signal to adjust mu (~0.05) 00084 * \param omega initial value for the number of symbols between samples (~number of samples/symbol) 00085 * \param gain_omega gain parameter to adjust omega based on the error (~omega^2/4) 00086 * \param omega_rel sets the maximum (omega*(1+omega_rel)) and minimum (omega*(1+omega_rel)) omega (~0.005) 00087 * 00088 * The constructor also chooses which phase detector and 00089 * decision maker to use in the work loop based on the value of 00090 * M. 00091 */ 00092 static sptr make(unsigned int M, float theta, 00093 float loop_bw, 00094 float fmin, float fmax, 00095 float mu, float gain_mu, 00096 float omega, float gain_omega, float omega_rel); 00097 00098 //! Returns the modulation order (M) currently set 00099 virtual float modulation_order() const = 0; 00100 00101 //! Returns current value of theta 00102 virtual float theta() const = 0; 00103 00104 //! Returns current value of mu 00105 virtual float mu() const = 0; 00106 00107 //! Returns current value of omega 00108 virtual float omega() const = 0; 00109 00110 //! Returns mu gain factor 00111 virtual float gain_mu() const = 0; 00112 00113 //! Returns omega gain factor 00114 virtual float gain_omega() const = 0; 00115 00116 //! Returns the relative omega limit 00117 virtual float gain_omega_rel() const = 0; 00118 00119 //! Sets the modulation order (M) currently 00120 virtual void set_modulation_order(unsigned int M) = 0; 00121 00122 //! Sets value of theta 00123 virtual void set_theta(float theta) = 0; 00124 00125 //! Sets value of mu 00126 virtual void set_mu(float mu) = 0; 00127 00128 //! Sets value of omega and its min and max values 00129 virtual void set_omega(float omega) = 0; 00130 00131 //! Sets value for mu gain factor 00132 virtual void set_gain_mu(float gain_mu) = 0; 00133 00134 //! Sets value for omega gain factor 00135 virtual void set_gain_omega(float gain_omega) = 0; 00136 00137 //! Sets the relative omega limit and resets omega min/max values 00138 virtual void set_gain_omega_rel(float omega_rel) = 0; 00139 }; 00140 00141 } /* namespace digital */ 00142 } /* namespace gr */ 00143 00144 #endif /* INCLUDED_DIGITAL_MPSK_RECEIVER_CC_H */