GNU Radio Manual and C++ API Reference  3.7.9.2
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
plateau_detector_fb.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2012-2013 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 
24 #ifndef INCLUDED_BLOCKS_PLATEAU_DETECTOR_FB_H
25 #define INCLUDED_BLOCKS_PLATEAU_DETECTOR_FB_H
26 
27 #include <gnuradio/blocks/api.h>
28 #include <gnuradio/sync_block.h>
29 
30 namespace gr {
31  namespace blocks {
32 
33  /*!
34  * \brief Detects a plateau and marks the middle.
35  * \ingroup peak_detectors_blk
36  *
37  * \details
38  * Detect a plateau of a-priori known height. Input is a stream of floats,
39  * the output is a stream of bytes. Whenever a plateau is detected, the
40  * middle of that plateau is marked with a '1' on the output stream (all
41  * other samples are left at zero).
42  *
43  * You can use this in a Schmidl & Cox synchronisation algorithm to interpret
44  * the output of the normalized correlator. Just pass the length of the cyclic
45  * prefix (in samples) as the max_len parameter).
46  *
47  * Unlike the peak detectors, you must the now the absolute height of the plateau.
48  * Whenever the amplitude exceeds the given threshold, it starts assuming the
49  * presence of a plateau.
50  *
51  * An implicit hysteresis is provided by the fact that after detecting one plateau,
52  * it waits at least max_len samples before the next plateau can be detected.
53  */
54  class BLOCKS_API plateau_detector_fb : virtual public block
55  {
56  public:
57  typedef boost::shared_ptr<plateau_detector_fb> sptr;
58 
59  /*!
60  * \param max_len Maximum length of the plateau
61  * \param threshold Anything above this value is considered a plateau
62  */
63  static sptr make(int max_len, float threshold=0.9);
64  };
65 
66  } // namespace blocks
67 } // namespace gr
68 
69 #endif /* INCLUDED_BLOCKS_PLATEAU_DETECTOR_FB_H */
70 
Include this header to use the message passing features.
Definition: logger.h:131
boost::shared_ptr< plateau_detector_fb > sptr
Definition: plateau_detector_fb.h:57
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:30
Detects a plateau and marks the middle.
Definition: plateau_detector_fb.h:54
The abstract base class for all 'terminal' processing blocks.A signal processing flow is constructed ...
Definition: block.h:60