atsci_fs_correlator_naive.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _ATSC_FS_CORRELATOR_NAIVE_H_
00024 #define _ATSC_FS_CORRELATOR_NAIVE_H_
00025
00026 #include <atsci_fs_correlator.h>
00027
00031 class atsci_fs_correlator_naive : public atsci_fs_correlator {
00032
00033 private:
00034 static const int SRSIZE = 1024;
00035 int d_index;
00036 float d_sample_sr[SRSIZE];
00037 unsigned char d_bit_sr[SRSIZE];
00038
00039 static const int OFFSET_511 = 0;
00040 static const int LENGTH_511 = 511 + 4;
00041 static const int OFFSET_2ND_63 = 578;
00042 static const int LENGTH_2ND_63 = 63;
00043
00044 static unsigned char s_511[LENGTH_511];
00045 static unsigned char s_63[LENGTH_2ND_63];
00046
00047 inline static int wrap (int index){ return index & (SRSIZE - 1); }
00048 inline static int incr (int index){ return wrap (index + 1); }
00049 inline static int decr (int index){ return wrap (index - 1); }
00050
00051 public:
00052
00053
00054 atsci_fs_correlator_naive ();
00055 ~atsci_fs_correlator_naive ();
00056
00057
00058 virtual void reset ();
00059 void filter (float input_sample, float *output_sample, float *output_tag);
00060
00061
00062
00064 int delay () const;
00065
00066 };
00067
00068
00069 #endif