GNU Radio's SATNOGS Package
morse_debug_source.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * gr-satnogs: SatNOGS GNU Radio Out-Of-Tree Module
4  *
5  * Copyright (C) 2016,2017
6  * Libre Space Foundation <http://librespacefoundation.org/>
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef INCLUDED_SATNOGS_MORSE_DEBUG_SOURCE_H
23 #define INCLUDED_SATNOGS_MORSE_DEBUG_SOURCE_H
24 
25 #include <satnogs/api.h>
26 #include <gnuradio/block.h>
27 
28 namespace gr {
29 namespace satnogs {
30 
31 /*!
32  * \brief A Morse debug source block that supports injection of random
33  * errors based on a Bernulli distribution with probability p.
34  *
35  * \ingroup satnogs
36  *
37  */
38 class SATNOGS_API morse_debug_source : virtual public gr::block {
39 public:
40  typedef boost::shared_ptr<morse_debug_source> sptr;
41 
42  /*!
43  * \brief A Morse debug source block that produces messages corresponding
44  * to Morse symbols, based on the given debug_seq string.
45  * This block can also inject random errors, based on a Bernoulli
46  * distribution.
47  *
48  * @param wpm words per minute
49  * @param debug_seq A string containing the debug sentence
50  * @param inject_errors if set the debug source block will produce
51  * errors that follow a Bernoulli distribution
52  * @param error_prob the probability p of error for the Bernulli distribution
53  * @param seq_pause_ms pause in milliseconds between concecutive debug
54  * sequences. For simplicity the pause duration will be scaled to multiple
55  * dot durations.
56  */
57  static sptr
58  make(const size_t wpm,
59  const std::string &debug_seq,
60  bool inject_errors = false,
61  float error_prob = 0.1,
62  size_t seq_pause_ms = 1000);
63 };
64 
65 } // namespace satnogs
66 } // namespace gr
67 
68 #endif /* INCLUDED_SATNOGS_MORSE_DEBUG_SOURCE_H */
69 
Definition: amsat_duv_decoder.h:29
#define SATNOGS_API
Definition: api.h:30