00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef INCLUDED_GR_CLOCK_RECOVERY_MM_CC_H
00024 #define INCLUDED_GR_CLOCK_RECOVERY_MM_CC_H
00025
00026 #include <gr_block.h>
00027 #include <gr_complex.h>
00028
00029 class gri_mmse_fir_interpolator_cc;
00030
00031 class gr_clock_recovery_mm_cc;
00032 typedef boost::shared_ptr<gr_clock_recovery_mm_cc> gr_clock_recovery_mm_cc_sptr;
00033
00034
00035 gr_clock_recovery_mm_cc_sptr
00036 gr_make_clock_recovery_mm_cc (float omega, float gain_omega, float mu, float gain_mu,
00037 float omega_relative_limit=0.001);
00038
00049 class gr_clock_recovery_mm_cc : public gr_block
00050 {
00051 public:
00052 ~gr_clock_recovery_mm_cc ();
00053 void forecast(int noutput_items, gr_vector_int &ninput_items_required);
00054 int general_work (int noutput_items,
00055 gr_vector_int &ninput_items,
00056 gr_vector_const_void_star &input_items,
00057 gr_vector_void_star &output_items);
00058 float mu() const { return d_mu;}
00059 float omega() const { return d_omega;}
00060 float gain_mu() const { return d_gain_mu;}
00061 float gain_omega() const { return d_gain_omega;}
00062 void set_verbose (bool verbose) { d_verbose = verbose; }
00063
00064 void set_gain_mu (float gain_mu) { d_gain_mu = gain_mu; }
00065 void set_gain_omega (float gain_omega) { d_gain_omega = gain_omega; }
00066 void set_mu (float mu) { d_mu = mu; }
00067 void set_omega (float omega) {
00068 d_omega = omega;
00069 d_min_omega = omega*(1.0 - d_omega_relative_limit);
00070 d_max_omega = omega*(1.0 + d_omega_relative_limit);
00071 }
00072
00073 protected:
00074 gr_clock_recovery_mm_cc (float omega, float gain_omega, float mu, float gain_mu,
00075 float omega_relative_limi);
00076
00077 private:
00078 float d_mu;
00079 float d_omega;
00080 float d_gain_omega;
00081 float d_min_omega;
00082 float d_max_omega;
00083 float d_omega_relative_limit;
00084 float d_gain_mu;
00085 gr_complex d_last_sample;
00086 gri_mmse_fir_interpolator_cc *d_interp;
00087 bool d_verbose;
00088
00089 gr_complex d_p_2T;
00090 gr_complex d_p_1T;
00091 gr_complex d_p_0T;
00092
00093 gr_complex d_c_2T;
00094 gr_complex d_c_1T;
00095 gr_complex d_c_0T;
00096
00097 gr_complex slicer_0deg (gr_complex sample);
00098 gr_complex slicer_45deg (gr_complex sample);
00099
00100 friend gr_clock_recovery_mm_cc_sptr
00101 gr_make_clock_recovery_mm_cc (float omega, float gain_omega, float mu, float gain_mu,
00102 float omega_relative_limit);
00103 };
00104
00105 #endif