GNU Radio's SATNOGS Package
ber_calculator_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) 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 #ifndef LIB_BER_CALCULATOR_IMPL_H_
21 #define LIB_BER_CALCULATOR_IMPL_H_
22 
23 #include <satnogs/ber_calculator.h>
24 #include <deque>
25 #include <cstdint>
26 
27 namespace gr {
28 namespace satnogs {
29 
31 public:
32  ber_calculator_impl(size_t frame_size = 64, size_t nframes = 0,
33  size_t skip = 10);
34 
36 
37  bool
38  stop();
39 
40 private:
41  const size_t d_frame_size;
42  const size_t d_nframes;
43  const size_t d_skip;
44  uint64_t d_cnt;
45  uint64_t d_inval_cnt;
46  uint64_t d_last_ack;
47  uint64_t d_dropped;
48  uint64_t d_received;
49 
50  void
51  create_pdu();
52 
53  void
54  received_pdu(pmt::pmt_t msg);
55 
56  double
57  fer();
58 
59  double
60  ber();
61 
62  void
63  print_stats();
64 };
65 
66 } /* namespace satnogs */
67 } /* namespace gr */
68 
69 #endif /* LIB_BER_CALCULATOR_IMPL_H_ */
ber_calculator_impl(size_t frame_size=64, size_t nframes=0, size_t skip=10)
Definition: ber_calculator_impl.h:30
Definition: amsat_duv_decoder.h:29
A block that calculates the BER of a packet passed system using the FER (Frame Error Rate) ...
Definition: ber_calculator.h:37