GNU Radio 3.6.4.1 C++ API
peak_detector2_fb.h
Go to the documentation of this file.
1
/* -*- c++ -*- */
2
/*
3
* Copyright 2007,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
#ifndef INCLUDED_GR_PEAK_DETECTOR2_FB_H
24
#define INCLUDED_GR_PEAK_DETECTOR2_FB_H
25
26
#include <
blocks/api.h
>
27
#include <
gr_sync_block.h
>
28
29
namespace
gr {
30
namespace
blocks {
31
32
/*!
33
* \brief Detect the peak of a signal
34
* \ingroup level_blk
35
*
36
* If a peak is detected, this block outputs a 1, or it outputs
37
* 0's. A separate debug output may be connected, to view the
38
* internal EWMA described below.
39
*
40
* \param threshold_factor_rise The threshold factor determins
41
* when a peak is present. An EWMA average of the signal is
42
* calculated and when the value of the signal goes over
43
* threshold_factor_rise*average, we call the peak.
44
* \param look_ahead The look-ahead value is used when the
45
* threshold is found to locate the peak within this range.
46
* \param alpha The gain value of a single-pole moving average filter.
47
*/
48
class
BLOCKS_API
peak_detector2_fb
:
virtual
public
gr_sync_block
49
{
50
public
:
51
// gr::blocks::peak_detector2_fb::sptr
52
typedef
boost::shared_ptr<peak_detector2_fb>
sptr
;
53
54
static
sptr
make(
float
threshold_factor_rise=7,
55
int
look_ahead=1000,
float
alpha=0.001);
56
57
/*! \brief Set the threshold factor value for the rise time
58
* \param thr new threshold factor
59
*/
60
virtual
void
set_threshold_factor_rise(
float
thr) = 0;
61
62
/*! \brief Set the look-ahead factor
63
* \param look new look-ahead factor
64
*/
65
virtual
void
set_look_ahead(
int
look) = 0;
66
67
/*! \brief Set the running average alpha
68
* \param alpha new alpha for running average
69
*/
70
virtual
void
set_alpha(
int
alpha) = 0;
71
72
/*! \brief Get the threshold factor value for the rise time
73
* \return threshold factor
74
*/
75
virtual
float
threshold_factor_rise() = 0;
76
77
/*! \brief Get the look-ahead factor value
78
* \return look-ahead factor
79
*/
80
virtual
int
look_ahead() = 0;
81
82
/*! \brief Get the alpha value of the running average
83
* \return alpha
84
*/
85
virtual
float
alpha() = 0;
86
};
87
88
}
/* namespace blocks */
89
}
/* namespace gr */
90
91
#endif
/* INCLUDED_GR_PEAK_DETECTOR2_FB_H */
gr-blocks
include
blocks
peak_detector2_fb.h
Generated on Thu Mar 21 2013 15:59:34 for GNU Radio 3.6.4.1 C++ API by
1.8.1.2