23 #ifndef INCLUDED_GR_SIMPLE_CORRELATOR_H
24 #define INCLUDED_GR_SIMPLE_CORRELATOR_H
43 static const int OVERSAMPLE = 8;
44 enum state_t { ST_LOOKING, ST_UNDER_THRESHOLD, ST_LOCKED };
46 int d_payload_bytesize;
49 unsigned int d_transition_osi;
50 unsigned int d_center_osi;
51 unsigned long long int d_shift_reg[OVERSAMPLE];
53 unsigned char *d_bitbuf;
54 unsigned char *d_pktbuf;
57 static const int AVG_PERIOD = 512;
59 float d_avgbuf[AVG_PERIOD];
63 #ifdef DEBUG_SIMPLE_CORRELATOR
71 inline int slice (
float x)
73 return x >= d_avg ? 1 : 0;
76 void update_avg(
float x);
79 void enter_under_threshold ();
80 void enter_looking ();
82 static int add_index (
int a,
int b)
87 assert (t >= 0 && t < OVERSAMPLE);
91 static int sub_index (
int a,
int b)
96 assert (t >= 0 && t < OVERSAMPLE);
105 gr_vector_int &ninput_items,
106 gr_vector_const_void_star &input_items,
107 gr_vector_void_star &output_items);
Definition: gr_block.h:37
shared_ptr documentation stub
Definition: shared_ptr_docstub.h:15
#define GR_CORE_API
Definition: gr_core_api.h:30
virtual int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
compute output items from input items
GR_CORE_API gr_simple_correlator_sptr gr_make_simple_correlator(int payload_bytesize)
inverse of gr_simple_framer (more or less)
Definition: gr_simple_correlator.h:41