GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
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  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 
12 #ifndef INCLUDED_BLOCKS_PLATEAU_DETECTOR_FB_H
13 #define INCLUDED_BLOCKS_PLATEAU_DETECTOR_FB_H
14 
15 #include <gnuradio/blocks/api.h>
16 #include <gnuradio/sync_block.h>
17 
18 namespace gr {
19 namespace blocks {
20 
21 /*!
22  * \brief Detects a plateau and marks the middle.
23  * \ingroup peak_detectors_blk
24  *
25  * \details
26  * Detect a plateau of a-priori known height. Input is a stream of floats,
27  * the output is a stream of bytes. Whenever a plateau is detected, the
28  * middle of that plateau is marked with a '1' on the output stream (all
29  * other samples are left at zero).
30  *
31  * You can use this in a Schmidl & Cox synchronisation algorithm to interpret
32  * the output of the normalized correlator. Just pass the length of the cyclic
33  * prefix (in samples) as the max_len parameter).
34  *
35  * Unlike the peak detectors, you must the now the absolute height of the plateau.
36  * Whenever the amplitude exceeds the given threshold, it starts assuming the
37  * presence of a plateau.
38  *
39  * An implicit hysteresis is provided by the fact that after detecting one plateau,
40  * it waits at least max_len samples before the next plateau can be detected.
41  */
42 class BLOCKS_API plateau_detector_fb : virtual public block
43 {
44 public:
45  typedef std::shared_ptr<plateau_detector_fb> sptr;
46 
47  /*!
48  * \param max_len Maximum length of the plateau
49  * \param threshold Anything above this value is considered a plateau
50  */
51  static sptr make(int max_len, float threshold = 0.9);
52 
53  virtual void set_threshold(float threshold) = 0;
54  virtual float threshold() const = 0;
55 };
56 
57 } // namespace blocks
58 } // namespace gr
59 
60 #endif /* INCLUDED_BLOCKS_PLATEAU_DETECTOR_FB_H */
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
Detects a plateau and marks the middle.
Definition: plateau_detector_fb.h:43
virtual void set_threshold(float threshold)=0
static sptr make(int max_len, float threshold=0.9)
virtual float threshold() const =0
std::shared_ptr< plateau_detector_fb > sptr
Definition: plateau_detector_fb.h:45
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29