root / gnuradio-core / src / lib / general / gr_clock_recovery_mm_cc.h @ 83200c22
History | View | Annotate | Download (3.7 kB)
| 1 | /* -*- c++ -*- */
|
|---|---|
| 2 | /*
|
| 3 | * Copyright 2004 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_GR_CLOCK_RECOVERY_MM_CC_H
|
| 24 | #define INCLUDED_GR_CLOCK_RECOVERY_MM_CC_H
|
| 25 | |
| 26 | #include <gr_block.h> |
| 27 | #include <gr_complex.h> |
| 28 | |
| 29 | class gri_mmse_fir_interpolator_cc; |
| 30 | |
| 31 | class gr_clock_recovery_mm_cc; |
| 32 | typedef boost::shared_ptr<gr_clock_recovery_mm_cc> gr_clock_recovery_mm_cc_sptr;
|
| 33 | |
| 34 | // public constructor
|
| 35 | gr_clock_recovery_mm_cc_sptr |
| 36 | gr_make_clock_recovery_mm_cc (float omega, float gain_omega, float mu, float gain_mu, |
| 37 | float omega_relative_limit=0.001); |
| 38 | |
| 39 | /*!
|
| 40 | * \brief Mueller and MÃŒller (M&M) based clock recovery block with complex input, complex output. |
| 41 | * \ingroup block |
| 42 | * |
| 43 | * This implements the Mueller and MÃŒller (M&M) discrete-time error-tracking synchronizer. |
| 44 | * The complex version here is based on: |
| 45 | * Modified Mueller and Muller clock recovery circuit |
| 46 | * Based: |
| 47 | * G. R. Danesfahani, T.G. Jeans, "Optimisation of modified Mueller and Muller |
| 48 | * algorithm," Electronics Letters, Vol. 31, no. 13, 22 June 1995, pp. 1032 - 1033. |
| 49 | */ |
| 50 | class gr_clock_recovery_mm_cc : public gr_block |
| 51 | {
|
| 52 | public:
|
| 53 | ~gr_clock_recovery_mm_cc (); |
| 54 | void forecast(int noutput_items, gr_vector_int &ninput_items_required); |
| 55 | int general_work (int noutput_items, |
| 56 | gr_vector_int &ninput_items, |
| 57 | gr_vector_const_void_star &input_items, |
| 58 | gr_vector_void_star &output_items); |
| 59 | float mu() const { return d_mu;} |
| 60 | float omega() const { return d_omega;} |
| 61 | float gain_mu() const { return d_gain_mu;} |
| 62 | float gain_omega() const { return d_gain_omega;} |
| 63 | void set_verbose (bool verbose) { d_verbose = verbose; } |
| 64 | |
| 65 | void set_gain_mu (float gain_mu) { d_gain_mu = gain_mu; } |
| 66 | void set_gain_omega (float gain_omega) { d_gain_omega = gain_omega; } |
| 67 | void set_mu (float mu) { d_mu = mu; } |
| 68 | void set_omega (float omega) { |
| 69 | d_omega = omega; |
| 70 | d_min_omega = omega*(1.0 - d_omega_relative_limit); |
| 71 | d_max_omega = omega*(1.0 + d_omega_relative_limit); |
| 72 | } |
| 73 | |
| 74 | protected:
|
| 75 | gr_clock_recovery_mm_cc (float omega, float gain_omega, float mu, float gain_mu, |
| 76 | float omega_relative_limi);
|
| 77 | |
| 78 | private:
|
| 79 | float d_mu;
|
| 80 | float d_omega;
|
| 81 | float d_gain_omega;
|
| 82 | float d_min_omega; // minimum allowed omega |
| 83 | float d_max_omega; // maximum allowed omeg |
| 84 | float d_omega_relative_limit; // used to compute min and max omega |
| 85 | float d_gain_mu;
|
| 86 | gr_complex d_last_sample; |
| 87 | gri_mmse_fir_interpolator_cc *d_interp; |
| 88 | bool d_verbose;
|
| 89 | |
| 90 | gr_complex d_p_2T; |
| 91 | gr_complex d_p_1T; |
| 92 | gr_complex d_p_0T; |
| 93 | |
| 94 | gr_complex d_c_2T; |
| 95 | gr_complex d_c_1T; |
| 96 | gr_complex d_c_0T; |
| 97 | |
| 98 | gr_complex slicer_0deg (gr_complex sample); |
| 99 | gr_complex slicer_45deg (gr_complex sample); |
| 100 | |
| 101 | friend gr_clock_recovery_mm_cc_sptr |
| 102 | gr_make_clock_recovery_mm_cc (float omega, float gain_omega, float mu, float gain_mu, |
| 103 | float omega_relative_limit);
|
| 104 | }; |
| 105 | |
| 106 | #endif
|