GNU Radio Manual and C++ API Reference  3.7.4
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GrAtscBitTimingLoop.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2002 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 _GRATSCBITTIMINGLOOP_H_
24 #define _GRATSCBITTIMINGLOOP_H_
25 
26 #include <gnuradio/blocks/nco.h>
27 #include <VrSigProc.h>
28 #include <VrHistoryProc.h>
29 #include <VrDecimatingSigProc.h>
32 #include <gnuradio/filter/mmse_fir_interpolator.h>
34 #include <stdio.h>
36 
37 
38 /*!
39  * \brief ATSC BitTimingLoop
40  *
41  * This class accepts a single real input and produces a single real output
42  */
43 
44 class GrAtscBitTimingLoop : public VrDecimatingSigProc<float,float> {
45 
46  public:
47 
49  virtual ~GrAtscBitTimingLoop () { };
50 
51  virtual const char *name () { return "GrAtscBitTimingLoop"; }
52 
53  virtual int forecast (VrSampleRange output,
54  VrSampleRange inputs[]);
55 
56  virtual int work (VrSampleRange output, void *o[],
57  VrSampleRange inputs[], void *i[]);
58 
59  // debug
60  void set_mu (double a_mu) { mu = a_mu; }
61  void set_no_update (bool a_no_update) { debug_no_update = a_no_update; }
62  void set_loop_filter_tap (double tap) { loop.set_taps (tap); }
63  void set_timing_rate (double rate) { d_timing_rate = rate; }
64 
65  protected:
66 
67  typedef float iType;
68  typedef float oType;
69 
70  iType produce_sample (const iType *in, unsigned int &index);
71  double filter_error (double e);
72 
73  VrSampleIndex next_input;
74  gr_mmse_fir_interpolator intr;
75  double w; // timing control word
76  double mu; // fractional delay
77  iType last_right; // last right hand sample
78  gr_single_pole_iir<double,double,double> loop;
79  bool debug_no_update;// debug
80 
82  double d_timing_rate;
83 
84 #ifdef _BT_DIAG_OUTPUT_
85  FILE *fp_loop;
86  FILE *fp_ps;
87 #endif
88 };
89 
90 #endif // _GRATSCBITTIMINGLOOP_H_
iType produce_sample(const iType *in, unsigned int &index)
gr_mmse_fir_interpolator intr
Definition: GrAtscBitTimingLoop.h:74
void set_loop_filter_tap(double tap)
Definition: GrAtscBitTimingLoop.h:62
double w
Definition: GrAtscBitTimingLoop.h:75
double mu
Definition: GrAtscBitTimingLoop.h:76
virtual ~GrAtscBitTimingLoop()
Definition: GrAtscBitTimingLoop.h:49
virtual int forecast(VrSampleRange output, VrSampleRange inputs[])
bool debug_no_update
Definition: GrAtscBitTimingLoop.h:79
VrSampleIndex next_input
Definition: GrAtscBitTimingLoop.h:73
ATSC BitTimingLoop.
Definition: GrAtscBitTimingLoop.h:44
float oType
Definition: GrAtscBitTimingLoop.h:68
double filter_error(double e)
float iType
Definition: GrAtscBitTimingLoop.h:67
void set_no_update(bool a_no_update)
Definition: GrAtscBitTimingLoop.h:61
void set_mu(double a_mu)
Definition: GrAtscBitTimingLoop.h:60
virtual int work(VrSampleRange output, void *o[], VrSampleRange inputs[], void *i[])
iType last_right
Definition: GrAtscBitTimingLoop.h:77
gr_single_pole_iir< double, double, double > loop
Definition: GrAtscBitTimingLoop.h:78
double d_timing_rate
Definition: GrAtscBitTimingLoop.h:82
void set_timing_rate(double rate)
Definition: GrAtscBitTimingLoop.h:63
double d_loop_filter_tap
Definition: GrAtscBitTimingLoop.h:81
virtual const char * name()
Definition: GrAtscBitTimingLoop.h:51