GNU Radio's LORA_SDR Package
modulate_impl.h
Go to the documentation of this file.
1 #ifndef INCLUDED_LORA_MODULATE_IMPL_H
2 #define INCLUDED_LORA_MODULATE_IMPL_H
3 
4 #include <lora_sdr/modulate.h>
5 #include <gnuradio/io_signature.h>
6 #include <iostream>
7 #include <fstream>
8 
9 #include <lora_sdr/utilities.h>
10 
11 // #define GR_LORA_PRINT_INFO
12 
13 namespace gr {
14  namespace lora_sdr {
15 
16  class modulate_impl : public modulate
17  {
18  private:
19  uint8_t m_sf; ///< Transmission spreading factor
20  uint32_t m_samp_rate; ///< Transmission sampling rate
21  uint32_t m_bw; ///< Transmission bandwidth (Works only for samp_rate=bw)
22  uint32_t m_number_of_bins; ///< number of bin per loar symbol
23  uint32_t m_samples_per_symbol; ///< samples per symbols(Works only for 2^sf)
24  std::vector<uint16_t> m_sync_words; ///< sync words (network id)
25 
26  int m_os_factor; ///< ovesampling factor based on sampling rate and bandwidth
27 
28  int m_inter_frame_padding; ///< length in samples of zero append to each frame
29 
30  int m_frame_len;///< leng of the frame in number of items
31 
32  std::vector<gr_complex> m_upchirp; ///< reference upchirp
33  std::vector<gr_complex> m_downchirp; ///< reference downchirp
34 
35  uint n_up; ///< number of upchirps in the preamble
36  int32_t symb_cnt; ///< counter of the number of lora symbols sent
37  uint32_t preamb_symb_cnt; ///< counter of the number of preamble symbols output
38  uint32_t padd_cnt; ///< counter of the number of null symbols output after each frame
39  uint64_t frame_cnt; ///< counter of the number of frame sent
40 
41 
42  public:
43  modulate_impl(uint8_t sf, uint32_t samp_rate, uint32_t bw, std::vector<uint16_t> sync_words);
45 
46  void set_sf(uint8_t sf);
47 
48  // Where all the action really happens
49  void forecast (int noutput_items, gr_vector_int &ninput_items_required);
50 
51  int general_work(int noutput_items,
52  gr_vector_int &ninput_items,
53  gr_vector_const_void_star &input_items,
54  gr_vector_void_star &output_items);
55  };
56 
57  } // namespace lora
58 } // namespace gr
59 
60 #endif /* INCLUDED_LORA_MODULATE_IMPL_H */
Definition: modulate_impl.h:16
Definition: add_crc.h:28
modulate_impl(uint8_t sf, uint32_t samp_rate, uint32_t bw, std::vector< uint16_t > sync_words)
void forecast(int noutput_items, gr_vector_int &ninput_items_required)
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
<+description of block+>
Definition: modulate.h:36