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 <gnuradio/block.h>
27
28namespace gr {
29namespace 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 */
38class SATNOGS_API morse_debug_source : virtual public gr::block
39{
40public:
41 typedef std::shared_ptr<morse_debug_source> sptr;
42
43 /*!
44 * \brief A Morse debug source block that produces messages corresponding
45 * to Morse symbols, based on the given debug_seq string.
46 * This block can also inject random errors, based on a Bernoulli
47 * distribution.
48 *
49 * @param wpm words per minute
50 * @param debug_seq A string containing the debug sentence
51 * @param inject_errors if set the debug source block will produce
52 * errors that follow a Bernoulli distribution
53 * @param error_prob the probability p of error for the Bernulli distribution
54 * @param seq_pause_ms pause in milliseconds between concecutive debug
55 * sequences. For simplicity the pause duration will be scaled to multiple
56 * dot durations.
57 */
58 static sptr 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 */
#define SATNOGS_API
Definition: api.h:19
Definition: amsat_duv_decoder.h:29