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 
24 #include <satnogs/api.h>
25 #include <gnuradio/sync_block.h>
26 
27 #define MIN_WPM 5
28 #define MAX_WPM 50
29 
30 namespace gr {
31 namespace 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  */
43 class SATNOGS_API cw_to_symbol : virtual public gr::sync_block {
44 public:
45  typedef boost::shared_ptr<cw_to_symbol> sptr;
46 
47  /*!
48  * The CW to Symbol block tries to translate the received signal
49  * power time-series into Morse symbols.
50  *
51  * The input stream is the energy of the signal in the time domain.
52  * For best results, a proper moving average filter should be applied
53  * before.
54  *
55  * Upon a successful recovery of a symbol it produces an appropriate
56  * asynchronous message that can directly be used by the Morse decoder
57  * block.
58  *
59  * @param sampling_rate the sampling rate of the signal
60  * @param threshold the activation threshold
61  * @param conf_level the confidence level, for the decisions made by
62  * the decoder. Higher values, means that the decoder would be more
63  * conservative, whereas lower may help in noisy environments but may
64  * trigger false alarms too, especially for the case of short pauses
65  * symbols
66  *
67  * @param wpm Morse code Words per Minute
68  *
69  * @param hysteresis this value represents the hysteresis of a possible
70  * filter used before the CW to Symbol block. For example if there is
71  * a moving average filter with x taps, the full power of the signal
72  * will be available after x samples. The total length of samples with
73  * maximum power will be 2*x less. Because the block searches for plateaus
74  * with proper durations, this filtering hysteresis should be known.
75  * If no such a filter is used, the hysteresis value should be set to zero.
76  */
77  static cw_to_symbol::sptr
78  make(double sampling_rate, float threshold, float conf_level = 0.9,
79  size_t wpm = 20,
80  size_t hysteresis = 0);
81 
82  virtual void
83  set_act_threshold(float thrld) = 0;
84 };
85 
86 } // namespace satnogs
87 } // namespace gr
88 
89 #endif /* INCLUDED_SATNOGS_CW_TO_SYMBOL_H */
90 
The CW to Symbol block tries to translate the input signal into Morse symbols. The input signal shoul...
Definition: cw_to_symbol.h:43
boost::shared_ptr< cw_to_symbol > sptr
Definition: cw_to_symbol.h:45
Definition: amsat_duv_decoder.h:29
#define SATNOGS_API
Definition: api.h:30