GNU Radio 3.7.1 C++ API
GrAtscFPLL.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2002 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 
00024 #ifndef _GRATSCFPLL_H_
00025 #define _GRATSCFPLL_H_
00026 
00027 #include <gnuradio/blocks/nco.h>
00028 #include <gnuradio/filter/iir.h>
00029 #include <gnuradio/filter/single_pole_iir.h>
00030 #include <gnuradio/analog/agc.h>
00031 #include <VrSigProc.h>
00032 #include <stdio.h>
00033 #include <gnuradio/atsc/diag_output_impl.h>
00034 
00035 /*!
00036  * \brief ATSC FPLL (2nd Version)
00037  *
00038  * Used as follows:
00039  *                         float              float
00040  *  A/D --> GrFIRfilterFFF ----> GrAtscFPLL ---->
00041  *
00042  * We use GrFIRfilterFFF to bandpass filter the signal of interest.
00043  *
00044  * This class accepts a single real input and produces a single real output
00045  */
00046 
00047 class GrAtscFPLL : public VrSigProc {
00048  protected:
00049 
00050   typedef float  iType;
00051   typedef float  oType;
00052 
00053  public:
00054 
00055   GrAtscFPLL (double a_initial_freq);
00056   virtual ~GrAtscFPLL () {}
00057 
00058   virtual const char *name () { return "GrAtscFPLL"; }
00059 
00060   virtual void initialize ();
00061 
00062   virtual int work (VrSampleRange output, void *o[],
00063                     VrSampleRange inputs[], void *i[]);
00064 
00065 
00066   // diagnostic routines
00067   void set_initial_phase (double phase) { initial_phase = phase; }         // radians
00068   void set_no_update (bool a_no_update) { debug_no_update = a_no_update; }
00069 
00070 
00071  protected:
00072 
00073   double                        initial_freq;
00074   double                        initial_phase;
00075   bool                          debug_no_update;
00076   gr_nco<float,float>           nco;
00077   gr_agc                        agc;    // automatic gain control
00078   gr_single_pole_iir<float,float,float> afci;
00079   gr_single_pole_iir<float,float,float> afcq;
00080 
00081 #ifdef _FPLL_DIAG_OUTPUT_
00082   FILE                          *fp;
00083 #endif
00084 
00085 };
00086 
00087 
00088 #endif // _GRATSCFPLL_H_