GNU Radio Manual and C++ API Reference  3.7.7
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
atsc_sync_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2014 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 INCLUDED_DTV_ATSC_SYNC_IMPL_H
24 #define INCLUDED_DTV_ATSC_SYNC_IMPL_H
25 
27 #include <gnuradio/dtv/atsc_sync.h>
30 
31 namespace gr {
32  namespace dtv {
33 
34  class atsc_sync_impl : public atsc_sync
35  {
36  private:
37  gr::filter::single_pole_iir<float,float,float> d_loop; // ``VCO'' loop filter
39 
40  unsigned long long d_next_input;
41  double d_rx_clock_to_symbol_freq;
42  int d_si;
43  double d_w; // ratio of PERIOD of Tx to Rx clocks
44  double d_mu; // fractional delay [0,1]
45  int d_incr;
46 
47  float sample_mem[ATSC_DATA_SEGMENT_LENGTH];
48  float data_mem[ATSC_DATA_SEGMENT_LENGTH];
49 
50  double d_timing_adjust;
51  int d_counter; // free running mod 832 counter
52  int d_symbol_index;
53  bool d_seg_locked;
54  int d_sr; // 4 bit shift register
55  signed char d_integrator[ATSC_DATA_SEGMENT_LENGTH];
56  int output_produced;
57 
58  public:
59  atsc_sync_impl(float rate);
61 
62  void reset();
63 
64  void forecast(int noutput_items,
65  gr_vector_int &ninput_items_required);
66 
67  virtual int general_work(int noutput_items,
68  gr_vector_int &ninput_items,
69  gr_vector_const_void_star &input_items,
70  gr_vector_void_star &output_items);
71  };
72 
73  } /* namespace dtv */
74 } /* namespace gr */
75 
76 #endif /* INCLUDED_DTV_ATSC_SYNC_IMPL_H */
Definition: atsc_sync_impl.h:34
ATSC Receiver SYNC.
Definition: atsc_sync.h:37
virtual int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
compute output items from input items
void forecast(int noutput_items, gr_vector_int &ninput_items_required)
Estimate input requirements given output request.
std::vector< const void * > gr_vector_const_void_star
Definition: gnuradio-runtime/include/gnuradio/types.h:38
static const int ATSC_DATA_SEGMENT_LENGTH
Definition: atsc_consts.h:41
std::vector< void * > gr_vector_void_star
Definition: gnuradio-runtime/include/gnuradio/types.h:37
std::vector< int > gr_vector_int
Definition: gnuradio-runtime/include/gnuradio/types.h:33
Include this header to use the message passing features.
Definition: logger.h:129
atsc_sync_impl(float rate)
Compute intermediate samples between signal samples x(k*Ts)
Definition: mmse_fir_interpolator_ff.h:50