GNU Radio 3.6.4.1 C++ API
threshold_ff.h
Go to the documentation of this file.
1
/* -*- c++ -*- */
2
/*
3
* Copyright 2004,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_THRESHOLD_FF_H
24
#define INCLUDED_GR_THRESHOLD_FF_H
25
26
#include <
blocks/api.h
>
27
#include <
gr_sync_block.h
>
28
29
namespace
gr {
30
namespace
blocks {
31
32
/*!
33
* \brief Output a 1 or zero based on a threshold value.
34
* \ingroup misc_blk
35
*
36
* Test the incoming signal against a threshold. If the signal
37
* excedes the \p hi value, it will output a 1 until the signal
38
* falls below the \p lo value.
39
*/
40
class
BLOCKS_API
threshold_ff
:
virtual
public
gr_sync_block
41
{
42
public
:
43
// gr::blocks::threshold_ff::sptr
44
typedef
boost::shared_ptr<threshold_ff>
sptr
;
45
46
/* \brief Create a threadshold block.
47
* \param lo Threshold input signal needs to drop below to
48
* change state to 0.
49
* \param hi Threshold input signal needs to rise above to
50
* change state to 1.
51
* \param initial_state Initial state of the block (0 or 1).
52
*/
53
static
sptr
make(
float
lo,
float
hi,
float
initial_state=0);
54
55
virtual
float
lo ()
const
= 0;
56
virtual
void
set_lo (
float
lo) = 0;
57
virtual
float
hi ()
const
= 0;
58
virtual
void
set_hi (
float
hi) = 0;
59
virtual
float
last_state ()
const
= 0;
60
virtual
void
set_last_state (
float
last_state) = 0;
61
};
62
63
}
/* namespace blocks */
64
}
/* namespace gr */
65
66
#endif
/* INCLUDED_GR_THRESHOLD_FF_H */
gr-blocks
include
blocks
threshold_ff.h
Generated on Thu Mar 21 2013 15:59:34 for GNU Radio 3.6.4.1 C++ API by
1.8.1.2