summaryrefslogtreecommitdiff
path: root/gr-digital
diff options
context:
space:
mode:
authorTom Rondeau2012-01-15 18:36:17 -0500
committerTom Rondeau2012-01-15 18:36:17 -0500
commit53407a4e5bea98ce4f2566968acb577ac0700dfc (patch)
tree03419424331123a1d348799f176fc791032808e4 /gr-digital
parentcc0949bc08555163afdfb2062ec099f67136c970 (diff)
downloadgnuradio-53407a4e5bea98ce4f2566968acb577ac0700dfc.tar.gz
gnuradio-53407a4e5bea98ce4f2566968acb577ac0700dfc.tar.bz2
gnuradio-53407a4e5bea98ce4f2566968acb577ac0700dfc.zip
digital: added get/set functions to mpsk_receiver_cc for theta (phase offset), omega relative limit, and modulation order.
Diffstat (limited to 'gr-digital')
-rw-r--r--gr-digital/include/digital_mpsk_receiver_cc.h43
-rw-r--r--gr-digital/lib/digital_mpsk_receiver_cc.cc17
-rw-r--r--gr-digital/swig/digital_mpsk_receiver_cc.i5
3 files changed, 50 insertions, 15 deletions
diff --git a/gr-digital/include/digital_mpsk_receiver_cc.h b/gr-digital/include/digital_mpsk_receiver_cc.h
index e70495bfa..02cea8d25 100644
--- a/gr-digital/include/digital_mpsk_receiver_cc.h
+++ b/gr-digital/include/digital_mpsk_receiver_cc.h
@@ -91,23 +91,37 @@ class DIGITAL_API digital_mpsk_receiver_cc : public gr_block, public gri_control
gr_vector_void_star &output_items);
- // Member functions related to the symbol tracking portion of the receiver
- //! (M&M) Returns current value of mu
- float mu() const { return d_mu;}
+ //! Returns the modulation order (M) currently set
+ float modulation_order() const { return d_M; }
- //! (M&M) Returns current value of omega
- float omega() const { return d_omega;}
+ //! Returns current value of theta
+ float theta() const { return d_theta; }
- //! (M&M) Returns mu gain factor
- float gain_mu() const { return d_gain_mu;}
+ //! Returns current value of mu
+ float mu() const { return d_mu; }
- //! (M&M) Returns omega gain factor
- float gain_omega() const { return d_gain_omega;}
+ //! Returns current value of omega
+ float omega() const { return d_omega; }
- //! (M&M) Sets value of mu
+ //! Returns mu gain factor
+ float gain_mu() const { return d_gain_mu; }
+
+ //! Returns omega gain factor
+ float gain_omega() const { return d_gain_omega; }
+
+ //! Returns the relative omega limit
+ float gain_omega_rel() const {return d_omega_rel; }
+
+ //! Sets the modulation order (M) currently
+ void set_modulation_order(unsigned int M);
+
+ //! Sets value of theta
+ void set_theta(float theta) { d_theta = theta; }
+
+ //! Sets value of mu
void set_mu (float mu) { d_mu = mu; }
- //! (M&M) Sets value of omega and its min and max values
+ //! Sets value of omega and its min and max values
void set_omega (float omega) {
d_omega = omega;
d_min_omega = omega*(1.0 - d_omega_rel);
@@ -115,12 +129,15 @@ class DIGITAL_API digital_mpsk_receiver_cc : public gr_block, public gri_control
d_omega_mid = 0.5*(d_min_omega+d_max_omega);
}
- //! (M&M) Sets value for mu gain factor
+ //! Sets value for mu gain factor
void set_gain_mu (float gain_mu) { d_gain_mu = gain_mu; }
- //! (M&M) Sets value for omega gain factor
+ //! Sets value for omega gain factor
void set_gain_omega (float gain_omega) { d_gain_omega = gain_omega; }
+ //! Sets the relative omega limit and resets omega min/max values
+ void set_gain_omega_rel(float omega_rel);
+
protected:
/*!
diff --git a/gr-digital/lib/digital_mpsk_receiver_cc.cc b/gr-digital/lib/digital_mpsk_receiver_cc.cc
index 363b86c9f..6d2bab8a4 100644
--- a/gr-digital/lib/digital_mpsk_receiver_cc.cc
+++ b/gr-digital/lib/digital_mpsk_receiver_cc.cc
@@ -85,7 +85,18 @@ digital_mpsk_receiver_cc::digital_mpsk_receiver_cc (unsigned int M, float theta,
// zero double length delay line.
for (unsigned int i = 0; i < 2 * DLLEN; i++)
d_dl[i] = gr_complex(0.0,0.0);
+
+ set_modulation_order(d_M);
+}
+
+digital_mpsk_receiver_cc::~digital_mpsk_receiver_cc ()
+{
+ delete d_interp;
+}
+void
+digital_mpsk_receiver_cc::set_modulation_order(unsigned int M)
+{
// build the constellation vector from M
make_constellation();
@@ -108,9 +119,11 @@ digital_mpsk_receiver_cc::digital_mpsk_receiver_cc (unsigned int M, float theta,
}
}
-digital_mpsk_receiver_cc::~digital_mpsk_receiver_cc ()
+void
+digital_mpsk_receiver_cc::set_gain_omega_rel(float omega_rel)
{
- delete d_interp;
+ d_omega_rel = omega_rel;
+ set_omega(d_omega);
}
void
diff --git a/gr-digital/swig/digital_mpsk_receiver_cc.i b/gr-digital/swig/digital_mpsk_receiver_cc.i
index b51411f6f..2338a1854 100644
--- a/gr-digital/swig/digital_mpsk_receiver_cc.i
+++ b/gr-digital/swig/digital_mpsk_receiver_cc.i
@@ -37,16 +37,21 @@ class digital_mpsk_receiver_cc : public gr_block, public gri_control_loop
float mu, float gain_mu,
float omega, float gain_omega, float omega_rel);
public:
+ float modulation_order() const { return d_M; }
float mu() const { return d_mu;}
float omega() const { return d_omega;}
float gain_mu() const { return d_gain_mu;}
float gain_omega() const { return d_gain_omega;}
+ float gain_omega_rel() const {return d_omega_rel; }
+ void set_modulation_order(unsigned int M);
void set_mu (float mu) { d_mu = mu; }
void set_omega (float omega) {
d_omega = omega;
d_min_omega = omega*(1.0 - d_omega_rel);
d_max_omega = omega*(1.0 + d_omega_rel);
}
+ void set_theta(float theta) { d_theta = theta; }
void set_gain_mu (float gain_mu) { d_gain_mu = gain_mu; }
void set_gain_omega (float gain_omega) { d_gain_omega = gain_omega; }
+ void set_gain_omega_rel(float omega_rel);
};