3 * Copyright 2002 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
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)
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.
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.
23 #ifndef _GRATSCBITTIMINGLOOP_H_
24 #define _GRATSCBITTIMINGLOOP_H_
27 #include <VrSigProc.h>
28 #include <VrHistoryProc.h>
29 #include <VrDecimatingSigProc.h>
30 #include <interleaver_fifo.h>
31 #include <gr_single_pole_iir.h>
32 #include <gr_mmse_fir_interpolator.h>
33 #include <atsci_slicer_agc.h>
35 #include <atsci_diag_output.h>
39 * \brief ATSC BitTimingLoop
41 * This class accepts a single real input and produces a single real output
44 class GrAtscBitTimingLoop : public VrDecimatingSigProc<float,float> {
48 GrAtscBitTimingLoop ();
49 virtual ~GrAtscBitTimingLoop () { };
51 virtual const char *name () { return "GrAtscBitTimingLoop"; }
53 virtual int forecast (VrSampleRange output,
54 VrSampleRange inputs[]);
56 virtual int work (VrSampleRange output, void *o[],
57 VrSampleRange inputs[], void *i[]);
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; }
70 iType produce_sample (const iType *in, unsigned int &index);
71 double filter_error (double e);
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
81 double d_loop_filter_tap;
84 #ifdef _BT_DIAG_OUTPUT_
90 #endif // _GRATSCBITTIMINGLOOP_H_