GNU Radio's SATNOGS Package
cw_to_symbol.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, Libre Space Foundation <http://librespacefoundation.org/>
6 *
7 * This program 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 of the License, or
10 * (at your option) any later version.
11 *
12 * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef INCLUDED_SATNOGS_CW_TO_SYMBOL_H
22#define INCLUDED_SATNOGS_CW_TO_SYMBOL_H
23
25#include <gnuradio/sync_block.h>
26
27#define MIN_WPM 5
28#define MAX_WPM 50
29
30namespace gr {
31namespace satnogs {
32
33/*!
34 * \brief The CW to Symbol block tries to translate the input signal
35 * into Morse symbols. The input signal should have been already properly
36 * filtered and processed. A possible DSP on the input signal may be the
37 * squared magnitude or the amplitude of the autocorrelation. Proper filtering
38 * that take cares possible spikes may drastically increase the performance
39 * of this block.
40 *
41 * \ingroup satnogs
42 */
43class SATNOGS_API cw_to_symbol : virtual public gr::sync_block
44{
45public:
46 typedef std::shared_ptr<cw_to_symbol> sptr;
47
48 /*!
49 * The CW to Symbol block tries to translate the received signal
50 * power time-series into Morse symbols.
51 *
52 * The input stream is the energy of the signal in the time domain.
53 * For best results, a proper moving average filter should be applied
54 * before.
55 *
56 * Upon a successful recovery of a symbol it produces an appropriate
57 * asynchronous message that can directly be used by the Morse decoder
58 * block.
59 *
60 * @param sampling_rate the sampling rate of the signal
61 * @param threshold the activation threshold
62 * @param conf_level the confidence level, for the decisions made by
63 * the decoder. Higher values, means that the decoder would be more
64 * conservative, whereas lower may help in noisy environments but may
65 * trigger false alarms too, especially for the case of short pauses
66 * symbols
67 *
68 * @param wpm Morse code Words per Minute
69 *
70 * @param hysteresis this value represents the hysteresis of a possible
71 * filter used before the CW to Symbol block. For example if there is
72 * a moving average filter with x taps, the full power of the signal
73 * will be available after x samples. The total length of samples with
74 * maximum power will be 2*x less. Because the block searches for plateaus
75 * with proper durations, this filtering hysteresis should be known.
76 * If no such a filter is used, the hysteresis value should be set to zero.
77 */
78 static cw_to_symbol::sptr make(double sampling_rate,
79 float threshold,
80 float conf_level = 0.9,
81 size_t wpm = 20,
82 size_t hysteresis = 0);
83
84 virtual void set_act_threshold(float thrld) = 0;
85};
86
87} // namespace satnogs
88} // namespace gr
89
90#endif /* INCLUDED_SATNOGS_CW_TO_SYMBOL_H */
#define SATNOGS_API
Definition: api.h:19
The CW to Symbol block tries to translate the input signal into Morse symbols. The input signal shoul...
Definition: cw_to_symbol.h:44
virtual void set_act_threshold(float thrld)=0
static cw_to_symbol::sptr make(double sampling_rate, float threshold, float conf_level=0.9, size_t wpm=20, size_t hysteresis=0)
std::shared_ptr< cw_to_symbol > sptr
Definition: cw_to_symbol.h:46
Definition: amsat_duv_decoder.h:29