summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2016-01-17 09:11:22 -0800
committerJohnathan Corgan <johnathan@corganlabs.com>2016-01-17 09:11:22 -0800
commit25761ace73a374136b07717d3cf9ed4d1c83a841 (patch)
tree8cc49d854b639b1aa6c1433e88beed460cea3dd9
parentd2c6938b4922ba4942aad96bd47c1391e9516f2a (diff)
parent32e0712b763a21c7cd750477a686228919e18492 (diff)
Merge branch 'master' into next
-rw-r--r--gnuradio-runtime/python/gnuradio/gru/freqz.py2
-rw-r--r--gr-analog/grc/analog_nbfm_rx.xml80
-rw-r--r--gr-analog/grc/analog_nbfm_tx.xml80
-rw-r--r--gr-analog/python/analog/nbfm_rx.py8
-rw-r--r--gr-analog/python/analog/nbfm_tx.py9
-rw-r--r--gr-digital/lib/pfb_clock_sync_ccf_impl.cc3
-rw-r--r--gr-digital/lib/pfb_clock_sync_fff_impl.cc3
-rw-r--r--gr-filter/lib/rational_resampler_base_XXX_impl.cc.t6
-rw-r--r--gr-uhd/grc/gen_uhd_usrp_blocks.py2
-rwxr-xr-xgr-utils/python/utils/plot_fft_base.py2
-rw-r--r--grc/gui/ActionHandler.py10
11 files changed, 119 insertions, 86 deletions
diff --git a/gnuradio-runtime/python/gnuradio/gru/freqz.py b/gnuradio-runtime/python/gnuradio/gru/freqz.py
index 60dca64a58..6d8b94db8b 100644
--- a/gnuradio-runtime/python/gnuradio/gru/freqz.py
+++ b/gnuradio-runtime/python/gnuradio/gru/freqz.py
@@ -101,7 +101,7 @@ def polyval(p,x):
y = 0
else:
x = asarray(x)
- y = numpy.zeros(x.shape,x.typecode())
+ y = numpy.zeros(x.shape,x.dtype)
for i in range(len(p)):
y = x * y + p[i]
return y
diff --git a/gr-analog/grc/analog_nbfm_rx.xml b/gr-analog/grc/analog_nbfm_rx.xml
index fca1d3a6a5..9250b77b5e 100644
--- a/gr-analog/grc/analog_nbfm_rx.xml
+++ b/gr-analog/grc/analog_nbfm_rx.xml
@@ -5,44 +5,52 @@
###################################################
-->
<block>
- <name>NBFM Receive</name>
- <key>analog_nbfm_rx</key>
- <import>from gnuradio import analog</import>
- <make>analog.nbfm_rx(
+ <name>NBFM Receive</name>
+ <key>analog_nbfm_rx</key>
+ <import>from gnuradio import analog</import>
+ <make>analog.nbfm_rx(
audio_rate=$audio_rate,
quad_rate=$quad_rate,
tau=$tau,
max_dev=$max_dev,
-)</make>
- <param>
- <name>Audio Rate</name>
- <key>audio_rate</key>
- <type>int</type>
- </param>
- <param>
- <name>Quadrature Rate</name>
- <key>quad_rate</key>
- <type>int</type>
- </param>
- <param>
- <name>Tau</name>
- <key>tau</key>
- <value>75e-6</value>
- <type>real</type>
- </param>
- <param>
- <name>Max Deviation</name>
- <key>max_dev</key>
- <value>5e3</value>
- <type>real</type>
- </param>
- <check>($quad_rate)%($audio_rate) == 0</check>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>float</type>
- </source>
+ )</make>
+ <callback>set_max_deviation($max_dev)</callback>
+
+ <param>
+ <name>Audio Rate</name>
+ <key>audio_rate</key>
+ <type>int</type>
+ </param>
+
+ <param>
+ <name>Quadrature Rate</name>
+ <key>quad_rate</key>
+ <type>int</type>
+ </param>
+
+ <param>
+ <name>Tau</name>
+ <key>tau</key>
+ <value>75e-6</value>
+ <type>real</type>
+ </param>
+
+ <param>
+ <name>Max Deviation</name>
+ <key>max_dev</key>
+ <value>5e3</value>
+ <type>real</type>
+ </param>
+
+ <check>($quad_rate)%($audio_rate) == 0</check>
+
+ <sink>
+ <name>in</name>
+ <type>complex</type>
+ </sink>
+
+ <source>
+ <name>out</name>
+ <type>float</type>
+ </source>
</block>
diff --git a/gr-analog/grc/analog_nbfm_tx.xml b/gr-analog/grc/analog_nbfm_tx.xml
index 0ec4f489c9..ea13b8f1c9 100644
--- a/gr-analog/grc/analog_nbfm_tx.xml
+++ b/gr-analog/grc/analog_nbfm_tx.xml
@@ -5,44 +5,52 @@
###################################################
-->
<block>
- <name>NBFM Transmit</name>
- <key>analog_nbfm_tx</key>
- <import>from gnuradio import analog</import>
- <make>analog.nbfm_tx(
+ <name>NBFM Transmit</name>
+ <key>analog_nbfm_tx</key>
+ <import>from gnuradio import analog</import>
+ <make>analog.nbfm_tx(
audio_rate=$audio_rate,
quad_rate=$quad_rate,
tau=$tau,
max_dev=$max_dev,
-)</make>
- <param>
- <name>Audio Rate</name>
- <key>audio_rate</key>
- <type>int</type>
- </param>
- <param>
- <name>Quadrature Rate</name>
- <key>quad_rate</key>
- <type>int</type>
- </param>
- <param>
- <name>Tau</name>
- <key>tau</key>
- <value>75e-6</value>
- <type>real</type>
- </param>
- <param>
- <name>Max Deviation</name>
- <key>max_dev</key>
- <value>5e3</value>
- <type>real</type>
- </param>
- <check>($quad_rate)%($audio_rate) == 0</check>
- <sink>
- <name>in</name>
- <type>float</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
+ )</make>
+ <callback>set_max_deviation($max_dev)</callback>
+
+ <param>
+ <name>Audio Rate</name>
+ <key>audio_rate</key>
+ <type>int</type>
+ </param>
+
+ <param>
+ <name>Quadrature Rate</name>
+ <key>quad_rate</key>
+ <type>int</type>
+ </param>
+
+ <param>
+ <name>Tau</name>
+ <key>tau</key>
+ <value>75e-6</value>
+ <type>real</type>
+ </param>
+
+ <param>
+ <name>Max Deviation</name>
+ <key>max_dev</key>
+ <value>5e3</value>
+ <type>real</type>
+ </param>
+
+ <check>($quad_rate)%($audio_rate) == 0</check>
+
+ <sink>
+ <name>in</name>
+ <type>float</type>
+ </sink>
+
+ <source>
+ <name>out</name>
+ <type>complex</type>
+ </source>
</block>
diff --git a/gr-analog/python/analog/nbfm_rx.py b/gr-analog/python/analog/nbfm_rx.py
index b2c86db70f..38fbf803c8 100644
--- a/gr-analog/python/analog/nbfm_rx.py
+++ b/gr-analog/python/analog/nbfm_rx.py
@@ -57,8 +57,8 @@ class nbfm_rx(gr.hier_block2):
gr.io_signature(1, 1, gr.sizeof_float)) # Output signature
# FIXME audio_rate and quad_rate ought to be exact rationals
- audio_rate = int(audio_rate)
- quad_rate = int(quad_rate)
+ self._audio_rate = audio_rate = int(audio_rate)
+ self._quad_rate = quad_rate = int(quad_rate)
if quad_rate % audio_rate != 0:
raise ValueError, "quad_rate is not an integer multiple of audio_rate"
@@ -88,3 +88,7 @@ class nbfm_rx(gr.hier_block2):
self.audio_filter = filter.fir_filter_fff(audio_decim, audio_taps)
self.connect(self, self.quad_demod, self.deemph, self.audio_filter, self)
+
+ def set_max_deviation(self, max_dev):
+ k = self._quad_rate/(2*math.pi*max_dev)
+ self.quad_demod.set_gain(k)
diff --git a/gr-analog/python/analog/nbfm_tx.py b/gr-analog/python/analog/nbfm_tx.py
index 62b56bae52..ffd539ec55 100644
--- a/gr-analog/python/analog/nbfm_tx.py
+++ b/gr-analog/python/analog/nbfm_tx.py
@@ -50,8 +50,8 @@ class nbfm_tx(gr.hier_block2):
gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
# FIXME audio_rate and quad_rate ought to be exact rationals
- audio_rate = int(audio_rate)
- quad_rate = int(quad_rate)
+ self._audio_rate = audio_rate = int(audio_rate)
+ self._quad_rate = quad_rate = int(quad_rate)
if quad_rate % audio_rate != 0:
raise ValueError, "quad_rate is not an integer multiple of audio_rate"
@@ -81,6 +81,11 @@ class nbfm_tx(gr.hier_block2):
else:
self.connect(self, self.preemph, self.modulator, self)
+ def set_max_deviation(self, max_dev):
+ k = 2 * math.pi * max_dev / self._quad_rate
+ self.modulator.set_sensitivity(k)
+
+
class ctcss_gen_f(gr.hier_block2):
def __init__(self, sample_rate, tone_freq):
diff --git a/gr-digital/lib/pfb_clock_sync_ccf_impl.cc b/gr-digital/lib/pfb_clock_sync_ccf_impl.cc
index 60ee02aea5..c8e1221c90 100644
--- a/gr-digital/lib/pfb_clock_sync_ccf_impl.cc
+++ b/gr-digital/lib/pfb_clock_sync_ccf_impl.cc
@@ -308,6 +308,9 @@ namespace gr {
// Normalize the taps
for(unsigned int i = 0; i < difftaps.size(); i++) {
difftaps[i] *= d_nfilters/pwr;
+ if(difftaps[i] != difftaps[i]) {
+ throw std::runtime_error("pfb_clock_sync_ccf::create_diff_taps produced NaN.");
+ }
}
}
diff --git a/gr-digital/lib/pfb_clock_sync_fff_impl.cc b/gr-digital/lib/pfb_clock_sync_fff_impl.cc
index 2b73aed699..beb6bf5579 100644
--- a/gr-digital/lib/pfb_clock_sync_fff_impl.cc
+++ b/gr-digital/lib/pfb_clock_sync_fff_impl.cc
@@ -287,6 +287,9 @@ namespace gr {
// Normalize the taps
for(unsigned int i = 0; i < difftaps.size(); i++) {
difftaps[i] *= d_nfilters/pwr;
+ if(difftaps[i] != difftaps[i]) {
+ throw std::runtime_error("pfb_clock_sync_fff::create_diff_taps produced NaN.");
+ }
}
}
diff --git a/gr-filter/lib/rational_resampler_base_XXX_impl.cc.t b/gr-filter/lib/rational_resampler_base_XXX_impl.cc.t
index ef98af3037..0b74e60969 100644
--- a/gr-filter/lib/rational_resampler_base_XXX_impl.cc.t
+++ b/gr-filter/lib/rational_resampler_base_XXX_impl.cc.t
@@ -154,19 +154,21 @@ namespace gr {
}
unsigned int ctr = d_ctr;
+ int count = 0;
int i = 0;
- while(i < noutput_items) {
+ while((i < noutput_items) && (count < ninput_items[0])) {
out[i++] = d_firs[ctr]->filter(in);
ctr += decimation();
while(ctr >= interpolation()) {
ctr -= interpolation();
in++;
+ count++;
}
}
d_ctr = ctr;
- consume_each(in - (@I_TYPE@*)input_items[0]);
+ consume_each(count);
return i;
}
diff --git a/gr-uhd/grc/gen_uhd_usrp_blocks.py b/gr-uhd/grc/gen_uhd_usrp_blocks.py
index 41938574b7..8658284bd5 100644
--- a/gr-uhd/grc/gen_uhd_usrp_blocks.py
+++ b/gr-uhd/grc/gen_uhd_usrp_blocks.py
@@ -437,7 +437,7 @@ When a nonempty string is given, the USRP sink will look for length tags \\
to determine transmit burst lengths.
See the UHD manual for more detailed documentation:
-http://code.ettus.com/redmine/ettus/projects/uhd/wiki
+http://uhd.ettus.com
</doc>
</block>
"""
diff --git a/gr-utils/python/utils/plot_fft_base.py b/gr-utils/python/utils/plot_fft_base.py
index 4afdc3a360..c4bc484d97 100755
--- a/gr-utils/python/utils/plot_fft_base.py
+++ b/gr-utils/python/utils/plot_fft_base.py
@@ -30,7 +30,7 @@ except ImportError:
try:
from pylab import *
except ImportError:
- print "Please install Matplotlib to run this script (http://matplotlib.sourceforge.net/)"
+ print "Please install Python Matplotlib (http://matplotlib.sourceforge.net/) and Python TkInter https://wiki.python.org/moin/TkInter to run this script"
raise SystemExit, 1
from optparse import OptionParser
diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py
index b9135418a3..7766a0a853 100644
--- a/grc/gui/ActionHandler.py
+++ b/grc/gui/ActionHandler.py
@@ -115,10 +115,6 @@ class ActionHandler:
# Initialize/Quit
##################################################
if action == Actions.APPLICATION_INITIALIZE:
- if ParseXML.xml_failures:
- Messages.send_xml_errors_if_any(ParseXML.xml_failures)
- Actions.XML_PARSER_ERRORS_DISPLAY.set_sensitive(True)
-
if not self.init_file_paths:
self.init_file_paths = filter(os.path.exists, Preferences.get_open_files())
if not self.init_file_paths: self.init_file_paths = ['']
@@ -131,7 +127,8 @@ class ActionHandler:
self.main_window.btwin.search_entry.hide()
# Disable all actions, then re-enable a few
- for action in Actions.get_all_actions(): action.set_sensitive(False) #set all actions disabled
+ for action in Actions.get_all_actions():
+ action.set_sensitive(False) # set all actions disabled
for action in (
Actions.APPLICATION_QUIT, Actions.FLOW_GRAPH_NEW,
Actions.FLOW_GRAPH_OPEN, Actions.FLOW_GRAPH_SAVE_AS,
@@ -150,6 +147,9 @@ class ActionHandler:
action.set_sensitive(True)
if hasattr(action, 'load_from_preferences'):
action.load_from_preferences()
+ if ParseXML.xml_failures:
+ Messages.send_xml_errors_if_any(ParseXML.xml_failures)
+ Actions.XML_PARSER_ERRORS_DISPLAY.set_sensitive(True)
elif action == Actions.APPLICATION_QUIT:
if self.main_window.close_pages():