GNU Radio's CDMA Package

flag_gen.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2013 <+YOU OR YOUR COMPANY+>.
4 *
5 * This is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3, or (at your option)
8 * any later version.
9 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street,
18 * Boston, MA 02110-1301, USA.
19 */
20
21
22#ifndef INCLUDED_CDMA_FLAG_GEN_H
23#define INCLUDED_CDMA_FLAG_GEN_H
24
25#include <cdma/api.h>
26#include <gnuradio/sync_block.h>
27
28 namespace gr {
29 namespace cdma {
30
31 /*!
32 * \brief This block either passes through the input stream (assumed to be zeros or ones) when its internal state is acq=1, or it outputs a stream of zeros with periodic ones (with given period) when its internal state is acq=0.
33 * \ingroup cdma
34 *
35 * \details
36 * The purpose of this block is to be used right after the timing/frequency acquisition block.
37 * The timing/frequency acquisition block outputs a stream of 0s and 1s, with 1s indicating the
38 * begining of a cdma frame.\n
39 * When the system is in acquisition mode (acq=1), the flag_gen block just passes through its
40 * input stream, which comes from the timing/frequency acquisition block.\n
41 * When the system is in tracking mode (acq=0), the timing/frequency acquisition block is
42 * not supposed to produce any meaningful output flags.
43 * In this case, the flag_gen block produces periodical flags (with given period equal
44 * to the frame length) starting from the last flag produced by the timing/frequency
45 * acquisition block, in order to provide timing information for the remaining of the system.\n
46 *
47 * For example, when period is 4 the input and output streams will look like:\n
48 * acq:------>111111000000000...\n
49 * input:---->010100000000000...\n
50 * output:-->010100010001000...\n
51 * where the first 1 in the input and output is for example due to a false acquisition.
52 */
53 class CDMA_API flag_gen : virtual public gr::sync_block
54 {
55 public:
56 typedef boost::shared_ptr<flag_gen> sptr;
57
58 /*!
59 * \brief Return a shared_ptr to a new instance of cdma::flag_gen.
60 *
61 * To avoid accidental use of raw pointers, cdma::flag_gen's
62 * constructor is in a private implementation
63 * class. cdma::flag_gen::make is the public interface for
64 * creating new instances.
65 *
66 * \param acq the mode selector. Takes values {0, 1}.
67 * \param period the period of output flags when acq=0.
68 */
69 static sptr make(int period, int acq);
70 virtual void set_acq (int acq) = 0;
71 };
72
73 } // namespace cdma
74} // namespace gr
75
76#endif /* INCLUDED_CDMA_FLAG_GEN_H */
77
api.h
CDMA_API
#define CDMA_API
Definition: api.h:30
gr::cdma::flag_gen
This block either passes through the input stream (assumed to be zeros or ones) when its internal sta...
Definition: flag_gen.h:54
gr::cdma::flag_gen::make
static sptr make(int period, int acq)
Return a shared_ptr to a new instance of cdma::flag_gen.
gr::cdma::flag_gen::set_acq
virtual void set_acq(int acq)=0
gr::cdma::flag_gen::sptr
boost::shared_ptr< flag_gen > sptr
Definition: flag_gen.h:56
gr
Definition: amp_var_est.h:30