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 <fstream>
5 #include <gnuradio/io_signature.h>
6 #include <iostream>
7 #include <lora_sdr/modulate.h>
8 
9 #include "helpers.h"
10 
11 namespace gr {
12 namespace lora_sdr {
13 
14 class modulate_impl : public modulate {
15 private:
16  /**
17  * @briefTransmission spreading factor
18  *
19  */
20  uint8_t m_sf;
21  /**
22  * @brief Transmission sampling rate
23  *
24  */
25  uint32_t m_samp_rate;
26 
27  /**
28  * @brief Transmission bandwidth (Works only for samp_rate=bw)
29  *
30  */
31  uint32_t m_bw;
32 
33  /**
34  * @brief number of bin per loar symbol
35  *
36  */
37  uint32_t m_number_of_bins;
38 
39  /**
40  * @brief lora symbols per second
41  *
42  */
43  double m_symbols_per_second;
44 
45  /**
46  * @brief samples per symbols(Works only for 2^sf)
47  *
48  */
49  uint32_t m_samples_per_symbol;
50 
51  /**
52  * @brief sync words (network id)
53  *
54  */
55  std::vector<uint16_t> m_sync_words;
56 
57  /**
58  * @brief length in samples of zero append to each frame
59  *
60  */
61  int m_inter_frame_padding;
62 
63  /**
64  * @brief length of the frame in number of items
65  *
66  */
67  int m_frame_len;
68 
69  /**
70  * @briefreference upchirp
71  *
72  */
73  std::vector<gr_complex> m_upchirp;
74 
75  /**
76  * @brief reference downchirp
77  *
78  */
79  std::vector<gr_complex> m_downchirp;
80 
81  /**
82  * @brief number of upchirps in the preamble
83  *
84  */
85  uint n_up;
86 
87  /**
88  * @brief counter of the number of lora symbols sent
89  *
90  */
91  uint32_t symb_cnt;
92 
93  /**
94  * @brief counter of the number of preamble symbols output
95  *
96  */
97  uint32_t preamb_symb_cnt;
98 
99  /**
100  * @brief counter of the number of null symbols output after each frame
101  *
102  */
103  uint32_t padd_cnt;
104 
105 public:
106  /**
107  * @brief Construct a new modulate impl object
108  *
109  * @param sf
110  * @param samp_rate
111  * @param bw
112  * @param sync_words
113  * @param create_zeros
114  */
115  modulate_impl(uint8_t sf, uint32_t samp_rate, uint32_t bw,
116  std::vector<uint16_t> sync_words, bool create_zeros);
117 
118  /**
119  * @brief Destroy the modulate impl object
120  *
121  */
122  ~modulate_impl();
123 
124  /**
125  * @brief
126  *
127  * @param noutput_items
128  * @param ninput_items_required
129  */
130  void forecast(int noutput_items, gr_vector_int &ninput_items_required);
131 
132  /**
133  * @brief
134  *
135  * @param noutput_items
136  * @param ninput_items
137  * @param input_items
138  * @param output_items
139  * @return int
140  */
141  int general_work(int noutput_items, gr_vector_int &ninput_items,
142  gr_vector_const_void_star &input_items,
143  gr_vector_void_star &output_items);
144 };
145 
146 } // namespace lora_sdr
147 } // namespace gr
148 
149 #endif /* INCLUDED_LORA_MODULATE_IMPL_H */
gr::lora_sdr::modulate_impl
Definition: modulate_impl.h:14
gr::lora_sdr::modulate_impl::forecast
void forecast(int noutput_items, gr_vector_int &ninput_items_required)
helpers.h
gr
Definition: add_crc.h:28
gr::lora_sdr::modulate_impl::general_work
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
gr::lora_sdr::modulate_impl::~modulate_impl
~modulate_impl()
Destroy the modulate impl object.
gr::lora_sdr::modulate
End block of the sending side that modulates the final to be sent data to the LoRa standard For more ...
Definition: modulate.h:37
modulate.h
gr::lora_sdr::modulate_impl::modulate_impl
modulate_impl(uint8_t sf, uint32_t samp_rate, uint32_t bw, std::vector< uint16_t > sync_words, bool create_zeros)
Construct a new modulate impl object.