summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2016-11-15 10:47:40 -0800
committerJohnathan Corgan <johnathan@corganlabs.com>2016-11-15 10:47:40 -0800
commitcfb2c30f287b9d5de101ea68858217208417de1e (patch)
tree94d22c9c57728257ce2d0c315917292c54652416
parentc939434ff94ad543900f410634e973da48636229 (diff)
parent028b8875416812d5a3f4aac65fbbe1b7fd5331cb (diff)
Merge remote-tracking branch 'github/remove-mpsk-receiver' into next
-rw-r--r--docs/sphinx/source/digital_blocks.rst1
-rw-r--r--docs/sphinx/source/index.rst1
-rw-r--r--gr-digital/grc/digital_block_tree.xml1
-rw-r--r--gr-digital/grc/digital_mpsk_receiver_cc.xml87
-rw-r--r--gr-digital/include/gnuradio/digital/CMakeLists.txt1
-rw-r--r--gr-digital/include/gnuradio/digital/mpsk_receiver_cc.h148
-rw-r--r--gr-digital/lib/CMakeLists.txt1
-rw-r--r--gr-digital/lib/mpsk_receiver_cc_impl.cc332
-rw-r--r--gr-digital/lib/mpsk_receiver_cc_impl.h242
-rwxr-xr-xgr-digital/python/digital/qa_mpsk_receiver.py146
-rw-r--r--gr-digital/swig/digital_swig2.i3
-rwxr-xr-xgr-qtgui/apps/qt_digital.py307
-rw-r--r--gr-qtgui/apps/qt_digital_window.py161
-rw-r--r--gr-qtgui/apps/qt_digital_window.ui342
14 files changed, 0 insertions, 1773 deletions
diff --git a/docs/sphinx/source/digital_blocks.rst b/docs/sphinx/source/digital_blocks.rst
index 1dfd017069..faee4c179c 100644
--- a/docs/sphinx/source/digital_blocks.rst
+++ b/docs/sphinx/source/digital_blocks.rst
@@ -43,7 +43,6 @@ gnuradio.digital
.. autoblock:: gnuradio.digital.kurtotic_equalizer_cc
.. autoblock:: gnuradio.digital.lms_dd_equalizer_cc
.. autoblock:: gnuradio.digital.map_bb
-.. autoblock:: gnuradio.digital.mpsk_receiver_cc
.. autoblock:: gnuradio.digital.mpsk_snr_est_cc
.. autoblock:: gnuradio.digital.msk_timing_recovery_cc
.. autoblock:: gnuradio.digital.ofdm_carrier_allocator_cvc
diff --git a/docs/sphinx/source/index.rst b/docs/sphinx/source/index.rst
index 137c17a6ba..26936dfedf 100644
--- a/docs/sphinx/source/index.rst
+++ b/docs/sphinx/source/index.rst
@@ -1038,7 +1038,6 @@ Synchronizer Blocks
gnuradio.digital.corr_est_cc
gnuradio.digital.costas_loop_cc
gnuradio.digital.fll_band_edge_cc
- gnuradio.digital.mpsk_receiver_cc
gnuradio.digital.msk_timing_recovery_cc
gnuradio.analog.pll_carriertracking_cc
gnuradio.analog.pll_freqdet_cf
diff --git a/gr-digital/grc/digital_block_tree.xml b/gr-digital/grc/digital_block_tree.xml
index f11f27e5c3..88da4b7621 100644
--- a/gr-digital/grc/digital_block_tree.xml
+++ b/gr-digital/grc/digital_block_tree.xml
@@ -116,7 +116,6 @@
<block>digital_clock_recovery_mm_xx</block>
<block>digital_costas_loop_cc</block>
<block>digital_fll_band_edge_cc</block>
- <block>digital_mpsk_receiver_cc</block>
<block>digital_pfb_clock_sync_xxx</block>
<block>digital_pn_correlator_cc</block>
<block>digital_corr_est_cc</block>
diff --git a/gr-digital/grc/digital_mpsk_receiver_cc.xml b/gr-digital/grc/digital_mpsk_receiver_cc.xml
deleted file mode 100644
index 76f0ccd5ea..0000000000
--- a/gr-digital/grc/digital_mpsk_receiver_cc.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##MPSK Receiver
-###################################################
- -->
-<block>
- <name>MPSK Receiver</name>
- <key>digital_mpsk_receiver_cc</key>
- <category>[Core]/Deprecated</category>
- <import>from gnuradio import digital;import cmath</import>
- <make>digital.mpsk_receiver_cc($M, $theta, $w, $fmin, $fmax, $mu, $gain_mu, $omega, $gain_omega, $omega_relative_limit)</make>
- <callback>set_loop_bandwidth($w)</callback>
- <callback>set_mu($mu)</callback>
- <callback>set_gain_mu($gain_mu)</callback>
- <callback>set_omega($omega)</callback>
- <callback>set_gain_omega($gain_omega)</callback>
- <param>
- <name>M</name>
- <key>M</key>
- <value>4</value>
- <type>int</type>
- </param>
- <param>
- <name>Theta</name>
- <key>theta</key>
- <value>0</value>
- <type>real</type>
- </param>
- <param>
- <name>Loop Bandwidth</name>
- <key>w</key>
- <value>cmath.pi/100.0</value>
- <type>real</type>
- </param>
- <param>
- <name>Min Freq</name>
- <key>fmin</key>
- <value>-0.5</value>
- <type>real</type>
- </param>
- <param>
- <name>Max Freq</name>
- <key>fmax</key>
- <value>0.5</value>
- <type>real</type>
- </param>
- <param>
- <name>Mu</name>
- <key>mu</key>
- <value>0.25</value>
- <type>real</type>
- </param>
- <param>
- <name>Gain Mu</name>
- <key>gain_mu</key>
- <value>0.01</value>
- <type>real</type>
- </param>
- <param>
- <name>Omega</name>
- <key>omega</key>
- <value>2</value>
- <type>real</type>
- </param>
- <param>
- <name>Gain Omega</name>
- <key>gain_omega</key>
- <value>0.001</value>
- <type>real</type>
- </param>
- <param>
- <name>Omega Relative Limit</name>
- <key>omega_relative_limit</key>
- <value>0.001</value>
- <type>real</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-
-</block>
diff --git a/gr-digital/include/gnuradio/digital/CMakeLists.txt b/gr-digital/include/gnuradio/digital/CMakeLists.txt
index 64da41f71a..230b30bf39 100644
--- a/gr-digital/include/gnuradio/digital/CMakeLists.txt
+++ b/gr-digital/include/gnuradio/digital/CMakeLists.txt
@@ -72,7 +72,6 @@ install(FILES
map_bb.h
metric_type.h
modulate_vector.h
- mpsk_receiver_cc.h
mpsk_snr_est.h
mpsk_snr_est_cc.h
msk_timing_recovery_cc.h
diff --git a/gr-digital/include/gnuradio/digital/mpsk_receiver_cc.h b/gr-digital/include/gnuradio/digital/mpsk_receiver_cc.h
deleted file mode 100644
index 0cb1a8ba7b..0000000000
--- a/gr-digital/include/gnuradio/digital/mpsk_receiver_cc.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2004,2007,2011,2012 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef INCLUDED_DIGITAL_MPSK_RECEIVER_CC_H
-#define INCLUDED_DIGITAL_MPSK_RECEIVER_CC_H
-
-#include <gnuradio/digital/api.h>
-#include <gnuradio/block.h>
-#include <gnuradio/blocks/control_loop.h>
-
-namespace gr {
- namespace digital {
-
- /*!
- * \brief This block takes care of receiving M-PSK modulated
- * signals through phase, frequency, and symbol synchronization.
- * \ingroup synchronizers_blk
- * \ingroup deprecated_blk
- *
- * \details
- * It performs carrier frequency and phase locking as well as
- * symbol timing recovery. It works with (D)BPSK, (D)QPSK, and
- * (D)8PSK as tested currently. It should also work for OQPSK and
- * PI/4 DQPSK.
- *
- * The phase and frequency synchronization are based on a Costas
- * loop that finds the error of the incoming signal point compared
- * to its nearest constellation point. The frequency and phase of
- * the NCO are updated according to this error. There are
- * optimized phase error detectors for BPSK and QPSK, but 8PSK is
- * done using a brute-force computation of the constellation
- * points to find the minimum.
- *
- * The symbol synchronization is done using a modified Mueller and
- * Muller circuit from the paper:
- *
- * "G. R. Danesfahani, T. G. Jeans, "Optimisation of modified Mueller
- * and Muller algorithm," Electronics Letters, Vol. 31, no. 13, 22
- * June 1995, pp. 1032 - 1033."
- *
- * This circuit interpolates the downconverted sample (using the
- * NCO developed by the Costas loop) every mu samples, then it
- * finds the sampling error based on this and the past symbols and
- * the decision made on the samples. Like the phase error
- * detector, there are optimized decision algorithms for BPSK and
- * QPKS, but 8PSK uses another brute force computation against all
- * possible symbols. The modifications to the M&M used here reduce
- * self-noise.
- *
- */
- class DIGITAL_API mpsk_receiver_cc
- : virtual public block,
- virtual public blocks::control_loop
- {
- public:
- // gr::digital::mpsk_receiver_cc::sptr
- typedef boost::shared_ptr<mpsk_receiver_cc> sptr;
-
- /*!
- * \brief Make a M-PSK receiver block.
- *
- * \param M modulation order of the M-PSK modulation
- * \param theta any constant phase rotation from the real axis of the constellation
- * \param loop_bw Loop bandwidth to set gains of phase/freq tracking loop
- * \param fmin minimum normalized frequency value the loop can achieve
- * \param fmax maximum normalized frequency value the loop can achieve
- * \param mu initial parameter for the interpolator [0,1]
- * \param gain_mu gain parameter of the M&M error signal to adjust mu (~0.05)
- * \param omega initial value for the number of symbols between samples (~number of samples/symbol)
- * \param gain_omega gain parameter to adjust omega based on the error (~omega^2/4)
- * \param omega_rel sets the maximum (omega*(1+omega_rel)) and minimum (omega*(1+omega_rel)) omega (~0.005)
- *
- * The constructor also chooses which phase detector and
- * decision maker to use in the work loop based on the value of
- * M.
- */
- static sptr make(unsigned int M, float theta,
- float loop_bw,
- float fmin, float fmax,
- float mu, float gain_mu,
- float omega, float gain_omega, float omega_rel);
-
- //! Returns the modulation order (M) currently set
- virtual float modulation_order() const = 0;
-
- //! Returns current value of theta
- virtual float theta() const = 0;
-
- //! Returns current value of mu
- virtual float mu() const = 0;
-
- //! Returns current value of omega
- virtual float omega() const = 0;
-
- //! Returns mu gain factor
- virtual float gain_mu() const = 0;
-
- //! Returns omega gain factor
- virtual float gain_omega() const = 0;
-
- //! Returns the relative omega limit
- virtual float gain_omega_rel() const = 0;
-
- //! Sets the modulation order (M) currently
- virtual void set_modulation_order(unsigned int M) = 0;
-
- //! Sets value of theta
- virtual void set_theta(float theta) = 0;
-
- //! Sets value of mu
- virtual void set_mu(float mu) = 0;
-
- //! Sets value of omega and its min and max values
- virtual void set_omega(float omega) = 0;
-
- //! Sets value for mu gain factor
- virtual void set_gain_mu(float gain_mu) = 0;
-
- //! Sets value for omega gain factor
- virtual void set_gain_omega(float gain_omega) = 0;
-
- //! Sets the relative omega limit and resets omega min/max values
- virtual void set_gain_omega_rel(float omega_rel) = 0;
- };
-
- } /* namespace digital */
-} /* namespace gr */
-
-#endif /* INCLUDED_DIGITAL_MPSK_RECEIVER_CC_H */
diff --git a/gr-digital/lib/CMakeLists.txt b/gr-digital/lib/CMakeLists.txt
index b07bcc9d87..5e2435966c 100644
--- a/gr-digital/lib/CMakeLists.txt
+++ b/gr-digital/lib/CMakeLists.txt
@@ -88,7 +88,6 @@ list(APPEND digital_sources
lms_dd_equalizer_cc_impl.cc
map_bb_impl.cc
modulate_vector.cc
- mpsk_receiver_cc_impl.cc
mpsk_snr_est.cc
mpsk_snr_est_cc_impl.cc
msk_timing_recovery_cc_impl.cc
diff --git a/gr-digital/lib/mpsk_receiver_cc_impl.cc b/gr-digital/lib/mpsk_receiver_cc_impl.cc
deleted file mode 100644
index 68aae2cd91..0000000000
--- a/gr-digital/lib/mpsk_receiver_cc_impl.cc
+++ /dev/null
@@ -1,332 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2005-2007,2010-2012 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "mpsk_receiver_cc_impl.h"
-#include <gnuradio/io_signature.h>
-#include <gnuradio/math.h>
-#include <gnuradio/expj.h>
-#include <stdexcept>
-
-namespace gr {
- namespace digital {
-
-#define M_TWOPI (2*M_PI)
-#define VERBOSE_MM 0 // Used for debugging symbol timing loop
-#define VERBOSE_COSTAS 0 // Used for debugging phase and frequency tracking
-
- mpsk_receiver_cc::sptr
- mpsk_receiver_cc::make(unsigned int M, float theta,
- float loop_bw,
- float fmin, float fmax,
- float mu, float gain_mu,
- float omega, float gain_omega, float omega_rel)
- {
- return gnuradio::get_initial_sptr
- (new mpsk_receiver_cc_impl(M, theta,
- loop_bw,
- fmin, fmax,
- mu, gain_mu,
- omega, gain_omega,
- omega_rel));
- }
-
- mpsk_receiver_cc_impl::mpsk_receiver_cc_impl(unsigned int M, float theta,
- float loop_bw,
- float fmin, float fmax,
- float mu, float gain_mu,
- float omega, float gain_omega,
- float omega_rel)
- : block("mpsk_receiver_cc",
- io_signature::make(1, 1, sizeof(gr_complex)),
- io_signature::make(1, 1, sizeof(gr_complex))),
- blocks::control_loop(loop_bw, fmax, fmin),
- d_M(M), d_theta(theta),
- d_current_const_point(0),
- d_mu(mu), d_gain_mu(gain_mu), d_gain_omega(gain_omega),
- d_omega_rel(omega_rel), d_max_omega(0), d_min_omega(0),
- d_p_2T(0), d_p_1T(0), d_p_0T(0), d_c_2T(0), d_c_1T(0), d_c_0T(0)
- {
- GR_LOG_WARN(d_logger, "The gr::digital::mpsk_receiver_cc block is deprecated.");
-
- d_interp = new gr::filter::mmse_fir_interpolator_cc();
- d_dl_idx = 0;
-
- set_omega(omega);
-
- if(omega <= 0.0)
- throw std::out_of_range("clock rate must be > 0");
- if(gain_mu < 0 || gain_omega < 0)
- throw std::out_of_range("Gains must be non-negative");
-
- assert(d_interp->ntaps() <= DLLEN);
-
- // 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);
- }
-
- mpsk_receiver_cc_impl::~mpsk_receiver_cc_impl()
- {
- delete d_interp;
- }
-
- void
- mpsk_receiver_cc_impl::set_modulation_order(unsigned int M)
- {
- // build the constellation vector from M
- make_constellation();
-
- // Select a phase detector and a decision maker for the modulation order
- switch(d_M) {
- case 2: // optimized algorithms for BPSK
- d_phase_error_detector = &mpsk_receiver_cc_impl::phase_error_detector_bpsk; //bpsk;
- d_decision = &mpsk_receiver_cc_impl::decision_bpsk;
- break;
-
- case 4: // optimized algorithms for QPSK
- d_phase_error_detector = &mpsk_receiver_cc_impl::phase_error_detector_qpsk; //qpsk;
- d_decision = &mpsk_receiver_cc_impl::decision_qpsk;
- break;
-
- default: // generic algorithms for any M (power of 2?) but not pretty
- d_phase_error_detector = &mpsk_receiver_cc_impl::phase_error_detector_generic;
- d_decision = &mpsk_receiver_cc_impl::decision_generic;
- break;
- }
- }
-
- void
- mpsk_receiver_cc_impl::set_gain_omega_rel(float omega_rel)
- {
- d_omega_rel = omega_rel;
- set_omega(d_omega);
- }
-
- void
- mpsk_receiver_cc_impl::forecast(int noutput_items, gr_vector_int &ninput_items_required)
- {
- unsigned ninputs = ninput_items_required.size();
- for(unsigned i=0; i < ninputs; i++)
- ninput_items_required[i] = (int) ceil((noutput_items * d_omega) + d_interp->ntaps());
- }
-
- // FIXME add these back in an test difference in performance
- float
- mpsk_receiver_cc_impl::phase_error_detector_qpsk(gr_complex sample) const
- {
- float phase_error = 0;
- if(fabsf(sample.real()) > fabsf(sample.imag())) {
- if(sample.real() > 0)
- phase_error = -sample.imag();
- else
- phase_error = sample.imag();
- }
- else {
- if(sample.imag() > 0)
- phase_error = sample.real();
- else
- phase_error = -sample.real();
- }
-
- return phase_error;
- }
-
- float
- mpsk_receiver_cc_impl::phase_error_detector_bpsk(gr_complex sample) const
- {
- return -(sample.real()*sample.imag());
- }
-
- float mpsk_receiver_cc_impl::phase_error_detector_generic(gr_complex sample) const
- {
- //return gr::fast_atan2f(sample*conj(d_constellation[d_current_const_point]));
- return -arg(sample*conj(d_constellation[d_current_const_point]));
- }
-
- unsigned int
- mpsk_receiver_cc_impl::decision_bpsk(gr_complex sample) const
- {
- return (gr::branchless_binary_slicer(sample.real()) ^ 1);
- //return gr_binary_slicer(sample.real()) ^ 1;
- }
-
- unsigned int
- mpsk_receiver_cc_impl::decision_qpsk(gr_complex sample) const
- {
- unsigned int index;
-
- //index = gr::branchless_quad_0deg_slicer(sample);
- index = gr::quad_0deg_slicer(sample);
- return index;
- }
-
- unsigned int
- mpsk_receiver_cc_impl::decision_generic(gr_complex sample) const
- {
- unsigned int min_m = 0;
- float min_s = 65535;
-
- // Develop all possible constellation points and find the one that minimizes
- // the Euclidean distance (error) with the sample
- for(unsigned int m = 0; m < d_M; m++) {
- gr_complex diff = norm(d_constellation[m] - sample);
-
- if(fabs(diff.real()) < min_s) {
- min_s = fabs(diff.real());
- min_m = m;
- }
- }
- // Return the index of the constellation point that minimizes the error
- return min_m;
- }
-
- void
- mpsk_receiver_cc_impl::make_constellation()
- {
- for(unsigned int m = 0; m < d_M; m++) {
- d_constellation.push_back(gr_expj((M_TWOPI/d_M)*m));
- }
- }
-
- void
- mpsk_receiver_cc_impl::mm_sampler(const gr_complex symbol)
- {
- gr_complex sample, nco;
-
- d_mu--; // skip a number of symbols between sampling
- d_phase += d_freq; // increment the phase based on the frequency of the rotation
-
- // Keep phase clamped and not walk to infinity
- while(d_phase > M_TWOPI)
- d_phase -= M_TWOPI;
- while(d_phase < -M_TWOPI)
- d_phase += M_TWOPI;
-
- nco = gr_expj(d_phase+d_theta); // get the NCO value for derotating the current sample
- sample = nco*symbol; // get the downconverted symbol
-
- // Fill up the delay line for the interpolator
- d_dl[d_dl_idx] = sample;
- d_dl[(d_dl_idx + DLLEN)] = sample; // put this in the second half of the buffer for overflows
- d_dl_idx = (d_dl_idx+1) % DLLEN; // Keep the delay line index in bounds
- }
-
- void
- mpsk_receiver_cc_impl::mm_error_tracking(gr_complex sample)
- {
- gr_complex u, x, y;
- float mm_error = 0;
-
- // Make sample timing corrections
-
- // set the delayed samples
- d_p_2T = d_p_1T;
- d_p_1T = d_p_0T;
- d_p_0T = sample;
- d_c_2T = d_c_1T;
- d_c_1T = d_c_0T;
-
- d_current_const_point = (*this.*d_decision)(d_p_0T); // make a decision on the sample value
- d_c_0T = d_constellation[d_current_const_point];
-
- x = (d_c_0T - d_c_2T) * conj(d_p_1T);
- y = (d_p_0T - d_p_2T) * conj(d_c_1T);
- u = y - x;
- mm_error = u.real(); // the error signal is in the real part
- mm_error = gr::branchless_clip(mm_error, 1.0); // limit mm_val
-
- d_omega = d_omega + d_gain_omega * mm_error; // update omega based on loop error
- d_omega = d_omega_mid + gr::branchless_clip(d_omega-d_omega_mid, d_omega_rel); // make sure we don't walk away
-
- d_mu += d_omega + d_gain_mu * mm_error; // update mu based on loop error
-
-#if VERBOSE_MM
- printf("mm: mu: %f omega: %f mm_error: %f sample: %f+j%f constellation: %f+j%f\n",
- d_mu, d_omega, mm_error, sample.real(), sample.imag(),
- d_constellation[d_current_const_point].real(), d_constellation[d_current_const_point].imag());
-#endif
- }
-
-
- void
- mpsk_receiver_cc_impl::phase_error_tracking(gr_complex sample)
- {
- float phase_error = 0;
-
- // Make phase and frequency corrections based on sampled value
- phase_error = (*this.*d_phase_error_detector)(sample);
-
- advance_loop(phase_error);
- phase_wrap();
- frequency_limit();
-
-#if VERBOSE_COSTAS
- printf("cl: phase_error: %f phase: %f freq: %f sample: %f+j%f constellation: %f+j%f\n",
- phase_error, d_phase, d_freq, sample.real(), sample.imag(),
- d_constellation[d_current_const_point].real(), d_constellation[d_current_const_point].imag());
-#endif
-}
-
- int
- mpsk_receiver_cc_impl::general_work(int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
- {
- const gr_complex *in = (const gr_complex*)input_items[0];
- gr_complex *out = (gr_complex*)output_items[0];
-
- int i=0, o=0;
-
- while((o < noutput_items) && (i < ninput_items[0])) {
- while((d_mu > 1) && (i < ninput_items[0])) {
- mm_sampler(in[i]); // puts symbols into a buffer and adjusts d_mu
- i++;
- }
-
- if(i < ninput_items[0]) {
- gr_complex interp_sample = d_interp->interpolate(&d_dl[d_dl_idx], d_mu);
-
- mm_error_tracking(interp_sample); // corrects M&M sample time
- phase_error_tracking(interp_sample); // corrects phase and frequency offsets
-
- out[o++] = interp_sample;
- }
- }
-
-#if 0
- printf("ninput_items: %d noutput_items: %d consuming: %d returning: %d\n",
- ninput_items[0], noutput_items, i, o);
-#endif
-
- consume_each(i);
- return o;
- }
-
- } /* namespace digital */
-} /* namespace gr */
diff --git a/gr-digital/lib/mpsk_receiver_cc_impl.h b/gr-digital/lib/mpsk_receiver_cc_impl.h
deleted file mode 100644
index 48a9e43e58..0000000000
--- a/gr-digital/lib/mpsk_receiver_cc_impl.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2004,2007,2011,2012 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef INCLUDED_DIGITAL_MPSK_RECEIVER_CC_IMPL_H
-#define INCLUDED_DIGITAL_MPSK_RECEIVER_CC_IMPL_H
-
-#include <gnuradio/digital/mpsk_receiver_cc.h>
-#include <gnuradio/attributes.h>
-#include <gnuradio/gr_complex.h>
-#include <fstream>
-#include <gnuradio/filter/mmse_fir_interpolator_cc.h>
-
-namespace gr {
- namespace digital {
-
- class mpsk_receiver_cc_impl : public mpsk_receiver_cc
- {
- public:
- mpsk_receiver_cc_impl(unsigned int M, float theta,
- float loop_bw,
- float fmin, float fmax,
- float mu, float gain_mu,
- float omega, float gain_omega, float omega_rel);
- ~mpsk_receiver_cc_impl();
-
- void forecast(int noutput_items, gr_vector_int &ninput_items_required);
- int general_work(int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
-
- //! Returns the modulation order (M) currently set
- float modulation_order() const { return d_M; }
-
- //! Returns current value of theta
- float theta() const { return d_theta; }
-
- //! Returns current value of mu
- float mu() const { return d_mu; }
-
- //! Returns current value of omega
- float omega() const { return d_omega; }
-
- //! 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; }
-
- //! 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);
- d_max_omega = omega*(1.0 + d_omega_rel);
- d_omega_mid = 0.5*(d_min_omega+d_max_omega);
- }
-
- //! Sets value for mu gain factor
- void set_gain_mu(float gain_mu) { d_gain_mu = gain_mu; }
-
- //! 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:
- void make_constellation();
- void mm_sampler(const gr_complex symbol);
- void mm_error_tracking(gr_complex sample);
- void phase_error_tracking(gr_complex sample);
-
- /*!
- * \brief Phase error detector for MPSK modulations.
- *
- * \param sample the I&Q sample from which to determine the phase error
- *
- * This function determines the phase error for any MPSK signal
- * by creating a set of PSK constellation points and doing a
- * brute-force search to see which point minimizes the Euclidean
- * distance. This point is then used to derotate the sample to
- * the real-axis and a atan (using the fast approximation
- * function) to determine the phase difference between the
- * incoming sample and the real constellation point
- *
- * This should be cleaned up and made more efficient.
- *
- * \returns the approximated phase error.
- */
- float phase_error_detector_generic(gr_complex sample) const;
-
- /*!
- * \brief Phase error detector for BPSK modulation.
- *
- * \param sample the I&Q sample from which to determine the phase error
- *
- * This function determines the phase error using a simple BPSK
- * phase error detector by multiplying the real and imaginary (the
- * error signal) components together. As the imaginary part goes to
- * 0, so does this error.
- *
- * \returns the approximated phase error.
- */
- float phase_error_detector_bpsk(gr_complex sample) const;
-
- /*!
- * \brief Phase error detector for QPSK modulation.
- *
- * \param sample the I&Q sample from which to determine the phase error
- *
- * This function determines the phase error using the limiter
- * approach in a standard 4th order Costas loop
- *
- * \returns the approximated phase error.
- */
- float phase_error_detector_qpsk(gr_complex sample) const;
-
- /*!
- * \brief Decision maker for a generic MPSK constellation.
- *
- * \param sample the baseband I&Q sample from which to make the decision
- *
- * This decision maker is a generic implementation that does a
- * brute-force search for the constellation point that minimizes
- * the error between it and the incoming signal.
- *
- * \returns the index to d_constellation that minimizes the error/
- */
- unsigned int decision_generic(gr_complex sample) const;
-
- /*!
- * \brief Decision maker for BPSK constellation.
- *
- * \param sample the baseband I&Q sample from which to make the decision
- *
- * This decision maker is a simple slicer function that makes a
- * decision on the symbol based on its placement on the real
- * axis of greater than 0 or less than 0; the quadrature
- * component is always 0.
- *
- * \returns the index to d_constellation that minimizes the error/
- */
- unsigned int decision_bpsk(gr_complex sample) const;
-
- /*!
- * \brief Decision maker for QPSK constellation.
- *
- * \param sample the baseband I&Q sample from which to make the decision
- *
- * This decision maker is a simple slicer function that makes a
- * decision on the symbol based on its placement versus both
- * axes and returns which quadrant the symbol is in.
- *
- * \returns the index to d_constellation that minimizes the error/
- */
- unsigned int decision_qpsk(gr_complex sample) const;
-
- private:
- unsigned int d_M;
- float d_theta;
-
- /*!
- * \brief Decision maker function pointer
- *
- * \param sample the baseband I&Q sample from which to make the decision
- *
- * This is a function pointer that is set in the constructor to
- * point to the proper decision function for the specified
- * constellation order.
- *
- * \return index into d_constellation point that is the closest to the recieved sample
- */
- unsigned int (mpsk_receiver_cc_impl::*d_decision)(gr_complex sample) const;
-
- std::vector<gr_complex> d_constellation;
- unsigned int d_current_const_point;
-
- // Members related to symbol timing
- float d_mu, d_gain_mu;
- float d_omega, d_gain_omega, d_omega_rel, d_max_omega, d_min_omega, d_omega_mid;
- gr_complex d_p_2T, d_p_1T, d_p_0T;
- gr_complex d_c_2T, d_c_1T, d_c_0T;
-
- /*!
- * \brief Phase error detector function pointer
- *
- * \param sample the I&Q sample from which to determine the phase error
- *
- * This is a function pointer that is set in the constructor to
- * point to the proper phase error detector function for the
- * specified constellation order.
- */
- float (mpsk_receiver_cc_impl::*d_phase_error_detector)(gr_complex sample) const;
-
- //! get interpolated value
- gr::filter::mmse_fir_interpolator_cc *d_interp;
-
- //! delay line length.
- static const unsigned int DLLEN = 8;
-
- //! delay line plus some length for overflow protection
- __GR_ATTR_ALIGNED(8) gr_complex d_dl[2*DLLEN];
-
- //! index to delay line
- unsigned int d_dl_idx;
- };
-
- } /* namespace digital */
-} /* namespace gr */
-
-#endif /* INCLUDED_DIGITAL_MPSK_RECEIVER_CC_IMPL_H */
diff --git a/gr-digital/python/digital/qa_mpsk_receiver.py b/gr-digital/python/digital/qa_mpsk_receiver.py
deleted file mode 100755
index df7519dcf6..0000000000
--- a/gr-digital/python/digital/qa_mpsk_receiver.py
+++ /dev/null
@@ -1,146 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2011-2013 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-#
-
-import random
-import cmath
-import time
-
-from gnuradio import gr, gr_unittest, digital, filter, blocks
-
-class test_mpsk_receiver(gr_unittest.TestCase):
-
- def setUp(self):
- self.tb = gr.top_block()
-
- def tearDown(self):
- self.tb = None
-
- def test01(self):
- # Test BPSK sync
- M = 2
- theta = 0
- loop_bw = cmath.pi/100.0
- fmin = -0.5
- fmax = 0.5
- mu = 0.5
- gain_mu = 0.01
- omega = 2
- gain_omega = 0.001
- omega_rel = 0.001
-
- self.test = digital.mpsk_receiver_cc(M, theta, loop_bw,
- fmin, fmax, mu, gain_mu,
- omega, gain_omega,
- omega_rel)
-
- data = 10000*[complex(1,0), complex(-1,0)]
- #data = [2*random.randint(0,1)-1 for x in xrange(10000)]
- self.src = blocks.vector_source_c(data, False)
- self.snk = blocks.vector_sink_c()
-
- # pulse shaping interpolation filter
- nfilts = 32
- excess_bw = 0.35
- ntaps = 11 * int(omega*nfilts)
- rrc_taps0 = filter.firdes.root_raised_cosine(
- nfilts, nfilts, 1.0, excess_bw, ntaps)
- rrc_taps1 = filter.firdes.root_raised_cosine(
- 1, omega, 1.0, excess_bw, 11*omega)
- self.rrc0 = filter.pfb_arb_resampler_ccf(omega, rrc_taps0)
- self.rrc1 = filter.fir_filter_ccf(1, rrc_taps1)
-
- self.tb.connect(self.src, self.rrc0, self.rrc1, self.test, self.snk)
- self.tb.run()
-
- expected_result = [-0.5*d for d in data]
- dst_data = self.snk.data()
-
- # Only Ncmp samples after Nstrt samples
- Nstrt = 9000
- Ncmp = 1000
- expected_result = expected_result[Nstrt:Nstrt+Ncmp]
- dst_data = dst_data[Nstrt:Nstrt+Ncmp]
-
- #for e,d in zip(expected_result, dst_data):
- # print "{0:+.02f} {1:+.02f}".format(e, d)
-
- self.assertComplexTuplesAlmostEqual(expected_result, dst_data, 1)
-
-
- def test02(self):
- # Test QPSK sync
- M = 4
- theta = 0
- loop_bw = cmath.pi/100.0
- fmin = -0.5
- fmax = 0.5
- mu = 0.5
- gain_mu = 0.01
- omega = 2
- gain_omega = 0.001
- omega_rel = 0.001
-
- self.test = digital.mpsk_receiver_cc(M, theta, loop_bw,
- fmin, fmax, mu, gain_mu,
- omega, gain_omega,
- omega_rel)
-
- data = 10000*[complex( 0.707, 0.707),
- complex(-0.707, 0.707),
- complex(-0.707, -0.707),
- complex( 0.707, -0.707)]
- data = [0.5*d for d in data]
- self.src = blocks.vector_source_c(data, False)
- self.snk = blocks.vector_sink_c()
-
- # pulse shaping interpolation filter
- nfilts = 32
- excess_bw = 0.35
- ntaps = 11 * int(omega*nfilts)
- rrc_taps0 = filter.firdes.root_raised_cosine(
- nfilts, nfilts, 1.0, excess_bw, ntaps)
- rrc_taps1 = filter.firdes.root_raised_cosine(
- 1, omega, 1.0, excess_bw, 11*omega)
- self.rrc0 = filter.pfb_arb_resampler_ccf(omega, rrc_taps0)
- self.rrc1 = filter.fir_filter_ccf(1, rrc_taps1)
-
- self.tb.connect(self.src, self.rrc0, self.rrc1, self.test, self.snk)
- self.tb.run()
-
- expected_result = 10000*[complex(-0.5, +0.0), complex(+0.0, -0.5),
- complex(+0.5, +0.0), complex(+0.0, +0.5)]
-
- dst_data = self.snk.data()
-
- # Only Ncmp samples after Nstrt samples
- Nstrt = 9000
- Ncmp = 1000
- expected_result = expected_result[Nstrt:Nstrt+Ncmp]
- dst_data = dst_data[Nstrt:Nstrt+Ncmp]
-
- #for e,d in zip(expected_result, dst_data):
- # print "{0:+.02f} {1:+.02f}".format(e, d)
-
- self.assertComplexTuplesAlmostEqual(expected_result, dst_data, 1)
-
-if __name__ == '__main__':
- gr_unittest.run(test_mpsk_receiver, "test_mpsk_receiver.xml")
diff --git a/gr-digital/swig/digital_swig2.i b/gr-digital/swig/digital_swig2.i
index c16cc6aafb..1836ad576c 100644
--- a/gr-digital/swig/digital_swig2.i
+++ b/gr-digital/swig/digital_swig2.i
@@ -37,7 +37,6 @@
%include <gnuradio/blocks/control_loop.h>
%{
-#include "gnuradio/digital/mpsk_receiver_cc.h"
#include "gnuradio/digital/mpsk_snr_est.h"
#include "gnuradio/digital/mpsk_snr_est_cc.h"
#include "gnuradio/digital/header_format_base.h"
@@ -66,7 +65,6 @@
#include "gnuradio/digital/header_payload_demux.h"
%}
-%include "gnuradio/digital/mpsk_receiver_cc.h"
%include "gnuradio/digital/mpsk_snr_est.h"
%include "gnuradio/digital/mpsk_snr_est_cc.h"
%include "gnuradio/digital/header_format_base.h"
@@ -91,7 +89,6 @@
%include "gnuradio/digital/simple_correlator.h"
%include "gnuradio/digital/simple_framer.h"
-GR_SWIG_BLOCK_MAGIC2(digital, mpsk_receiver_cc);
GR_SWIG_BLOCK_MAGIC2(digital, mpsk_snr_est_cc);
GR_SWIG_BLOCK_MAGIC2(digital, protocol_formatter_async);
GR_SWIG_BLOCK_MAGIC2(digital, protocol_formatter_bb);
diff --git a/gr-qtgui/apps/qt_digital.py b/gr-qtgui/apps/qt_digital.py
deleted file mode 100755
index fef4f448b4..0000000000
--- a/gr-qtgui/apps/qt_digital.py
+++ /dev/null
@@ -1,307 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2011 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-#
-
-from gnuradio import gr, digital
-from gnuradio import blocks
-from gnuradio import filter
-from gnuradio import channels
-from gnuradio import eng_notation
-import sys
-
-try:
- from gnuradio import qtgui
- from PyQt4 import QtGui, QtCore
- import sip
-except ImportError:
- print "Error: Program requires PyQt4 and gr-qtgui."
- sys.exit(1)
-
-try:
- import scipy
-except ImportError:
- print "Error: Program requires scipy (see: www.scipy.org)."
- sys.exit(1)
-
-try:
- from qt_digital_window import Ui_DigitalWindow
-except ImportError:
- print "Error: could not find qt_digital_window.py:"
- print "\t\"Please run: pyuic4 qt_digital_window.ui -o qt_digital_window.py\""
- sys.exit(1)
-
-class dialog_box(QtGui.QMainWindow):
- def __init__(self, snkTx, snkRx, fg, parent=None):
- QtGui.QWidget.__init__(self, parent)
- self.gui = Ui_DigitalWindow()
- self.gui.setupUi(self)
-
- self.fg = fg
-
- self.set_sample_rate(self.fg.sample_rate())
-
- self.set_snr(self.fg.snr())
- self.set_frequency(self.fg.frequency_offset())
- self.set_time_offset(self.fg.timing_offset())
-
- self.set_gain_mu(self.fg.rx_gain_mu())
- self.set_loop_bw(self.fg.loop_bw())
-
- # Add the qtsnk widgets to the hlayout box
- self.gui.sinkLayout.addWidget(snkTx)
- self.gui.sinkLayout.addWidget(snkRx)
-
-
- # Connect up some signals
- self.connect(self.gui.pauseButton, QtCore.SIGNAL("clicked()"),
- self.pauseFg)
-
- self.connect(self.gui.sampleRateEdit, QtCore.SIGNAL("editingFinished()"),
- self.sampleRateEditText)
-
- self.connect(self.gui.snrEdit, QtCore.SIGNAL("editingFinished()"),
- self.snrEditText)
- self.connect(self.gui.freqEdit, QtCore.SIGNAL("editingFinished()"),
- self.freqEditText)
- self.connect(self.gui.timeEdit, QtCore.SIGNAL("editingFinished()"),
- self.timeEditText)
-
- self.connect(self.gui.gainMuEdit, QtCore.SIGNAL("editingFinished()"),
- self.gainMuEditText)
- self.connect(self.gui.alphaEdit, QtCore.SIGNAL("editingFinished()"),
- self.alphaEditText)
-
-
- def pauseFg(self):
- if(self.gui.pauseButton.text() == "Pause"):
- self.fg.stop()
- self.fg.wait()
- self.gui.pauseButton.setText("Unpause")
- else:
- self.fg.start()
- self.gui.pauseButton.setText("Pause")
-
- # Accessor functions for Gui to manipulate system parameters
- def set_sample_rate(self, sr):
- ssr = eng_notation.num_to_str(sr)
- self.gui.sampleRateEdit.setText(QtCore.QString("%1").arg(ssr))
-
- def sampleRateEditText(self):
- try:
- rate = self.gui.sampleRateEdit.text().toAscii()
- srate = eng_notation.str_to_num(rate)
- self.fg.set_sample_rate(srate)
- except RuntimeError:
- pass
-
-
- # Accessor functions for Gui to manipulate channel model
- def set_snr(self, snr):
- self.gui.snrEdit.setText(QtCore.QString("%1").arg(snr))
-
- def set_frequency(self, fo):
- self.gui.freqEdit.setText(QtCore.QString("%1").arg(fo))
-
- def set_time_offset(self, to):
- self.gui.timeEdit.setText(QtCore.QString("%1").arg(to))
-
- def snrEditText(self):
- try:
- snr = self.gui.snrEdit.text().toDouble()[0]
- self.fg.set_snr(snr)
- except RuntimeError:
- pass
-
- def freqEditText(self):
- try:
- freq = self.gui.freqEdit.text().toDouble()[0]
- self.fg.set_frequency_offset(freq)
- except RuntimeError:
- pass
-
- def timeEditText(self):
- try:
- to = self.gui.timeEdit.text().toDouble()[0]
- self.fg.set_timing_offset(to)
- except RuntimeError:
- pass
-
-
- # Accessor functions for Gui to manipulate receiver parameters
- def set_gain_mu(self, gain):
- self.gui.gainMuEdit.setText(QtCore.QString("%1").arg(gain))
-
- def set_loop_bw(self, bw):
- self.gui.alphaEdit.setText(QtCore.QString("%1").arg(bw))
-
- def alphaEditText(self):
- try:
- bw = self.gui.alphaEdit.text().toDouble()[0]
- self.fg.set_loop_bw(bw)
- except RuntimeError:
- pass
-
- def gainMuEditText(self):
- try:
- gain = self.gui.gainMuEdit.text().toDouble()[0]
- self.fg.set_rx_gain_mu(gain)
- except RuntimeError:
- pass
-
-
-class my_top_block(gr.top_block):
- def __init__(self):
- gr.top_block.__init__(self)
-
- self.qapp = QtGui.QApplication(sys.argv)
-
- self._sample_rate = 2000e3
-
- self.sps = 2
- self.excess_bw = 0.35
- self.gray_code = digital.mod_codes.GRAY_CODE
-
- fftsize = 2048
-
- self.data = scipy.random.randint(0, 255, 1000)
- self.src = blocks.vector_source_b(self.data.tolist(), True)
- self.mod = digital.dqpsk_mod(self.gray_code,
- samples_per_symbol=self.sps,
- excess_bw=self.excess_bw,
- verbose=False, log=False)
-
- self.rrctaps = filter.firdes.root_raised_cosine(1, self.sps, 1, self.excess_bw, 21)
- self.rx_rrc = filter.fir_filter_ccf(1, self.rrctaps)
-
-
- # Set up the carrier & clock recovery parameters
- self.arity = 4
- self.mu = 0.5
- self.gain_mu = 0.05
- self.omega = self.sps
- self.gain_omega = .25 * self.gain_mu * self.gain_mu
- self.omega_rel_lim = 0.05
-
- self._loop_bw = 2*scipy.pi/100.0
- self.fmin = -1000/self.sample_rate()
- self.fmax = 1000/self.sample_rate()
-
- self.receiver = digital.mpsk_receiver_cc(self.arity, 0,
- self._loop_bw,
- self.fmin, self.fmax,
- self.mu, self.gain_mu,
- self.omega, self.gain_omega,
- self.omega_rel_lim)
-
-
- self.snr_dB = 15
- noise = self.get_noise_voltage(self.snr_dB)
- self.fo = 100/self.sample_rate()
- self.to = 1.0
- self.channel = channels.channel_model(noise, self.fo, self.to)
-
- self.thr = blocks.throttle(gr.sizeof_char, self._sample_rate)
- self.snk_tx = qtgui.sink_c(fftsize, filter.firdes.WIN_BLACKMAN_hARRIS,
- 0, self._sample_rate*self.sps,
- "Tx", True, True, True, True)
-
- self.snk_rx = qtgui.sink_c(fftsize, filter.firdes.WIN_BLACKMAN_hARRIS,
- 0, self._sample_rate,
- "Rx", True, True, True, True)
-
- self.connect(self.src, self.thr, self.mod, self.channel, self.snk_tx)
- self.connect(self.channel, self.rx_rrc, self.receiver, self.snk_rx)
-
- pyTxQt = self.snk_tx.pyqwidget()
- pyTx = sip.wrapinstance(pyTxQt, QtGui.QWidget)
-
- pyRxQt = self.snk_rx.pyqwidget()
- pyRx = sip.wrapinstance(pyRxQt, QtGui.QWidget)
-
- self.main_box = dialog_box(pyTx, pyRx, self);
- self.main_box.show()
-
-
- def get_noise_voltage(self, SNR):
- S = 0 # dBm, assuming signal power normalized
- N = S - SNR # dBm
- npwr = pow(10.0, N/10.0) # ratio
- nv = scipy.sqrt(npwr * self.sps) # convert the noise voltage
- return nv
-
-
- # System Parameters
- def sample_rate(self):
- return self._sample_rate
-
- def set_sample_rate(self, sr):
- self._sample_rate = sr
-
-
- # Channel Model Parameters
- def snr(self):
- return self.snr_dB
-
- def set_snr(self, snr):
- self.snr_dB = snr
- noise = self.get_noise_voltage(self.snr_dB)
- self.channel.set_noise_voltage(noise)
-
- def frequency_offset(self):
- return self.fo * self.sample_rate()
-
- def set_frequency_offset(self, fo):
- self.fo = fo / self.sample_rate()
- self.channel.set_frequency_offset(self.fo)
-
- def timing_offset(self):
- return self.to
-
- def set_timing_offset(self, to):
- self.to = to
- self.channel.set_timing_offset(self.to)
-
-
- # Receiver Parameters
- def rx_gain_mu(self):
- return self.gain_mu
-
- def rx_gain_omega(self):
- return self.gain_omega
-
- def set_rx_gain_mu(self, gain):
- self.gain_mu = gain
- self.gain_omega = .25 * self.gain_mu * self.gain_mu
- self.receiver.set_gain_mu(self.gain_mu)
- self.receiver.set_gain_omega(self.gain_omega)
-
- def set_loop_bw(self, loop_bw):
- self._loop_bw = bw
- self.receiver.set_loop_bw(self._loop_bw)
-
- def loop_bw(self):
- return self._loop_bw
-
-if __name__ == "__main__":
- tb = my_top_block();
- tb.start()
- tb.qapp.exec_()
- tb.stop()
diff --git a/gr-qtgui/apps/qt_digital_window.py b/gr-qtgui/apps/qt_digital_window.py
deleted file mode 100644
index 50dd53a923..0000000000
--- a/gr-qtgui/apps/qt_digital_window.py
+++ /dev/null
@@ -1,161 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'qt_digital_window.ui'
-#
-# Created: Sat May 1 20:14:02 2010
-# by: PyQt4 UI code generator 4.6.1
-#
-# WARNING! All changes made in this file will be lost!
-
-from PyQt4 import QtCore, QtGui
-
-class Ui_DigitalWindow(object):
- def setupUi(self, DigitalWindow):
- DigitalWindow.setObjectName("DigitalWindow")
- DigitalWindow.resize(1236, 741)
- self.centralwidget = QtGui.QWidget(DigitalWindow)
- self.centralwidget.setObjectName("centralwidget")
- self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget)
- self.verticalLayout.setObjectName("verticalLayout")
- self.sinkFrame = QtGui.QFrame(self.centralwidget)
- self.sinkFrame.setMinimumSize(QtCore.QSize(0, 550))
- self.sinkFrame.setFrameShape(QtGui.QFrame.StyledPanel)
- self.sinkFrame.setFrameShadow(QtGui.QFrame.Raised)
- self.sinkFrame.setObjectName("sinkFrame")
- self.horizontalLayout_2 = QtGui.QHBoxLayout(self.sinkFrame)
- self.horizontalLayout_2.setObjectName("horizontalLayout_2")
- self.sinkLayout = QtGui.QHBoxLayout()
- self.sinkLayout.setObjectName("sinkLayout")
- self.horizontalLayout_2.addLayout(self.sinkLayout)
- self.verticalLayout.addWidget(self.sinkFrame)
- self.horizontalLayout = QtGui.QHBoxLayout()
- self.horizontalLayout.setObjectName("horizontalLayout")
- self.sysBox = QtGui.QGroupBox(self.centralwidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.sysBox.sizePolicy().hasHeightForWidth())
- self.sysBox.setSizePolicy(sizePolicy)
- self.sysBox.setMinimumSize(QtCore.QSize(0, 0))
- self.sysBox.setMaximumSize(QtCore.QSize(16777215, 120))
- self.sysBox.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
- self.sysBox.setObjectName("sysBox")
- self.gridLayout_2 = QtGui.QGridLayout(self.sysBox)
- self.gridLayout_2.setObjectName("gridLayout_2")
- self.sampleRateEdit = QtGui.QLineEdit(self.sysBox)
- self.sampleRateEdit.setMaximumSize(QtCore.QSize(100, 16777215))
- self.sampleRateEdit.setObjectName("sampleRateEdit")
- self.gridLayout_2.addWidget(self.sampleRateEdit, 0, 3, 1, 1)
- self.sampleRateLabel = QtGui.QLabel(self.sysBox)
- self.sampleRateLabel.setObjectName("sampleRateLabel")
- self.gridLayout_2.addWidget(self.sampleRateLabel, 0, 2, 1, 1)
- self.horizontalLayout.addWidget(self.sysBox)
- self.rxBox = QtGui.QGroupBox(self.centralwidget)
- self.rxBox.setMaximumSize(QtCore.QSize(16777215, 120))
- self.rxBox.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
- self.rxBox.setObjectName("rxBox")
- self.gridLayout_3 = QtGui.QGridLayout(self.rxBox)
- self.gridLayout_3.setObjectName("gridLayout_3")
- self.alphaLabel = QtGui.QLabel(self.rxBox)
- self.alphaLabel.setObjectName("alphaLabel")
- self.gridLayout_3.addWidget(self.alphaLabel, 1, 0, 1, 1)
- self.alphaEdit = QtGui.QLineEdit(self.rxBox)
- self.alphaEdit.setMaximumSize(QtCore.QSize(100, 16777215))
- self.alphaEdit.setObjectName("alphaEdit")
- self.gridLayout_3.addWidget(self.alphaEdit, 1, 1, 1, 1)
- self.gainMuLabel = QtGui.QLabel(self.rxBox)
- self.gainMuLabel.setObjectName("gainMuLabel")
- self.gridLayout_3.addWidget(self.gainMuLabel, 0, 0, 1, 1)
- self.gainMuEdit = QtGui.QLineEdit(self.rxBox)
- self.gainMuEdit.setMaximumSize(QtCore.QSize(100, 16777215))
- self.gainMuEdit.setObjectName("gainMuEdit")
- self.gridLayout_3.addWidget(self.gainMuEdit, 0, 1, 1, 1)
- self.horizontalLayout.addWidget(self.rxBox)
- self.channelModeBox = QtGui.QGroupBox(self.centralwidget)
- self.channelModeBox.setMaximumSize(QtCore.QSize(16777215, 120))
- self.channelModeBox.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
- self.channelModeBox.setObjectName("channelModeBox")
- self.gridLayout = QtGui.QGridLayout(self.channelModeBox)
- self.gridLayout.setSizeConstraint(QtGui.QLayout.SetMinimumSize)
- self.gridLayout.setObjectName("gridLayout")
- self.snrLabel = QtGui.QLabel(self.channelModeBox)
- self.snrLabel.setObjectName("snrLabel")
- self.gridLayout.addWidget(self.snrLabel, 0, 1, 1, 1)
- self.snrEdit = QtGui.QLineEdit(self.channelModeBox)
- self.snrEdit.setMaximumSize(QtCore.QSize(100, 16777215))
- self.snrEdit.setObjectName("snrEdit")
- self.gridLayout.addWidget(self.snrEdit, 0, 2, 1, 1)
- self.freqLabel = QtGui.QLabel(self.channelModeBox)
- self.freqLabel.setObjectName("freqLabel")
- self.gridLayout.addWidget(self.freqLabel, 1, 1, 1, 1)
- self.freqEdit = QtGui.QLineEdit(self.channelModeBox)
- self.freqEdit.setMaximumSize(QtCore.QSize(100, 16777215))
- self.freqEdit.setObjectName("freqEdit")
- self.gridLayout.addWidget(self.freqEdit, 1, 2, 1, 1)
- self.timeLabel = QtGui.QLabel(self.channelModeBox)
- self.timeLabel.setObjectName("timeLabel")
- self.gridLayout.addWidget(self.timeLabel, 2, 1, 1, 1)
- self.timeEdit = QtGui.QLineEdit(self.channelModeBox)
- self.timeEdit.setMaximumSize(QtCore.QSize(100, 16777215))
- self.timeEdit.setObjectName("timeEdit")
- self.gridLayout.addWidget(self.timeEdit, 2, 2, 1, 1)
- self.horizontalLayout.addWidget(self.channelModeBox)
- spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem)
- self.verticalLayout_2 = QtGui.QVBoxLayout()
- self.verticalLayout_2.setObjectName("verticalLayout_2")
- spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
- self.verticalLayout_2.addItem(spacerItem1)
- self.pauseButton = QtGui.QPushButton(self.centralwidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.pauseButton.sizePolicy().hasHeightForWidth())
- self.pauseButton.setSizePolicy(sizePolicy)
- self.pauseButton.setMaximumSize(QtCore.QSize(80, 16777215))
- self.pauseButton.setObjectName("pauseButton")
- self.verticalLayout_2.addWidget(self.pauseButton)
- self.closeButton = QtGui.QPushButton(self.centralwidget)
- self.closeButton.setMaximumSize(QtCore.QSize(80, 16777215))
- self.closeButton.setObjectName("closeButton")
- self.verticalLayout_2.addWidget(self.closeButton)
- self.horizontalLayout.addLayout(self.verticalLayout_2)
- self.verticalLayout.addLayout(self.horizontalLayout)
- DigitalWindow.setCentralWidget(self.centralwidget)
- self.menubar = QtGui.QMenuBar(DigitalWindow)
- self.menubar.setGeometry(QtCore.QRect(0, 0, 1236, 23))
- self.menubar.setObjectName("menubar")
- self.menuFile = QtGui.QMenu(self.menubar)
- self.menuFile.setObjectName("menuFile")
- DigitalWindow.setMenuBar(self.menubar)
- self.statusbar = QtGui.QStatusBar(DigitalWindow)
- self.statusbar.setObjectName("statusbar")
- DigitalWindow.setStatusBar(self.statusbar)
- self.actionExit = QtGui.QAction(DigitalWindow)
- self.actionExit.setObjectName("actionExit")
- self.menuFile.addAction(self.actionExit)
- self.menubar.addAction(self.menuFile.menuAction())
-
- self.retranslateUi(DigitalWindow)
- QtCore.QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), DigitalWindow.close)
- QtCore.QObject.connect(self.actionExit, QtCore.SIGNAL("triggered()"), DigitalWindow.close)
- QtCore.QMetaObject.connectSlotsByName(DigitalWindow)
- DigitalWindow.setTabOrder(self.snrEdit, self.freqEdit)
- DigitalWindow.setTabOrder(self.freqEdit, self.timeEdit)
-
- def retranslateUi(self, DigitalWindow):
- DigitalWindow.setWindowTitle(QtGui.QApplication.translate("DigitalWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8))
- self.sysBox.setTitle(QtGui.QApplication.translate("DigitalWindow", "System Parameters", None, QtGui.QApplication.UnicodeUTF8))
- self.sampleRateLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Sample Rate (sps)", None, QtGui.QApplication.UnicodeUTF8))
- self.rxBox.setTitle(QtGui.QApplication.translate("DigitalWindow", "Receiver Parameters", None, QtGui.QApplication.UnicodeUTF8))
- self.alphaLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Alpha", None, QtGui.QApplication.UnicodeUTF8))
- self.gainMuLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Gain mu", None, QtGui.QApplication.UnicodeUTF8))
- self.channelModeBox.setTitle(QtGui.QApplication.translate("DigitalWindow", "Channel Model Parameters", None, QtGui.QApplication.UnicodeUTF8))
- self.snrLabel.setText(QtGui.QApplication.translate("DigitalWindow", "SNR (dB)", None, QtGui.QApplication.UnicodeUTF8))
- self.freqLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Frequency Offset (Hz)", None, QtGui.QApplication.UnicodeUTF8))
- self.timeLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Timing Offset", None, QtGui.QApplication.UnicodeUTF8))
- self.pauseButton.setText(QtGui.QApplication.translate("DigitalWindow", "Pause", None, QtGui.QApplication.UnicodeUTF8))
- self.closeButton.setText(QtGui.QApplication.translate("DigitalWindow", "Close", None, QtGui.QApplication.UnicodeUTF8))
- self.menuFile.setTitle(QtGui.QApplication.translate("DigitalWindow", "&File", None, QtGui.QApplication.UnicodeUTF8))
- self.actionExit.setText(QtGui.QApplication.translate("DigitalWindow", "E&xit", None, QtGui.QApplication.UnicodeUTF8))
-
diff --git a/gr-qtgui/apps/qt_digital_window.ui b/gr-qtgui/apps/qt_digital_window.ui
deleted file mode 100644
index 9672521815..0000000000
--- a/gr-qtgui/apps/qt_digital_window.ui
+++ /dev/null
@@ -1,342 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>DigitalWindow</class>
- <widget class="QMainWindow" name="DigitalWindow">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>1236</width>
- <height>741</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>MainWindow</string>
- </property>
- <widget class="QWidget" name="centralwidget">
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QFrame" name="sinkFrame">
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>550</height>
- </size>
- </property>
- <property name="frameShape">
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <layout class="QHBoxLayout" name="sinkLayout"/>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QGroupBox" name="sysBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>120</height>
- </size>
- </property>
- <property name="title">
- <string>System Parameters</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="3">
- <widget class="QLineEdit" name="sampleRateEdit">
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLabel" name="sampleRateLabel">
- <property name="text">
- <string>Sample Rate (sps)</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="rxBox">
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>120</height>
- </size>
- </property>
- <property name="title">
- <string>Receiver Parameters</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
- </property>
- <layout class="QGridLayout" name="gridLayout_3">
- <item row="1" column="0">
- <widget class="QLabel" name="alphaLabel">
- <property name="text">
- <string>Alpha</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="alphaEdit">
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="gainMuLabel">
- <property name="text">
- <string>Gain mu</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="gainMuEdit">
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="channelModeBox">
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>120</height>
- </size>
- </property>
- <property name="title">
- <string>Channel Model Parameters</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <property name="sizeConstraint">
- <enum>QLayout::SetMinimumSize</enum>
- </property>
- <item row="0" column="1">
- <widget class="QLabel" name="snrLabel">
- <property name="text">
- <string>SNR (dB)</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLineEdit" name="snrEdit">
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLabel" name="freqLabel">
- <property name="text">
- <string>Frequency Offset (Hz)</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLineEdit" name="freqEdit">
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QLabel" name="timeLabel">
- <property name="text">
- <string>Timing Offset</string>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QLineEdit" name="timeEdit">
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="pauseButton">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Pause</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="closeButton">
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Close</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <widget class="QMenuBar" name="menubar">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>1236</width>
- <height>23</height>
- </rect>
- </property>
- <widget class="QMenu" name="menuFile">
- <property name="title">
- <string>&amp;File</string>
- </property>
- <addaction name="actionExit"/>
- </widget>
- <addaction name="menuFile"/>
- </widget>
- <widget class="QStatusBar" name="statusbar"/>
- <action name="actionExit">
- <property name="text">
- <string>E&amp;xit</string>
- </property>
- </action>
- </widget>
- <tabstops>
- <tabstop>snrEdit</tabstop>
- <tabstop>freqEdit</tabstop>
- <tabstop>timeEdit</tabstop>
- </tabstops>
- <resources/>
- <connections>
- <connection>
- <sender>closeButton</sender>
- <signal>clicked()</signal>
- <receiver>DigitalWindow</receiver>
- <slot>close()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>322</x>
- <y>623</y>
- </hint>
- <hint type="destinationlabel">
- <x>66</x>
- <y>561</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>actionExit</sender>
- <signal>triggered()</signal>
- <receiver>DigitalWindow</receiver>
- <slot>close()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>-1</x>
- <y>-1</y>
- </hint>
- <hint type="destinationlabel">
- <x>617</x>
- <y>327</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>