GNU Radio's SATNOGS Package
cw_encoder_impl.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) 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_CW_ENCODER_IMPL_H
23 #define INCLUDED_SATNOGS_CW_ENCODER_IMPL_H
24 
25 #include <vector>
26 #include <string>
27 #include <satnogs/cw_encoder.h>
28 #include <satnogs/morse.h>
29 #include <gnuradio/fxpt_nco.h>
30 
31 namespace gr {
32 namespace satnogs {
33 
34 class cw_encoder_impl : public cw_encoder {
35 private:
36  const double d_samp_rate;
37  const double d_cw_freq;
38  const size_t d_wpm;
39  const size_t d_dot_samples;
40  size_t d_window_size;
41  size_t d_windows_remaining;
42  morse_symbol_t d_cw_symbol;
43  gr::fxpt_nco d_nco;
44 
45 
46 
47  std::string
48  get_cw_symbol(char c);
49 
50 public:
51  cw_encoder_impl(double samp_rate, double cw_freq, size_t wpm);
53 
54  // Where all the action really happens
55  int
56  work(int noutput_items, gr_vector_const_void_star &input_items,
57  gr_vector_void_star &output_items);
58 };
59 
60 } // namespace satnogs
61 } // namespace gr
62 
63 #endif /* INCLUDED_SATNOGS_CW_ENCODER_IMPL_H */
64 
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
CW encoder block, mainly for debugging and testing purposes. It accepts a CW word via a message sourc...
Definition: cw_encoder.h:38
Definition: amsat_duv_decoder.h:29
cw_encoder_impl(double samp_rate, double cw_freq, size_t wpm)
Definition: cw_encoder_impl.h:34
morse_symbol_t
Definition: morse.h:28