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