summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2016-03-30 22:45:25 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2016-03-30 22:45:25 -0700
commit6ac74a242c12b7e759403176c757b3042a67d0d1 (patch)
tree370d863f9462408962b75debdc35b56e07afde43
parent3ac8785ed446b434c273ee25ff1e4d3e0705137b (diff)
parent5e383b0b6ef90cc555803856b82609dca6f8186a (diff)
Merge branch 'master' into next
-rw-r--r--docs/exploring-gnuradio/fm_tx.grc4
-rwxr-xr-xgr-analog/examples/fmtest.py3
-rw-r--r--gr-analog/grc/analog_fm_preemph.xml8
-rw-r--r--gr-analog/grc/analog_nbfm_tx.xml8
-rw-r--r--gr-analog/grc/analog_wfm_tx.xml7
-rw-r--r--gr-analog/python/analog/fm_emph.py254
-rw-r--r--gr-analog/python/analog/nbfm_tx.py5
-rw-r--r--gr-analog/python/analog/wfm_tx.py5
-rw-r--r--gr-blocks/include/gnuradio/blocks/head.h2
-rw-r--r--gr-blocks/lib/head_impl.h2
-rw-r--r--gr-digital/lib/correlate_access_code_bb_ts_impl.cc4
-rw-r--r--gr-digital/lib/correlate_access_code_ff_ts_impl.cc4
-rwxr-xr-xgr-filter/examples/synth_to_chan.py2
-rwxr-xr-xgr-uhd/examples/python/fm_tx4.py3
-rw-r--r--gr-utils/python/modtool/gr-newmod/CMakeLists.txt1
-rw-r--r--gr-utils/python/modtool/gr-newmod/cmake/Modules/GrMiscUtils.cmake3
16 files changed, 253 insertions, 62 deletions
diff --git a/docs/exploring-gnuradio/fm_tx.grc b/docs/exploring-gnuradio/fm_tx.grc
index 2f047bf09b..bb13417a6b 100644
--- a/docs/exploring-gnuradio/fm_tx.grc
+++ b/docs/exploring-gnuradio/fm_tx.grc
@@ -792,6 +792,10 @@
<value>75e3</value>
</param>
<param>
+ <key>fh</key>
+ <value>0.925 * tx_rate/2.0</value>
+ </param>
+ <param>
<key>affinity</key>
<value></value>
</param>
diff --git a/gr-analog/examples/fmtest.py b/gr-analog/examples/fmtest.py
index 327da8eacb..7ed08cafbe 100755
--- a/gr-analog/examples/fmtest.py
+++ b/gr-analog/examples/fmtest.py
@@ -48,7 +48,8 @@ class fmtx(gr.hier_block2):
gr.io_signature(1, 1, gr.sizeof_float),
gr.io_signature(1, 1, gr.sizeof_gr_complex))
- fmtx = analog.nbfm_tx(audio_rate, if_rate, max_dev=5e3, tau=75e-6)
+ fmtx = analog.nbfm_tx(audio_rate, if_rate, max_dev=5e3,
+ tau=75e-6, fh=0.925*if_rate/2.0)
# Local oscillator
lo = analog.sig_source_c(if_rate, # sample rate
diff --git a/gr-analog/grc/analog_fm_preemph.xml b/gr-analog/grc/analog_fm_preemph.xml
index fb898b87f3..a754ce9c6f 100644
--- a/gr-analog/grc/analog_fm_preemph.xml
+++ b/gr-analog/grc/analog_fm_preemph.xml
@@ -8,7 +8,7 @@
<name>FM Preemphasis</name>
<key>analog_fm_preemph</key>
<import>from gnuradio import analog</import>
- <make>analog.fm_preemph(fs=$samp_rate, tau=$tau)</make>
+ <make>analog.fm_preemph(fs=$samp_rate, tau=$tau, fh=$fh)</make>
<param>
<name>Sample Rate</name>
<key>samp_rate</key>
@@ -20,6 +20,12 @@
<value>75e-6</value>
<type>real</type>
</param>
+ <param>
+ <name>High Corner Freq</name>
+ <key>fh</key>
+ <value>-1.0</value>
+ <type>real</type>
+ </param>
<sink>
<name>in</name>
<type>float</type>
diff --git a/gr-analog/grc/analog_nbfm_tx.xml b/gr-analog/grc/analog_nbfm_tx.xml
index ea13b8f1c9..bc80fffbcb 100644
--- a/gr-analog/grc/analog_nbfm_tx.xml
+++ b/gr-analog/grc/analog_nbfm_tx.xml
@@ -13,6 +13,7 @@
quad_rate=$quad_rate,
tau=$tau,
max_dev=$max_dev,
+ fh=$fh,
)</make>
<callback>set_max_deviation($max_dev)</callback>
@@ -42,6 +43,13 @@
<type>real</type>
</param>
+ <param>
+ <name>Preemphasis High Corner Freq</name>
+ <key>fh</key>
+ <value>-1.0</value>
+ <type>real</type>
+ </param>
+
<check>($quad_rate)%($audio_rate) == 0</check>
<sink>
diff --git a/gr-analog/grc/analog_wfm_tx.xml b/gr-analog/grc/analog_wfm_tx.xml
index 89844f9ef3..507c2ea894 100644
--- a/gr-analog/grc/analog_wfm_tx.xml
+++ b/gr-analog/grc/analog_wfm_tx.xml
@@ -13,6 +13,7 @@
quad_rate=$quad_rate,
tau=$tau,
max_dev=$max_dev,
+ fh=$fh,
)</make>
<param>
<name>Audio Rate</name>
@@ -36,6 +37,12 @@
<value>75e3</value>
<type>real</type>
</param>
+ <param>
+ <name>Preemphasis High Corner Freq</name>
+ <key>fh</key>
+ <value>-1.0</value>
+ <type>real</type>
+ </param>
<check>($quad_rate)%($audio_rate) == 0</check>
<sink>
<name>in</name>
diff --git a/gr-analog/python/analog/fm_emph.py b/gr-analog/python/analog/fm_emph.py
index d2a38d4aff..bfa4742ace 100644
--- a/gr-analog/python/analog/fm_emph.py
+++ b/gr-analog/python/analog/fm_emph.py
@@ -21,17 +21,78 @@
from gnuradio import gr, filter
import math
+import cmath
#
-# 1
-# H(s) = -------
-# 1 + s
+# An analog deemphasis filter:
#
-# tau is the RC time constant.
-# critical frequency: w_p = 1/tau
+# R
+# o------/\/\/\/---+----o
+# |
+# = C
+# |
+# ---
#
-# We prewarp and use the bilinear z-transform to get our IIR coefficients.
-# See "Digital Signal Processing: A Practical Approach" by Ifeachor and Jervis
+# Has this transfer function:
+#
+# 1 1
+# ---- ---
+# RC tau
+# H(s) = ---------- = ----------
+# 1 1
+# s + ---- s + ---
+# RC tau
+#
+# And has its -3 dB response, due to the pole, at
+#
+# |H(j w_c)|^2 = 1/2 => s = j w_c = j (1/(RC))
+#
+# Historically, this corner frequency of analog audio deemphasis filters
+# been specified by the RC time constant used, called tau.
+# So w_c = 1/tau.
+#
+# FWIW, for standard tau values, some standard analog components would be:
+# tau = 75 us = (50K)(1.5 nF) = (50 ohms)(1.5 uF)
+# tau = 50 us = (50K)(1.0 nF) = (50 ohms)(1.0 uF)
+#
+# In specifying tau for this digital deemphasis filter, tau specifies
+# the *digital* corner frequency, w_c, desired.
+#
+# The digital deemphasis filter design below, uses the
+# "bilinear transformation" method of designing digital filters:
+#
+# 1. Convert digitial specifications into the analog domain, by prewarping
+# digital frequency specifications into analog frequencies.
+#
+# w_a = (2/T)tan(wT/2)
+#
+# 2. Use an analog filter design technique to design the filter.
+#
+# 3. Use the bilinear transformation to convert the analog filter design to a
+# digital filter design.
+#
+# H(z) = H(s)|
+# s = (2/T)(1-z^-1)/(1+z^-1)
+#
+#
+# w_ca 1 1 - (-1) z^-1
+# H(z) = ---- * ----------- * -----------------------
+# 2 fs -w_ca -w_ca
+# 1 - ----- 1 + -----
+# 2 fs 2 fs
+# 1 - ----------- z^-1
+# -w_ca
+# 1 - -----
+# 2 fs
+#
+# We use this design technique, because it is an easy way to obtain a filter
+# design with the -6 dB/octave roll-off required of the deemphasis filter.
+#
+# Jackson, Leland B., _Digital_Filters_and_Signal_Processing_Second_Edition_,
+# Kluwer Academic Publishers, 1989, pp 201-212
+#
+# Orfanidis, Sophocles J., _Introduction_to_Signal_Processing_, Prentice Hall,
+# 1996, pp 573-583
#
@@ -51,15 +112,24 @@ class fm_deemph(gr.hier_block2):
gr.io_signature(1, 1, gr.sizeof_float), # Input signature
gr.io_signature(1, 1, gr.sizeof_float)) # Output signature
- w_p = 1/tau
- w_pp = math.tan(w_p / (fs * 2)) # prewarped analog freq
+ # Digital corner frequency
+ w_c = 1.0 / tau
+
+ # Prewarped analog corner frequency
+ w_ca = 2.0 * fs * math.tan(w_c / (2.0 * fs))
- a1 = (w_pp - 1)/(w_pp + 1)
- b0 = w_pp/(1 + w_pp)
- b1 = b0
+ # Resulting digital pole, zero, and gain term from the bilinear
+ # transformation of H(s) = w_ca / (s + w_ca) to
+ # H(z) = b0 (1 - z1 z^-1)/(1 - p1 z^-1)
+ k = -w_ca / (2.0 * fs)
+ z1 = -1.0
+ p1 = (1.0 + k) / (1.0 - k)
+ b0 = -k / (1.0 - k)
- btaps = [b0, b1]
- ataps = [1, a1]
+ btaps = [ b0 * 1.0, b0 * -z1 ]
+ ataps = [ 1.0, -p1 ]
+
+ # Since H(s = 0) = 1.0, then H(z = 1) = 1.0 and has 0 dB gain at DC
if 0:
print "btaps =", btaps
@@ -67,26 +137,17 @@ class fm_deemph(gr.hier_block2):
global plot1
plot1 = gru.gnuplot_freqz(gru.freqz(btaps, ataps), fs, True)
- deemph = filter.iir_filter_ffd(btaps, ataps)
+ deemph = filter.iir_filter_ffd(btaps, ataps, False)
self.connect(self, deemph, self)
#
-# 1 + s*t1
-# H(s) = ----------
-# 1 + s*t2
-#
-# I think this is the right transfer function.
-#
+# An analog preemphasis filter, that flattens out again at the high end:
#
-# This fine ASCII rendition is based on Figure 5-15
-# in "Digital and Analog Communication Systems", Leon W. Couch II
-#
-#
-# R1
+# C
# +-----||------+
# | |
# o------+ +-----+--------o
-# | C1 | |
+# | R1 | |
# +----/\/\/\/--+ \
# /
# \ R2
@@ -95,28 +156,94 @@ class fm_deemph(gr.hier_block2):
# |
# o--------------------------+--------o
#
-# f1 = 1/(2*pi*t1) = 1/(2*pi*R1*C)
+# (This fine ASCII rendition is based on Figure 5-15
+# in "Digital and Analog Communication Systems", Leon W. Couch II)
+#
+# Has this transfer function:
#
-# 1 R1 + R2
-# f2 = ------- = ------------
-# 2*pi*t2 2*pi*R1*R2*C
+# 1
+# s + ---
+# R1C
+# H(s) = ------------------
+# 1 R1
+# s + --- (1 + --)
+# R1C R2
#
-# t1 is 75us in US, 50us in EUR
-# f2 should be higher than our audio bandwidth.
#
+# It has a corner due to the numerator, where the rise starts, at
#
-# The Bode plot looks like this:
+# |Hn(j w_cl)|^2 = 2*|Hn(0)|^2 => s = j w_cl = j (1/(R1C))
#
+# It has a corner due to the denominator, where it levels off again, at
#
-# /----------------
-# /
-# / <-- slope = 20dB/decade
-# /
-# -------------/
-# f1 f2
+# |Hn(j w_ch)|^2 = 1/2*|Hd(0)|^2 => s = j w_ch = j (1/(R1C) * (1 + R1/R2))
#
-# We prewarp and use the bilinear z-transform to get our IIR coefficients.
-# See "Digital Signal Processing: A Practical Approach" by Ifeachor and Jervis
+# Historically, the corner frequency of analog audio preemphasis filters
+# been specified by the R1C time constant used, called tau.
+#
+# So
+# w_cl = 1/tau = 1/R1C; f_cl = 1/(2*pi*tau) = 1/(2*pi*R1*C)
+# w_ch = 1/tau2 = (1+R1/R2)/R1C; f_ch = 1/(2*pi*tau2) = (1+R1/R2)/(2*pi*R1*C)
+#
+# and note f_ch = f_cl * (1 + R1/R2).
+#
+# For broadcast FM audio, tau is 75us in the United States and 50us in Europe.
+# f_ch should be higher than our digital audio bandwidth.
+#
+# The Bode plot looks like this:
+#
+#
+# /----------------
+# /
+# / <-- slope = 20dB/decade
+# /
+# -------------/
+# f_cl f_ch
+#
+# In specifying tau for this digital preemphasis filter, tau specifies
+# the *digital* corner frequency, w_cl, desired.
+#
+# The digital preemphasis filter design below, uses the
+# "bilinear transformation" method of designing digital filters:
+#
+# 1. Convert digitial specifications into the analog domain, by prewarping
+# digital frequency specifications into analog frequencies.
+#
+# w_a = (2/T)tan(wT/2)
+#
+# 2. Use an analog filter design technique to design the filter.
+#
+# 3. Use the bilinear transformation to convert the analog filter design to a
+# digital filter design.
+#
+# H(z) = H(s)|
+# s = (2/T)(1-z^-1)/(1+z^-1)
+#
+#
+# -w_cla
+# 1 + ------
+# 2 fs
+# 1 - ------------ z^-1
+# -w_cla -w_cla
+# 1 - ------ 1 - ------
+# 2 fs 2 fs
+# H(z) = ------------ * -----------------------
+# -w_cha -w_cha
+# 1 - ------ 1 + ------
+# 2 fs 2 fs
+# 1 - ------------ z^-1
+# -w_cha
+# 1 - ------
+# 2 fs
+#
+# We use this design technique, because it is an easy way to obtain a filter
+# design with the 6 dB/octave rise required of the premphasis filter.
+#
+# Jackson, Leland B., _Digital_Filters_and_Signal_Processing_Second_Edition_,
+# Kluwer Academic Publishers, 1989, pp 201-212
+#
+# Orfanidis, Sophocles J., _Introduction_to_Signal_Processing_, Prentice Hall,
+# 1996, pp 573-583
#
@@ -124,21 +251,52 @@ class fm_preemph(gr.hier_block2):
"""
FM Preemphasis IIR filter.
"""
- def __init__(self, fs, tau=75e-6):
+ def __init__(self, fs, tau=75e-6, fh=-1.0):
"""
Args:
fs: sampling frequency in Hz (float)
tau: Time constant in seconds (75us in US, 50us in EUR) (float)
+ fh: High frequency at which to flatten out (< 0 means default of 0.925*fs/2.0) (float)
"""
- gr.hier_block2.__init__(self, "fm_deemph",
+ gr.hier_block2.__init__(self, "fm_preemph",
gr.io_signature(1, 1, gr.sizeof_float), # Input signature
gr.io_signature(1, 1, gr.sizeof_float)) # Output signature
- # FIXME make this compute the right answer
+ # Set fh to something sensible, if needed.
+ # N.B. fh == fs/2.0 or fh == 0.0 results in a pole on the unit circle
+ # at z = -1.0 or z = 1.0 respectively. That makes the filter unstable
+ # and useless.
+ if fh <= 0.0 or fh >= fs/2.0:
+ fh = 0.925 * fs/2.0
+
+ # Digital corner frequencies
+ w_cl = 1.0 / tau
+ w_ch = 2.0 * math.pi * fh
+
+ # Prewarped analog corner frequencies
+ w_cla = 2.0 * fs * math.tan(w_cl / (2.0 * fs))
+ w_cha = 2.0 * fs * math.tan(w_ch / (2.0 * fs))
+
+ # Resulting digital pole, zero, and gain term from the bilinear
+ # transformation of H(s) = (s + w_cla) / (s + w_cha) to
+ # H(z) = b0 (1 - z1 z^-1)/(1 - p1 z^-1)
+ kl = -w_cla / (2.0 * fs)
+ kh = -w_cha / (2.0 * fs)
+ z1 = (1.0 + kl) / (1.0 - kl)
+ p1 = (1.0 + kh) / (1.0 - kh)
+ b0 = (1.0 - kl) / (1.0 - kh)
+
+ # Since H(s = infinity) = 1.0, then H(z = -1) = 1.0 and
+ # this filter has 0 dB gain at fs/2.0.
+ # That isn't what users are going to expect, so adjust with a
+ # gain, g, so that H(z = 1) = 1.0 for 0 dB gain at DC.
+ w_0dB = 2.0 * math.pi * 0.0
+ g = abs(1.0 - p1 * cmath.rect(1.0, -w_0dB)) \
+ / (b0 * abs(1.0 - z1 * cmath.rect(1.0, -w_0dB)))
- btaps = [1]
- ataps = [1]
+ btaps = [ g * b0 * 1.0, g * b0 * -z1 ]
+ ataps = [ 1.0, -p1 ]
if 0:
print "btaps =", btaps
@@ -146,5 +304,5 @@ class fm_preemph(gr.hier_block2):
global plot2
plot2 = gru.gnuplot_freqz(gru.freqz(btaps, ataps), fs, True)
- preemph = filter.iir_filter_ffd(btaps, ataps)
+ preemph = filter.iir_filter_ffd(btaps, ataps, False)
self.connect(self, preemph, self)
diff --git a/gr-analog/python/analog/nbfm_tx.py b/gr-analog/python/analog/nbfm_tx.py
index ffd539ec55..aa6c1eccc7 100644
--- a/gr-analog/python/analog/nbfm_tx.py
+++ b/gr-analog/python/analog/nbfm_tx.py
@@ -29,7 +29,7 @@ except ImportError:
import analog_swig as analog
class nbfm_tx(gr.hier_block2):
- def __init__(self, audio_rate, quad_rate, tau=75e-6, max_dev=5e3):
+ def __init__(self, audio_rate, quad_rate, tau=75e-6, max_dev=5e3, fh=-1.0):
"""
Narrow Band FM Transmitter.
@@ -41,6 +41,7 @@ class nbfm_tx(gr.hier_block2):
quad_rate: sample rate of output stream (integer)
tau: preemphasis time constant (default 75e-6) (float)
max_dev: maximum deviation in Hz (default 5e3) (float)
+ fh: high frequency at which to flatten preemphasis; < 0 means default of 0.925*quad_rate/2.0 (float)
quad_rate must be an integer multiple of audio_rate.
"""
@@ -71,7 +72,7 @@ class nbfm_tx(gr.hier_block2):
#print "len(interp_taps) =", len(interp_taps)
self.interpolator = filter.interp_fir_filter_fff (interp_factor, interp_taps)
- self.preemph = fm_preemph(quad_rate, tau=tau)
+ self.preemph = fm_preemph(quad_rate, tau=tau, fh=fh)
k = 2 * math.pi * max_dev / quad_rate
self.modulator = analog.frequency_modulator_fc(k)
diff --git a/gr-analog/python/analog/wfm_tx.py b/gr-analog/python/analog/wfm_tx.py
index be662310db..a1b589350d 100644
--- a/gr-analog/python/analog/wfm_tx.py
+++ b/gr-analog/python/analog/wfm_tx.py
@@ -30,7 +30,7 @@ except ImportError:
import analog_swig as analog
class wfm_tx(gr.hier_block2):
- def __init__(self, audio_rate, quad_rate, tau=75e-6, max_dev=75e3):
+ def __init__(self, audio_rate, quad_rate, tau=75e-6, max_dev=75e3, fh=-1.0):
"""
Wide Band FM Transmitter.
@@ -42,6 +42,7 @@ class wfm_tx(gr.hier_block2):
quad_rate: sample rate of output stream (integer)
tau: preemphasis time constant (default 75e-6) (float)
max_dev: maximum deviation in Hz (default 75e3) (float)
+ fh: high frequency at which to flatten preemphasis; < 0 means default of 0.925*quad_rate/2.0 (float)
quad_rate must be an integer multiple of audio_rate.
"""
@@ -71,7 +72,7 @@ class wfm_tx(gr.hier_block2):
print "len(interp_taps) =", len(interp_taps)
self.interpolator = filter.interp_fir_filter_fff (interp_factor, interp_taps)
- self.preemph = fm_preemph(quad_rate, tau=tau)
+ self.preemph = fm_preemph(quad_rate, tau=tau, fh=fh)
k = 2 * math.pi * max_dev / quad_rate
self.modulator = analog.frequency_modulator_fc (k)
diff --git a/gr-blocks/include/gnuradio/blocks/head.h b/gr-blocks/include/gnuradio/blocks/head.h
index 24772a43fa..a41137c023 100644
--- a/gr-blocks/include/gnuradio/blocks/head.h
+++ b/gr-blocks/include/gnuradio/blocks/head.h
@@ -47,7 +47,7 @@ namespace gr {
uint64_t nitems);
virtual void reset() = 0;
- virtual void set_length(int nitems) = 0;
+ virtual void set_length(uint64_t nitems) = 0;
};
} /* namespace blocks */
diff --git a/gr-blocks/lib/head_impl.h b/gr-blocks/lib/head_impl.h
index fe2918c404..4a2c33864b 100644
--- a/gr-blocks/lib/head_impl.h
+++ b/gr-blocks/lib/head_impl.h
@@ -39,7 +39,7 @@ namespace gr {
~head_impl();
void reset() { d_ncopied_items = 0; }
- void set_length(int nitems) { d_nitems = nitems; }
+ void set_length(uint64_t nitems) { d_nitems = nitems; }
int work(int noutput_items,
gr_vector_const_void_star &input_items,
diff --git a/gr-digital/lib/correlate_access_code_bb_ts_impl.cc b/gr-digital/lib/correlate_access_code_bb_ts_impl.cc
index c04bf4e180..e2fe37d8bb 100644
--- a/gr-digital/lib/correlate_access_code_bb_ts_impl.cc
+++ b/gr-digital/lib/correlate_access_code_bb_ts_impl.cc
@@ -84,8 +84,8 @@ namespace gr {
if(d_len > 64)
return false;
- // set len top bits to 1.
- d_mask = ((~0ULL) >> (64 - d_len)) << (64 - d_len);
+ // set len least significant bits to 1.
+ d_mask = ((~0ULL) >> (64 - d_len));
d_access_code = 0;
for(unsigned i=0; i < d_len; i++){
diff --git a/gr-digital/lib/correlate_access_code_ff_ts_impl.cc b/gr-digital/lib/correlate_access_code_ff_ts_impl.cc
index 86bbb686d5..dfbac40505 100644
--- a/gr-digital/lib/correlate_access_code_ff_ts_impl.cc
+++ b/gr-digital/lib/correlate_access_code_ff_ts_impl.cc
@@ -84,8 +84,8 @@ namespace gr {
if(d_len > 64)
return false;
- // set len top bits to 1.
- d_mask = ((~0ULL) >> (64 - d_len)) << (64 - d_len);
+ // set len least significant bits to 1.
+ d_mask = ((~0ULL) >> (64 - d_len));
d_access_code = 0;
for(unsigned i=0; i < d_len; i++){
diff --git a/gr-filter/examples/synth_to_chan.py b/gr-filter/examples/synth_to_chan.py
index 9e682021b7..88fb080a65 100755
--- a/gr-filter/examples/synth_to_chan.py
+++ b/gr-filter/examples/synth_to_chan.py
@@ -54,7 +54,7 @@ def main():
fmtx = list()
for fi in freqs:
s = analog.sig_source_f(fs, analog.GR_SIN_WAVE, fi, 1)
- fm = analog.nbfm_tx(fs, 4*fs, max_dev=10000, tau=75e-6)
+ fm = analog.nbfm_tx(fs, 4*fs, max_dev=10000, tau=75e-6, fh=0.925*(4*fs)/2.0)
sigs.append(s)
fmtx.append(fm)
diff --git a/gr-uhd/examples/python/fm_tx4.py b/gr-uhd/examples/python/fm_tx4.py
index fefa67861b..516033dae1 100755
--- a/gr-uhd/examples/python/fm_tx4.py
+++ b/gr-uhd/examples/python/fm_tx4.py
@@ -63,7 +63,8 @@ class pipeline(gr.hier_block2):
sys.exit(1)
print audio_rate, if_rate
- fmtx = analog.nbfm_tx(audio_rate, if_rate, max_dev=5e3, tau=75e-6)
+ fmtx = analog.nbfm_tx(audio_rate, if_rate, max_dev=5e3,
+ tau=75e-6, fh=0.925*if_rate/2.0)
# Local oscillator
lo = analog.sig_source_c(if_rate, # sample rate
diff --git a/gr-utils/python/modtool/gr-newmod/CMakeLists.txt b/gr-utils/python/modtool/gr-newmod/CMakeLists.txt
index 0513f44086..9b41b99f14 100644
--- a/gr-utils/python/modtool/gr-newmod/CMakeLists.txt
+++ b/gr-utils/python/modtool/gr-newmod/CMakeLists.txt
@@ -112,6 +112,7 @@ find_package(Doxygen)
# API compatible version required.
set(GR_REQUIRED_COMPONENTS RUNTIME)
find_package(Gnuradio "3.7.2" REQUIRED)
+list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
if(NOT CPPUNIT_FOUND)
message(FATAL_ERROR "CppUnit required to compile howto")
diff --git a/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrMiscUtils.cmake b/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrMiscUtils.cmake
index 188c40480b..5bad57c51e 100644
--- a/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrMiscUtils.cmake
+++ b/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrMiscUtils.cmake
@@ -363,6 +363,7 @@ macro(GR_EXPAND_X_H component root)
import sys, os, re
sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+sys.path.append('${CMAKE_SOURCE_DIR}/python')
os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
@@ -406,6 +407,7 @@ macro(GR_EXPAND_X_CC_H component root)
import sys, os, re
sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+sys.path.append('${CMAKE_SOURCE_DIR}/python')
os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
@@ -466,6 +468,7 @@ macro(GR_EXPAND_X_CC_H_IMPL component root)
import sys, os, re
sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+sys.path.append('${CMAKE_SOURCE_DIR}/python')
os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
os.chdir('${CMAKE_CURRENT_BINARY_DIR}')