GNU Radio 3.2.2 C++ API
|
00001 /* -*- c++ -*- */ 00002 /* 00003 * Copyright 2004,2006 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_GR_DD_MPSK_SYNC_CC_H 00024 #define INCLUDED_GR_DD_MPSK_SYNC_CC_H 00025 00026 #include <gr_sync_block.h> 00027 00028 class gri_mmse_fir_interpolator_cc; 00029 00030 class gr_dd_mpsk_sync_cc; 00031 typedef boost::shared_ptr<gr_dd_mpsk_sync_cc> gr_dd_mpsk_sync_cc_sptr; 00032 00033 gr_dd_mpsk_sync_cc_sptr 00034 gr_make_dd_mpsk_sync_cc (float alpha, float beta, 00035 float max_freq, float min_freq, float ref_phase, 00036 float omega, float gain_omega, float mu, float gain_mu); 00037 00038 /*! 00039 * \brief Decision directed M-PSK synchronous demod 00040 * \ingroup sync_blk 00041 * This block performs joint carrier tracking and symbol timing recovery. 00042 * 00043 * input: complex baseband; output: properly timed complex samples ready for slicing. 00044 * 00045 * N.B, at this point, it handles only QPSK. 00046 */ 00047 00048 class gr_dd_mpsk_sync_cc : public gr_block 00049 { 00050 friend gr_dd_mpsk_sync_cc_sptr gr_make_dd_mpsk_sync_cc (float alpha, float beta, 00051 float max_freq, float min_freq, float ref_phase, 00052 float omega, float gain_omega, float mu, float gain_mu); 00053 public: 00054 ~gr_dd_mpsk_sync_cc (); 00055 void forecast(int noutput_items, gr_vector_int &ninput_items_required); 00056 float mu() const { return d_mu;} 00057 float omega() const { return d_omega;} 00058 float gain_mu() const { return d_gain_mu;} 00059 float gain_omega() const { return d_gain_omega;} 00060 00061 void set_gain_mu (float gain_mu) { d_gain_mu = gain_mu; } 00062 void set_gain_omega (float gain_omega) { d_gain_omega = gain_omega; } 00063 void set_mu (float mu) { d_mu = mu; } 00064 void set_omega (float omega) { d_omega = omega; } 00065 00066 protected: 00067 gr_dd_mpsk_sync_cc (float alpha, float beta, float max_freq, float min_freq, float ref_phase, 00068 float omega, float gain_omega, float mu, float gain_mu); 00069 00070 int general_work (int noutput_items, 00071 gr_vector_int &ninput_items, 00072 gr_vector_const_void_star &input_items, 00073 gr_vector_void_star &output_items); 00074 00075 private: 00076 static const unsigned int DLLEN = 8; // delay line length. 00077 00078 float d_alpha,d_beta,d_max_freq,d_min_freq,d_ref_phase; 00079 float d_omega, d_gain_omega, d_mu, d_gain_mu; 00080 float d_phase, d_freq; 00081 gr_complex slicer_45deg (gr_complex sample); 00082 gr_complex slicer_0deg (gr_complex sample); 00083 gr_complex d_last_sample; 00084 gri_mmse_fir_interpolator_cc *d_interp; 00085 00086 gr_complex d_dl[2 * DLLEN]; // Holds post carrier tracking samples. 00087 // double length delay line to avoid wraps. 00088 unsigned int d_dl_idx; // indexes oldest sample in delay line. 00089 00090 float phase_detector(gr_complex sample,float ref_phase); 00091 }; 00092 00093 #endif