summaryrefslogtreecommitdiff
path: root/gr-digital
diff options
context:
space:
mode:
authorJohnathan Corgan2012-02-14 12:32:52 -0800
committerJohnathan Corgan2012-02-14 12:34:47 -0800
commitf0a1631dad755d5abf28351f07b2bbf7773b37b8 (patch)
tree397b02568ddbab1f85646afdd06aee6fd540c99c /gr-digital
parentef1748e4efc40cc065fb5f1b40d710256dd37efa (diff)
parentdc266ca38bdc59955f8c8d8a98291f078d7f4377 (diff)
downloadgnuradio-f0a1631dad755d5abf28351f07b2bbf7773b37b8.tar.gz
gnuradio-f0a1631dad755d5abf28351f07b2bbf7773b37b8.tar.bz2
gnuradio-f0a1631dad755d5abf28351f07b2bbf7773b37b8.zip
Merge branch 'master' into safe_align
Conflicts: gnuradio-core/src/lib/filter/gr_fft_filter_ccc.cc gnuradio-core/src/lib/filter/gr_fft_filter_fff.cc
Diffstat (limited to 'gr-digital')
-rwxr-xr-xgr-digital/examples/narrowband/digital_bert_rx.py2
-rwxr-xr-xgr-digital/examples/narrowband/digital_bert_tx.py7
-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
5 files changed, 57 insertions, 17 deletions
diff --git a/gr-digital/examples/narrowband/digital_bert_rx.py b/gr-digital/examples/narrowband/digital_bert_rx.py
index 28331310d..dfed0eee7 100755
--- a/gr-digital/examples/narrowband/digital_bert_rx.py
+++ b/gr-digital/examples/narrowband/digital_bert_rx.py
@@ -113,9 +113,11 @@ class rx_psk_block(gr.top_block):
self._demodulator = self._demodulator_class(**demod_kwargs)
if(options.rx_freq is not None):
+ symbol_rate = options.bitrate / self._demodulator.bits_per_symbol()
self._source = uhd_receiver(options.args, options.bitrate,
options.samples_per_symbol,
options.rx_freq, options.rx_gain,
+ options.spec,
options.antenna, options.verbose)
options.samples_per_symbol = self._source._sps
diff --git a/gr-digital/examples/narrowband/digital_bert_tx.py b/gr-digital/examples/narrowband/digital_bert_tx.py
index 46f4f9097..f29e997af 100755
--- a/gr-digital/examples/narrowband/digital_bert_tx.py
+++ b/gr-digital/examples/narrowband/digital_bert_tx.py
@@ -67,9 +67,11 @@ class tx_psk_block(gr.top_block):
self._modulator = self._modulator_class(**mod_kwargs)
if(options.tx_freq is not None):
- self._sink = uhd_transmitter(options.args, options.bitrate,
+ symbol_rate = options.bitrate / self._modulator.bits_per_symbol()
+ self._sink = uhd_transmitter(options.args, symbol_rate,
options.samples_per_symbol,
options.tx_freq, options.tx_gain,
+ options.spec,
options.antenna, options.verbose)
options.samples_per_symbol = self._sink._sps
@@ -87,7 +89,8 @@ class tx_psk_block(gr.top_block):
verbose=options.verbose,
log=options.log)
- self.connect(self._transmitter, self._sink)
+ self.amp = gr.multiply_const_cc(options.amplitude)
+ self.connect(self._transmitter, self.amp, self._sink)
def get_options(mods):
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);
};