GNU Radio Manual and C++ API Reference 3.7.14.0
The Free & Open Software Radio Ecosystem
fs_checker_naive_impl.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 _ATSC_FS_CHECKER_NAIVE_H_
24#define _ATSC_FS_CHECKER_NAIVE_H_
25
26#include <gnuradio/atsc/api.h>
28
29/*!
30 * \brief Naive concrete implementation of field sync checker
31 */
33{
34
35private:
36 static const int SRSIZE = 1024; // must be power of two
37 int d_index; // points at oldest sample
38 float d_sample_sr[SRSIZE]; // sample shift register
39 atsc::syminfo d_tag_sr[SRSIZE]; // tag shift register
40 unsigned char d_bit_sr[SRSIZE]; // binary decision shift register
41 int d_field_num;
42 int d_segment_num;
43
44 static const int OFFSET_511 = 0; // offset to PN 511 pattern
45 static const int LENGTH_511 = 511 + 4; // length of PN 511 pattern (+ 4 seg sync)
46 static const int OFFSET_2ND_63 = 578; // offset to second PN 63 pattern
47 static const int LENGTH_2ND_63 = 63; // length of PN 63 pattern
48
49 static unsigned char s_511[LENGTH_511]; // PN 511 pattern
50 static unsigned char s_63[LENGTH_2ND_63]; // PN 63 pattern
51
52 inline static int wrap(int index) { return index & (SRSIZE - 1); }
53 inline static int incr(int index) { return wrap(index + 1); }
54 inline static int decr(int index) { return wrap(index - 1); }
55
56public:
57 // CREATORS
60
61 // MANIPULATORS
62 virtual void reset();
63 void filter(float input_sample,
64 atsc::syminfo input_tag,
65 float* output_sample,
66 atsc::syminfo* output_tag);
67
68 // ACCESSORS
69
70 //! return delay in samples from input to output
71 int delay() const;
72};
73
74
75#endif /* _ATSC_FS_CHECKER_NAIVE_H_ */
Naive concrete implementation of field sync checker.
Definition: fs_checker_naive_impl.h:33
virtual void reset()
void filter(float input_sample, atsc::syminfo input_tag, float *output_sample, atsc::syminfo *output_tag)
int delay() const
return delay in samples from input to output
abstract base class for ATSC field sync checker
Definition: fs_checker_impl.h:52
#define ATSC_API
Definition: gr-atsc/include/gnuradio/atsc/api.h:30
Definition: syminfo_impl.h:31