summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-digital/include/digital_impl_mpsk_snr_est.h22
-rw-r--r--gr-digital/include/digital_mpsk_snr_est_cc.h7
-rw-r--r--gr-digital/lib/digital_impl_mpsk_snr_est.cc15
-rw-r--r--gr-digital/lib/digital_mpsk_snr_est_cc.cc7
-rw-r--r--gr-digital/swig/digital_mpsk_snr_est_cc.i7
5 files changed, 23 insertions, 35 deletions
diff --git a/gr-digital/include/digital_impl_mpsk_snr_est.h b/gr-digital/include/digital_impl_mpsk_snr_est.h
index 67cf83ec9..a96f3e9c1 100644
--- a/gr-digital/include/digital_impl_mpsk_snr_est.h
+++ b/gr-digital/include/digital_impl_mpsk_snr_est.h
@@ -25,6 +25,13 @@
#include <digital_api.h>
#include <gr_sync_block.h>
+enum snr_est_type_t {
+ SNR_EST_SIMPLE = 0, // Simple estimator (>= 7 dB)
+ SNR_EST_SKEW, // Skewness-base est (>= 5 dB)
+ SNR_EST_M2M4, // 2nd & 4th moment est (>= 1 dB)
+ SNR_EST_SVN // SVN-based est (>= 0dB)
+};
+
/*!
* Parent class for SNR Estimators
*/
@@ -45,8 +52,7 @@ class DIGITAL_API digital_impl_mpsk_snr_est
//! Update the current registers
virtual int update(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
+ gr_vector_const_void_star &input_items);
//! Use the register values to compute a new estimate
virtual double snr();
@@ -64,8 +70,7 @@ class DIGITAL_API digital_impl_mpsk_snr_est_simple :
~digital_impl_mpsk_snr_est_simple() {}
int update(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
+ gr_vector_const_void_star &input_items);
double snr();
};
@@ -81,8 +86,7 @@ class DIGITAL_API digital_impl_mpsk_snr_est_skew :
~digital_impl_mpsk_snr_est_skew() {}
int update(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
+ gr_vector_const_void_star &input_items);
double snr();
};
@@ -98,8 +102,7 @@ class DIGITAL_API digital_impl_mpsk_snr_est_m2m4 :
~digital_impl_mpsk_snr_est_m2m4() {}
int update(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
+ gr_vector_const_void_star &input_items);
double snr();
};
@@ -115,8 +118,7 @@ class DIGITAL_API digital_impl_mpsk_snr_est_svn :
~digital_impl_mpsk_snr_est_svn() {}
int update(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
+ gr_vector_const_void_star &input_items);
double snr();
};
diff --git a/gr-digital/include/digital_mpsk_snr_est_cc.h b/gr-digital/include/digital_mpsk_snr_est_cc.h
index 84d6380a9..126b5f8c9 100644
--- a/gr-digital/include/digital_mpsk_snr_est_cc.h
+++ b/gr-digital/include/digital_mpsk_snr_est_cc.h
@@ -29,13 +29,6 @@
class digital_mpsk_snr_est_cc;
typedef boost::shared_ptr<digital_mpsk_snr_est_cc> digital_mpsk_snr_est_cc_sptr;
-enum snr_est_type_t {
- SNR_EST_SIMPLE = 0, // Simple estimator (>= 7 dB)
- SNR_EST_SKEW, // Skewness-base est (>= 5 dB)
- SNR_EST_M2M4, // 2nd & 4th moment est (>= 3 dB)
- SNR_EST_SVN // SVN-based est (>= 0dB)
-};
-
DIGITAL_API digital_mpsk_snr_est_cc_sptr
digital_make_mpsk_snr_est_cc(snr_est_type_t type, double alpha);
diff --git a/gr-digital/lib/digital_impl_mpsk_snr_est.cc b/gr-digital/lib/digital_impl_mpsk_snr_est.cc
index aa0d4ffb9..8adc6ffed 100644
--- a/gr-digital/lib/digital_impl_mpsk_snr_est.cc
+++ b/gr-digital/lib/digital_impl_mpsk_snr_est.cc
@@ -50,8 +50,7 @@ digital_impl_mpsk_snr_est::alpha() const
int
digital_impl_mpsk_snr_est::update(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+ gr_vector_const_void_star &input_items)
{
throw std::runtime_error("digital_impl_mpsk_snr_est: Unimplemented");
}
@@ -77,8 +76,7 @@ digital_impl_mpsk_snr_est_simple::digital_impl_mpsk_snr_est_simple(
int
digital_impl_mpsk_snr_est_simple::update(
int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+ gr_vector_const_void_star &input_items)
{
const gr_complex *in = (const gr_complex *) input_items[0];
@@ -117,8 +115,7 @@ digital_impl_mpsk_snr_est_skew::digital_impl_mpsk_snr_est_skew(
int
digital_impl_mpsk_snr_est_skew::update(
int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+ gr_vector_const_void_star &input_items)
{
const gr_complex *in = (const gr_complex *) input_items[0];
@@ -164,8 +161,7 @@ digital_impl_mpsk_snr_est_m2m4::digital_impl_mpsk_snr_est_m2m4(
int
digital_impl_mpsk_snr_est_m2m4::update(
int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+ gr_vector_const_void_star &input_items)
{
const gr_complex *in = (const gr_complex *) input_items[0];
@@ -202,8 +198,7 @@ digital_impl_mpsk_snr_est_svn::digital_impl_mpsk_snr_est_svn(
int
digital_impl_mpsk_snr_est_svn::update(
int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+ gr_vector_const_void_star &input_items)
{
const gr_complex *in = (const gr_complex *) input_items[0];
diff --git a/gr-digital/lib/digital_mpsk_snr_est_cc.cc b/gr-digital/lib/digital_mpsk_snr_est_cc.cc
index 0830b4a4d..7d75dbb8b 100644
--- a/gr-digital/lib/digital_mpsk_snr_est_cc.cc
+++ b/gr-digital/lib/digital_mpsk_snr_est_cc.cc
@@ -63,7 +63,12 @@ digital_mpsk_snr_est_cc::work(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
- return d_snr_est->update(noutput_items, input_items, output_items);
+ // This is a pass-through block; copy input to output
+ memcpy(output_items[0], input_items[0],
+ noutput_items * sizeof(gr_complex));
+
+ // Update the SNR estimate registers from the current inputs
+ return d_snr_est->update(noutput_items, input_items);
}
double
diff --git a/gr-digital/swig/digital_mpsk_snr_est_cc.i b/gr-digital/swig/digital_mpsk_snr_est_cc.i
index cb61e9482..42114f372 100644
--- a/gr-digital/swig/digital_mpsk_snr_est_cc.i
+++ b/gr-digital/swig/digital_mpsk_snr_est_cc.i
@@ -22,13 +22,6 @@
GR_SWIG_BLOCK_MAGIC(digital,mpsk_snr_est_cc);
-enum snr_est_type_t {
- SNR_EST_SIMPLE = 0, // Simple estimator (>= 7 dB)
- SNR_EST_SKEW, // Skewness-base est (>= 5 dB)
- SNR_EST_M2M4, // 2nd & 4th moment est (>= 3 dB)
- SNR_EST_SVN // SVN-based est (>= 0dB)
-};
-
digital_mpsk_snr_est_cc_sptr
digital_make_mpsk_snr_est_cc(snr_est_type_t type, double alpha);