Statistics
| Branch: | Tag: | Revision:

root / gnuradio-core / src / lib / general / gr_correlate_access_code_bb.i @ 9967e2e7

History | View | Annotate | Download (2.2 kB)

1 5d69a524 jcorgan
/* -*- c++ -*- */
2 5d69a524 jcorgan
/*
3 5d69a524 jcorgan
 * Copyright 2006 Free Software Foundation, Inc.
4 5d69a524 jcorgan
 * 
5 5d69a524 jcorgan
 * This file is part of GNU Radio
6 5d69a524 jcorgan
 * 
7 5d69a524 jcorgan
 * GNU Radio is free software; you can redistribute it and/or modify
8 5d69a524 jcorgan
 * it under the terms of the GNU General Public License as published by
9 937b719d eb
 * the Free Software Foundation; either version 3, or (at your option)
10 5d69a524 jcorgan
 * any later version.
11 5d69a524 jcorgan
 * 
12 5d69a524 jcorgan
 * GNU Radio is distributed in the hope that it will be useful,
13 5d69a524 jcorgan
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 5d69a524 jcorgan
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 5d69a524 jcorgan
 * GNU General Public License for more details.
16 5d69a524 jcorgan
 * 
17 5d69a524 jcorgan
 * You should have received a copy of the GNU General Public License
18 5d69a524 jcorgan
 * along with GNU Radio; see the file COPYING.  If not, write to
19 86f5c924 eb
 * the Free Software Foundation, Inc., 51 Franklin Street,
20 86f5c924 eb
 * Boston, MA 02110-1301, USA.
21 5d69a524 jcorgan
 */
22 5d69a524 jcorgan
23 5d69a524 jcorgan
GR_SWIG_BLOCK_MAGIC(gr,correlate_access_code_bb);
24 5d69a524 jcorgan
25 5d69a524 jcorgan
/*!
26 5d69a524 jcorgan
 * \param access_code is represented with 1 byte per bit, e.g., "010101010111000100"
27 5d69a524 jcorgan
 * \param threshold maximum number of bits that may be wrong
28 5d69a524 jcorgan
 */
29 5d69a524 jcorgan
gr_correlate_access_code_bb_sptr 
30 5d69a524 jcorgan
gr_make_correlate_access_code_bb (const std::string &access_code, int threshold) 
31 5d69a524 jcorgan
  throw(std::out_of_range);
32 5d69a524 jcorgan
33 5d69a524 jcorgan
/*!
34 5d69a524 jcorgan
 * \brief Examine input for specified access code, one bit at a time.
35 5d69a524 jcorgan
 * \ingroup block
36 5d69a524 jcorgan
 *
37 5d69a524 jcorgan
 * input:  stream of bits, 1 bit per input byte (data in LSB)
38 5d69a524 jcorgan
 * output: stream of bits, 2 bits per output byte (data in LSB, flag in next higher bit)
39 5d69a524 jcorgan
 *
40 5d69a524 jcorgan
 * Each output byte contains two valid bits, the data bit, and the
41 5d69a524 jcorgan
 * flag bit.  The LSB (bit 0) is the data bit, and is the original
42 5d69a524 jcorgan
 * input data, delayed 64 bits.  Bit 1 is the
43 5d69a524 jcorgan
 * flag bit and is 1 if the corresponding data bit is the first data
44 5d69a524 jcorgan
 * bit following the access code. Otherwise the flag bit is 0.
45 5d69a524 jcorgan
 */
46 5d69a524 jcorgan
class gr_correlate_access_code_bb : public gr_sync_block
47 5d69a524 jcorgan
{
48 5d69a524 jcorgan
  friend gr_correlate_access_code_bb_sptr 
49 5d69a524 jcorgan
  gr_make_correlate_access_code_bb (const std::string &access_code, int threshold);
50 5d69a524 jcorgan
 protected:
51 5d69a524 jcorgan
  gr_correlate_access_code_bb(const std::string &access_code, int threshold);
52 5d69a524 jcorgan
53 5d69a524 jcorgan
 public:
54 5d69a524 jcorgan
  ~gr_correlate_access_code_bb();
55 5d69a524 jcorgan
56 5d69a524 jcorgan
  /*!
57 5d69a524 jcorgan
   * \param access_code is represented with 1 byte per bit, e.g., "010101010111000100"
58 5d69a524 jcorgan
   */
59 5d69a524 jcorgan
  bool set_access_code (const std::string &access_code);
60 5d69a524 jcorgan
};