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