summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2015-10-07 13:32:51 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2015-10-07 13:32:51 -0700
commitb1883cb00cdb7c9d9d24cd48bf3127ff4aa547ae (patch)
tree4cb31299c63f7f7160fe1b68af9917f72bb5b996
parent05a4ceef3ecdd7c18ab5b7838b5fdd1417378748 (diff)
parent13f92e3e953f17735e1ff4d65c00ca2621fd6d99 (diff)
Merge remote-tracking branch 'jdemel/fec-ber-error-getter'
-rw-r--r--gr-fec/include/gnuradio/fec/ber_bf.h5
-rw-r--r--gr-fec/lib/ber_bf_impl.cc3
-rw-r--r--gr-fec/lib/ber_bf_impl.h6
3 files changed, 11 insertions, 3 deletions
diff --git a/gr-fec/include/gnuradio/fec/ber_bf.h b/gr-fec/include/gnuradio/fec/ber_bf.h
index 2aa01c98b0..5128d98d3e 100644
--- a/gr-fec/include/gnuradio/fec/ber_bf.h
+++ b/gr-fec/include/gnuradio/fec/ber_bf.h
@@ -67,6 +67,11 @@ namespace gr {
typedef boost::shared_ptr<ber_bf> sptr;
/*!
+ * Get total number of errors counter value.
+ */
+ virtual long total_errors() = 0;
+
+ /*!
* Calculate the BER between two streams of data.
*
* \param test_mode false for normal streaming mode (default);
diff --git a/gr-fec/lib/ber_bf_impl.cc b/gr-fec/lib/ber_bf_impl.cc
index 6e3dc85cab..5fd3ef049c 100644
--- a/gr-fec/lib/ber_bf_impl.cc
+++ b/gr-fec/lib/ber_bf_impl.cc
@@ -96,7 +96,8 @@ namespace gr {
% d_total_errors % (d_total * 8) % outbuffer[0]);
return 1;
}
- else if(calculate_log_ber() < d_ber_limit){
+ // check for total_errors to prevent early shutdown at high SNR simulations
+ else if(calculate_log_ber() < d_ber_limit && d_total_errors > 0){
GR_LOG_INFO(d_logger, " Min. BER limit reached");
outbuffer[0] = d_ber_limit;
d_total_errors = d_berminerrors + 1;
diff --git a/gr-fec/lib/ber_bf_impl.h b/gr-fec/lib/ber_bf_impl.h
index 15c747f659..75724a4281 100644
--- a/gr-fec/lib/ber_bf_impl.h
+++ b/gr-fec/lib/ber_bf_impl.h
@@ -31,8 +31,8 @@ namespace gr {
class FEC_API ber_bf_impl : public ber_bf
{
private:
- int d_total_errors;
- int d_total;
+ long d_total_errors;
+ long d_total;
bool d_test_mode;
int d_berminerrors;
float d_ber_limit;
@@ -48,6 +48,8 @@ namespace gr {
gr_vector_int& ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
+
+ long total_errors() {return d_total_errors;};
};
} /* namespace fec */