GNU Radio 3.5.1 C++ API
|
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 #ifndef _ATSC_FS_CORRELATOR_H_ 00023 #define _ATSC_FS_CORRELATOR_H_ 00024 00025 #include <atsc_api.h> 00026 00027 /*! 00028 * \brief abstract base class for ATSC field sync correlator 00029 * 00030 * Processes input samples one at a time looking for 00031 * an occurence of either the field sync 1 or field sync 2 pattern. 00032 * 00033 * For each sample processed, an output sample and an output tag are produced. 00034 * The output samples are identical to the input samples but are delayed by 00035 * a number of samples given by \p delay(). The output tag associated with 00036 * the the given output sample indicates whether this sample is the beginning 00037 * of one of the field syncs or is an ordinary sample. The tags are defined in 00038 * atsci_sync_tag.h. 00039 * 00040 * For ease of use, the field sync patterns are defined to begin with the 00041 * first symbol of the 4 symbol data segment sync pattern that immediately 00042 * proceeds the actual PN 511 code. This makes it easier for downstream code 00043 * to determine the location of data segment syncs merely by counting. They'll 00044 * occur every 832 samples assuming everything is working. 00045 */ 00046 00047 class ATSC_API atsci_fs_correlator { 00048 00049 public: 00050 00051 // CREATORS 00052 atsci_fs_correlator (); 00053 virtual ~atsci_fs_correlator () = 0; 00054 00055 // MANIPULATORS 00056 virtual void reset () = 0; 00057 virtual void filter (float input_sample, float *output_sample, float *output_tag) = 0; 00058 00059 // ACCESSORS 00060 00061 //! return delay in samples from input to output 00062 virtual int delay () const = 0; 00063 }; 00064 00065 #endif /* _ATSC_FS_CORRELATOR_H_ */