summaryrefslogtreecommitdiff
path: root/gr-uhd
diff options
context:
space:
mode:
Diffstat (limited to 'gr-uhd')
-rw-r--r--gr-uhd/CMakeLists.txt2
-rwxr-xr-xgr-uhd/apps/uhd_rx_nogui43
-rw-r--r--gr-uhd/doc/uhd.dox4
-rwxr-xr-xgr-uhd/examples/python/fm_tx4.py24
-rwxr-xr-xgr-uhd/examples/python/fm_tx_2_daughterboards.py42
-rwxr-xr-xgr-uhd/examples/python/usrp_am_mw_rcv.py42
-rwxr-xr-xgr-uhd/examples/python/usrp_nbfm_ptt.py21
-rwxr-xr-xgr-uhd/examples/python/usrp_nbfm_rcv.py24
-rwxr-xr-xgr-uhd/examples/python/usrp_wfm_rcv.py32
-rwxr-xr-xgr-uhd/examples/python/usrp_wfm_rcv2_nogui.py22
-rwxr-xr-xgr-uhd/examples/python/usrp_wfm_rcv_fmdet.py32
-rwxr-xr-xgr-uhd/examples/python/usrp_wfm_rcv_nogui.py26
-rwxr-xr-xgr-uhd/examples/python/usrp_wfm_rcv_pll.py24
-rwxr-xr-xgr-uhd/examples/python/usrp_wfm_rcv_sca.py74
-rwxr-xr-xgr-uhd/examples/python/usrp_wxapt_rcv.py26
15 files changed, 230 insertions, 208 deletions
diff --git a/gr-uhd/CMakeLists.txt b/gr-uhd/CMakeLists.txt
index 8d5c3a8849..23fef3a485 100644
--- a/gr-uhd/CMakeLists.txt
+++ b/gr-uhd/CMakeLists.txt
@@ -32,6 +32,8 @@ GR_REGISTER_COMPONENT("gr-uhd" ENABLE_GR_UHD
Boost_FOUND
UHD_FOUND
ENABLE_GR_CORE
+ ENABLE_GR_FILTER
+ ENABLE_GR_ANALOG
)
GR_SET_GLOBAL(GR_UHD_INCLUDE_DIRS
diff --git a/gr-uhd/apps/uhd_rx_nogui b/gr-uhd/apps/uhd_rx_nogui
index cb6238353e..c348ba23f5 100755
--- a/gr-uhd/apps/uhd_rx_nogui
+++ b/gr-uhd/apps/uhd_rx_nogui
@@ -20,7 +20,8 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru, uhd, optfir, audio, blks2
+from gnuradio import gr, gru, uhd, audio, blks2
+from gnuradio import filter
from gnuradio import analog
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
@@ -70,9 +71,9 @@ blocks.
# (device_rate, channel_rate, audio_rate, channel_pass, channel_stop, demod)
demod_params = {
- 'AM' : (256e3, 16e3, 16e3, 5000, 8000, blks2.demod_10k0a3e_cf),
- 'FM' : (256e3, 32e3, 8e3, 8000, 9000, blks2.demod_20k0f3e_cf),
- 'WFM' : (320e3, 320e3, 32e3, 80000, 115000, blks2.demod_200kf3e_cf)
+ 'AM' : (256e3, 16e3, 16e3, 5000, 8000, analog.demod_10k0a3e_cf),
+ 'FM' : (256e3, 32e3, 8e3, 8000, 9000, analog.demod_20k0f3e_cf),
+ 'WFM' : (320e3, 320e3, 32e3, 80000, 115000, analog.demod_200kf3e_cf)
}
class uhd_src(gr.hier_block2):
@@ -105,7 +106,7 @@ class uhd_src(gr.hier_block2):
# Resampler to get to exactly samp_rate no matter what dev_rate is
self._rrate = samp_rate / dev_rate
- self._resamp = blks2.pfb_arb_resampler_ccf(self._rrate)
+ self._resamp = filter.pfb.arb_resampler_ccf(self._rrate)
# If no gain specified, set to midrange
gain_range = self._src.get_gain_range()
@@ -143,22 +144,22 @@ class app_top_block(gr.top_block):
channel_decim = int(if_rate // channel_rate)
audio_decim = int(channel_rate // audio_rate)
- CHAN_taps = optfir.low_pass(1.0, # Filter gain
- if_rate, # Sample rate
- channel_pass, # One sided modulation bandwidth
- channel_stop, # One sided channel bandwidth
- 0.1, # Passband ripple
- 60) # Stopband attenuation
+ CHAN_taps = filter.optfir.low_pass(1.0, # Filter gain
+ if_rate, # Sample rate
+ channel_pass, # One sided modulation bandwidth
+ channel_stop, # One sided channel bandwidth
+ 0.1, # Passband ripple
+ 60) # Stopband attenuation
- CHAN = gr.freq_xlating_fir_filter_ccf(channel_decim, # Decimation rate
- CHAN_taps, # Filter taps
- 0.0, # Offset frequency
- if_rate) # Sample rate
+ CHAN = filter.freq_xlating_fir_filter_ccf(channel_decim, # Decimation rate
+ CHAN_taps, # Filter taps
+ 0.0, # Offset frequency
+ if_rate) # Sample rate
- RFSQL = gr.pwr_squelch_cc(options.rf_squelch, # Power threshold
- 125.0/channel_rate, # Time constant
- int(channel_rate/20), # 50ms rise/fall
- False) # Zero, not gate output
+ RFSQL = analog.pwr_squelch_cc(options.rf_squelch, # Power threshold
+ 125.0/channel_rate, # Time constant
+ int(channel_rate/20), # 50ms rise/fall
+ False) # Zero, not gate output
AGC = analog.agc_cc(1.0/channel_rate, # Time constant
1.0, # Reference power
@@ -174,8 +175,8 @@ class app_top_block(gr.top_block):
# Optionally add CTCSS and RSAMP if needed
tail = DEMOD
if options.ctcss != None and options.ctcss > 60.0:
- CTCSS = gr.ctcss_squelch_ff(audio_rate, # Sample rate
- options.ctcss) # Squelch tone
+ CTCSS = analog.ctcss_squelch_ff(audio_rate, # Sample rate
+ options.ctcss) # Squelch tone
self.connect(DEMOD, CTCSS)
tail = CTCSS
diff --git a/gr-uhd/doc/uhd.dox b/gr-uhd/doc/uhd.dox
index f03705fe18..4cd30a86b6 100644
--- a/gr-uhd/doc/uhd.dox
+++ b/gr-uhd/doc/uhd.dox
@@ -92,10 +92,10 @@ resampler to take care of the difference.
actual_rate = self.u.get_samp_rate()
resample = desired_rate / actual_rate
- # Use the blks2 version and pass only the resample factor.
+ # Use the filter.pfb version and pass only the resample factor.
# This block builds a half-band filter for you
- self.resampler = blks2.pfb_arb_resampler_ccf(resample)
+ self.resampler = filter.pfb.arb_resampler_ccf(resample)
\endcode
*/
diff --git a/gr-uhd/examples/python/fm_tx4.py b/gr-uhd/examples/python/fm_tx4.py
index 255b436f56..ae3e1b94f3 100755
--- a/gr-uhd/examples/python/fm_tx4.py
+++ b/gr-uhd/examples/python/fm_tx4.py
@@ -34,7 +34,7 @@ audio_to_file.py
from gnuradio import gr, eng_notation
from gnuradio import uhd
-from gnuradio import blks2
+from gnuradio import analog
from gnuradio.eng_option import eng_option
from optparse import OptionParser
import math
@@ -62,19 +62,19 @@ class pipeline(gr.hier_block2):
sys.exit(1)
print audio_rate, if_rate
- fmtx = blks2.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)
# Local oscillator
- lo = gr.sig_source_c (if_rate, # sample rate
- gr.GR_SIN_WAVE, # waveform type
- lo_freq, #frequency
- 1.0, # amplitude
- 0) # DC Offset
- mixer = gr.multiply_cc ()
-
- self.connect (src, fmtx, (mixer, 0))
- self.connect (lo, (mixer, 1))
- self.connect (mixer, self)
+ lo = analog.sig_source_c(if_rate, # sample rate
+ analog.GR_SIN_WAVE, # waveform type
+ lo_freq, # frequency
+ 1.0, # amplitude
+ 0) # DC Offset
+ mixer = gr.multiply_cc()
+
+ self.connect(src, fmtx, (mixer, 0))
+ self.connect(lo, (mixer, 1))
+ self.connect(mixer, self)
class fm_tx_block(stdgui2.std_top_block):
def __init__(self, frame, panel, vbox, argv):
diff --git a/gr-uhd/examples/python/fm_tx_2_daughterboards.py b/gr-uhd/examples/python/fm_tx_2_daughterboards.py
index d98d655ab1..f896be6d04 100755
--- a/gr-uhd/examples/python/fm_tx_2_daughterboards.py
+++ b/gr-uhd/examples/python/fm_tx_2_daughterboards.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005-2007,2011 Free Software Foundation, Inc.
+# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -30,7 +30,9 @@ Side A is 600 Hz tone.
Side B is 350 + 440 Hz tones.
"""
-from gnuradio import gr, uhd, blks2
+from gnuradio import gr, uhd
+from gnuradio import filter
+from gnuradio import analog
from gnuradio.eng_notation import num_to_str, str_to_num
from gnuradio.eng_option import eng_option
from optparse import OptionParser
@@ -47,11 +49,11 @@ class example_signal_0(gr.hier_block2):
gr.io_signature(0, 0, 0), # Input signature
gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
- src = gr.sig_source_c (sample_rate, # sample rate
- gr.GR_SIN_WAVE, # waveform type
- 600, # frequency
- 1.0, # amplitude
- 0) # DC Offset
+ src = analog.sig_source_c(sample_rate, # sample rate
+ analog.GR_SIN_WAVE, # waveform type
+ 600, # frequency
+ 1.0, # amplitude
+ 0) # DC Offset
self.connect(src, self)
@@ -65,17 +67,17 @@ class example_signal_1(gr.hier_block2):
gr.io_signature(0, 0, 0), # Input signature
gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
- src0 = gr.sig_source_c (sample_rate, # sample rate
- gr.GR_SIN_WAVE, # waveform type
- 350, # frequency
- 1.0, # amplitude
- 0) # DC Offset
-
- src1 = gr.sig_source_c (sample_rate, # sample rate
- gr.GR_SIN_WAVE, # waveform type
- 440, # frequency
- 1.0, # amplitude
- 0) # DC Offset
+ src0 = analog.sig_source_c(sample_rate, # sample rate
+ analog.GR_SIN_WAVE, # waveform type
+ 350, # frequency
+ 1.0, # amplitude
+ 0) # DC Offset
+
+ src1 = analog.sig_source_c(sample_rate, # sample rate
+ analog.GR_SIN_WAVE, # waveform type
+ 440, # frequency
+ 1.0, # amplitude
+ 0) # DC Offset
sum = gr.add_cc()
self.connect(src0, (sum, 0))
self.connect(src1, (sum, 1))
@@ -86,7 +88,7 @@ class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
- usage="%prog: [options] tx-freq0 tx-freq1"
+ usage = "%prog: [options] tx-freq0 tx-freq1"
parser = OptionParser (option_class=eng_option, usage=usage)
parser.add_option("-a", "--args", type="string", default="",
help="UHD device address args [default=%default]")
@@ -158,7 +160,7 @@ class my_top_block(gr.top_block):
# Correct for any difference in requested and actual rates
rrate = self.usrp_rate / dev_rate
- resamp = blks2.pfb_arb_resampler_ccf(rrate)
+ resamp = filter.pfb.arb_resampler_ccf(rrate)
# and wire them up
self.connect(intl, resamp, self.u)
diff --git a/gr-uhd/examples/python/usrp_am_mw_rcv.py b/gr-uhd/examples/python/usrp_am_mw_rcv.py
index 6965ef5af9..a389e173f8 100755
--- a/gr-uhd/examples/python/usrp_am_mw_rcv.py
+++ b/gr-uhd/examples/python/usrp_am_mw_rcv.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005-2007,2011 Free Software Foundation, Inc.
+# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,11 +20,11 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, eng_notation, optfir
+from gnuradio import gr, eng_notation
+from gnuradio import filter
from gnuradio import analog
from gnuradio import audio
from gnuradio import uhd
-from gnuradio import blks2
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import slider, powermate
from gnuradio.wxgui import stdgui2, fftsink2, form
@@ -97,36 +97,36 @@ class wfm_rx_block (stdgui2.std_top_block):
# Resample signal to exactly self.usrp_rate
# FIXME: make one of the follow-on filters an arb resampler
rrate = usrp_rate / dev_rate
- self.resamp = blks2.pfb_arb_resampler_ccf(rrate)
+ self.resamp = filter.pfb.arb_resampler_ccf(rrate)
- chan_filt_coeffs = gr.firdes.low_pass_2 (1, # gain
- usrp_rate, # sampling rate
- 8e3, # passband cutoff
- 4e3, # transition bw
- 60) # stopband attenuation
+ chan_filt_coeffs = filter.firdes.low_pass_2(1, # gain
+ usrp_rate, # sampling rate
+ 8e3, # passband cutoff
+ 4e3, # transition bw
+ 60) # stopband attenuation
if self.use_IF:
# Turn If to baseband and filter.
- self.chan_filt = gr.freq_xlating_fir_filter_ccf (chanfilt_decim,
- chan_filt_coeffs,
- self.IF_freq,
- usrp_rate)
+ self.chan_filt = filter.freq_xlating_fir_filter_ccf(chanfilt_decim,
+ chan_filt_coeffs,
+ self.IF_freq,
+ usrp_rate)
else:
- self.chan_filt = gr.fir_filter_ccf (chanfilt_decim, chan_filt_coeffs)
+ self.chan_filt = filter.fir_filter_ccf(chanfilt_decim, chan_filt_coeffs)
self.agc = analog.agc_cc(0.1, 1, 1, 100000)
self.am_demod = gr.complex_to_mag()
self.volume_control = gr.multiply_const_ff(self.vol)
- audio_filt_coeffs = gr.firdes.low_pass_2 (1, # gain
- demod_rate, # sampling rate
- 8e3, # passband cutoff
- 2e3, # transition bw
- 60) # stopband attenuation
- self.audio_filt=gr.fir_filter_fff(audio_decim, audio_filt_coeffs)
+ audio_filt_coeffs = filter.firdes.low_pass_2(1, # gain
+ demod_rate, # sampling rate
+ 8e3, # passband cutoff
+ 2e3, # transition bw
+ 60) # stopband attenuation
+ self.audio_filt = filter.fir_filter_fff(audio_decim, audio_filt_coeffs)
# sound card as final sink
- self.audio_sink = audio.sink (int (audio_rate),
+ self.audio_sink = audio.sink(int (audio_rate),
options.audio_output,
False) # ok_to_block
diff --git a/gr-uhd/examples/python/usrp_nbfm_ptt.py b/gr-uhd/examples/python/usrp_nbfm_ptt.py
index af4c214795..d377e3a0a2 100755
--- a/gr-uhd/examples/python/usrp_nbfm_ptt.py
+++ b/gr-uhd/examples/python/usrp_nbfm_ptt.py
@@ -25,7 +25,8 @@ import sys
import wx
from optparse import OptionParser
-from gnuradio import gr, audio, blks2, uhd
+from gnuradio import gr, audio, uhd
+from gnuradio import analog
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import stdgui2, fftsink2, scopesink2, slider, form
@@ -317,15 +318,15 @@ class transmit_path(gr.hier_block2):
audio_taps = convolve(array(lpf),array(hpf))
self.audio_filt = gr.fir_filter_fff(1,audio_taps)
- self.pl = blks2.ctcss_gen_f(self.audio_rate,123.0)
+ self.pl = analog.ctcss_gen_f(self.audio_rate,123.0)
self.add_pl = gr.add_ff()
self.connect(self.pl,(self.add_pl,1))
- self.fmtx = blks2.nbfm_tx(self.audio_rate, self.if_rate)
+ self.fmtx = analog.nbfm_tx(self.audio_rate, self.if_rate)
self.amp = gr.multiply_const_cc (self.normal_gain)
rrate = dev_rate / self.if_rate
- self.resamp = blks2.pfb_arb_resampler_ccf(rrate)
+ self.resamp = filter.pfb.arb_resampler_ccf(rrate)
self.connect(self.audio, self.audio_amp, self.audio_filt,
(self.add_pl,0), self.fmtx, self.amp,
@@ -395,23 +396,23 @@ class receive_path(gr.hier_block2):
gr.firdes.WIN_HANN) # filter type
rrate = self.quad_rate / dev_rate
- self.resamp = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
+ self.resamp = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts)
# instantiate the guts of the single channel receiver
- self.fmrx = blks2.nbfm_rx(self.audio_rate, self.quad_rate)
+ self.fmrx = analog.nbfm_rx(self.audio_rate, self.quad_rate)
# standard squelch block
- self.squelch = blks2.standard_squelch(self.audio_rate)
+ self.squelch = analog.standard_squelch(self.audio_rate)
# audio gain / mute block
self._audio_gain = gr.multiply_const_ff(1.0)
# sound card as final sink
- audio_sink = audio.sink (int(self.audio_rate), audio_output)
+ audio_sink = audio.sink(int(self.audio_rate), audio_output)
# now wire it all together
- self.connect (self.u, self.resamp, self.fmrx, self.squelch,
- self._audio_gain, audio_sink)
+ self.connect(self.u, self.resamp, self.fmrx, self.squelch,
+ self._audio_gain, audio_sink)
if gain is None:
# if no gain was specified, use the mid-point in dB
diff --git a/gr-uhd/examples/python/usrp_nbfm_rcv.py b/gr-uhd/examples/python/usrp_nbfm_rcv.py
index 4a8340ec7b..1a06e7d06d 100755
--- a/gr-uhd/examples/python/usrp_nbfm_rcv.py
+++ b/gr-uhd/examples/python/usrp_nbfm_rcv.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2007,2011 Free Software Foundation, Inc.
+# Copyright 2005,2007,2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,7 +20,9 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, audio, blks2, uhd
+from gnuradio import gr, audio, uhd
+from gnuradio import filter
+from gnuradio import analog
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import slider, powermate
from gnuradio.wxgui import stdgui2, fftsink2, form
@@ -285,21 +287,21 @@ class receive_path(gr.hier_block2):
# Create filter to get actual channel we want
nfilts = 32
- chan_coeffs = gr.firdes.low_pass (nfilts, # gain
- nfilts*dev_rate, # sampling rate
- 8e3, # low pass cutoff freq
- 2e3, # width of trans. band
- gr.firdes.WIN_HANN) # filter type
+ chan_coeffs = filter.firdes.low_pass(nfilts, # gain
+ nfilts*dev_rate, # sampling rate
+ 8e3, # low pass cutoff freq
+ 2e3, # width of trans. band
+ filter.firdes.WIN_HANN) # filter type
rrate = self.quad_rate / dev_rate
- self.resamp = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
+ self.resamp = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts)
if USE_SIMPLE_SQUELCH:
- self.squelch = gr.simple_squelch_cc(20)
+ self.squelch = analog.simple_squelch_cc(20)
else:
- self.squelch = blks2.standard_squelch(self.audio_rate)
+ self.squelch = analog.standard_squelch(self.audio_rate)
# instantiate the guts of the single channel receiver
- self.fmrx = blks2.nbfm_rx(self.audio_rate, self.quad_rate)
+ self.fmrx = analog.nbfm_rx(self.audio_rate, self.quad_rate)
# audio gain / mute block
self._audio_gain = gr.multiply_const_ff(1.0)
diff --git a/gr-uhd/examples/python/usrp_wfm_rcv.py b/gr-uhd/examples/python/usrp_wfm_rcv.py
index a7d114d8cc..824af8975c 100755
--- a/gr-uhd/examples/python/usrp_wfm_rcv.py
+++ b/gr-uhd/examples/python/usrp_wfm_rcv.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005-2007,2009,2011 Free Software Foundation, Inc.
+# Copyright 2005-2007,2009,2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,7 +20,9 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, optfir, audio, blks2, uhd
+from gnuradio import gr, optfir, audio, uhd
+from gnuradio import filter
+from gnuradio import analog
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import slider, powermate
from gnuradio.wxgui import stdgui2, fftsink2, form
@@ -88,27 +90,27 @@ class wfm_rx_block (stdgui2.std_top_block):
dev_rate = self.u.get_samp_rate()
nfilts = 32
- chan_coeffs = optfir.low_pass (nfilts, # gain
- nfilts*usrp_rate, # sampling rate
- 80e3, # passband cutoff
- 115e3, # stopband cutoff
- 0.1, # passband ripple
- 60) # stopband attenuation
+ chan_coeffs = filter.optfir.low_pass(nfilts, # gain
+ nfilts*usrp_rate, # sampling rate
+ 80e3, # passband cutoff
+ 115e3, # stopband cutoff
+ 0.1, # passband ripple
+ 60) # stopband attenuation
rrate = usrp_rate / dev_rate
- self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
+ self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts)
- self.guts = blks2.wfm_rcv (demod_rate, audio_decim)
+ self.guts = analog.wfm_rcv(demod_rate, audio_decim)
self.volume_control = gr.multiply_const_ff(self.vol)
# sound card as final sink
- self.audio_sink = audio.sink (int (audio_rate),
- options.audio_output,
- False) # ok_to_block
+ self.audio_sink = audio.sink(int (audio_rate),
+ options.audio_output,
+ False) # ok_to_block
# now wire it all together
- self.connect (self.u, self.chan_filt, self.guts,
- self.volume_control, self.audio_sink)
+ self.connect(self.u, self.chan_filt, self.guts,
+ self.volume_control, self.audio_sink)
self._build_gui(vbox, usrp_rate, demod_rate, audio_rate)
diff --git a/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py b/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py
index f7e72ae6f9..e76c78e017 100755
--- a/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py
+++ b/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005-2007,2011 Free Software Foundation, Inc.
+# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,7 +20,9 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, optfir, audio, blks2, uhd
+from gnuradio import gr, audio, uhd
+from gnuradio import filter
+from gnuradio import analog
from gnuradio.eng_option import eng_option
from optparse import OptionParser
import sys
@@ -94,12 +96,12 @@ class wfm_rx_block (gr.top_block):
# taps for channel filter
nfilts = 32
- chan_coeffs = optfir.low_pass (nfilts, # gain
- nfilts*usrp_rate, # sampling rate
- 80e3, # passband cutoff
- 115e3, # stopband cutoff
- 0.1, # passband ripple
- 60) # stopband attenuation
+ chan_coeffs = filter.optfir.low_pass(nfilts, # gain
+ nfilts*usrp_rate, # sampling rate
+ 80e3, # passband cutoff
+ 115e3, # stopband cutoff
+ 0.1, # passband ripple
+ 60) # stopband attenuation
rrate = usrp_rate / dev_rate
# set front end PLL to middle frequency
@@ -111,8 +113,8 @@ class wfm_rx_block (gr.top_block):
options.gain = float(g.start()+g.stop())/2.0
for n in range(2):
- chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
- guts = blks2.wfm_rcv (demod_rate, audio_decim)
+ chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts)
+ guts = analog.wfm_rcv(demod_rate, audio_decim)
volume_control = gr.multiply_const_ff(self.vol)
#self.connect((self.di, n), chan_filt)
diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py b/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py
index b794825727..97bd2b2d32 100755
--- a/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py
+++ b/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005-2007,2011 Free Software Foundation, Inc.
+# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,7 +20,9 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, optfir, audio, blks2, uhd
+from gnuradio import gr, audio, uhd
+from gnuradio import filter
+from gnuradio import analog
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import slider, powermate
from gnuradio.wxgui import stdgui2, fftsink2, form, scopesink2
@@ -90,31 +92,31 @@ class wfm_rx_block (stdgui2.std_top_block):
dev_rate = self.u.get_samp_rate()
nfilts = 32
- chan_coeffs = gr.firdes.low_pass_2(10*nfilts, # gain
- nfilts*usrp_rate, # sampling rate
- 90e3, # passband cutoff
- 30e3, # transition bw
- 70) # stopband attenuation
+ chan_coeffs = filter.firdes.low_pass_2(10*nfilts, # gain
+ nfilts*usrp_rate, # sampling rate
+ 90e3, # passband cutoff
+ 30e3, # transition bw
+ 70) # stopband attenuation
rrate = usrp_rate / dev_rate
- self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
+ self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts)
- self.guts = blks2.wfm_rcv_fmdet (demod_rate, audio_decim)
+ self.guts = analog.wfm_rcv_fmdet (demod_rate, audio_decim)
chan_rate = audio_rate / (demod_rate/audio_decim)
- self.rchan_filt = blks2.pfb_arb_resampler_fff(chan_rate)
- self.lchan_filt = blks2.pfb_arb_resampler_fff(chan_rate)
+ self.rchan_filt = filter.pfb.arb_resampler_fff(chan_rate)
+ self.lchan_filt = filter.pfb.arb_resampler_fff(chan_rate)
# FIXME rework {add,multiply}_const_* to handle multiple streams
self.volume_control_l = gr.multiply_const_ff(self.vol)
self.volume_control_r = gr.multiply_const_ff(self.vol)
# sound card as final sink
- self.audio_sink = audio.sink (int (audio_rate),
- options.audio_output,
- False) # ok_to_block
+ self.audio_sink = audio.sink(int (audio_rate),
+ options.audio_output,
+ False) # ok_to_block
# now wire it all together
- self.connect (self.u, self.chan_filt, self.guts)
+ self.connect(self.u, self.chan_filt, self.guts)
self.connect((self.guts, 0), self.lchan_filt,
self.volume_control_l, (self.audio_sink,0))
self.connect((self.guts, 1), self.rchan_filt,
diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py b/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py
index 6e9c830c61..f2271fb6db 100755
--- a/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py
+++ b/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005-2007,2011 Free Software Foundation, Inc.
+# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,7 +20,9 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, optfir, audio, blks2, uhd
+from gnuradio import gr, optfir, audio, uhd
+from gnuradio import filter
+from gnuradio import analog
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from optparse import OptionParser
@@ -82,16 +84,16 @@ class wfm_rx_block (gr.top_block):
dev_rate = self.u.get_samp_rate()
nfilts = 32
- chan_coeffs = optfir.low_pass (nfilts, # gain
- nfilts*usrp_rate, # sampling rate
- 80e3, # passband cutoff
- 115e3, # stopband cutoff
- 0.1, # passband ripple
- 60) # stopband attenuation
+ chan_coeffs = filter.optfir.low_pass(nfilts, # gain
+ nfilts*usrp_rate, # sampling rate
+ 80e3, # passband cutoff
+ 115e3, # stopband cutoff
+ 0.1, # passband ripple
+ 60) # stopband attenuation
rrate = usrp_rate / dev_rate
- self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
+ self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts)
- self.guts = blks2.wfm_rcv (demod_rate, audio_decim)
+ self.guts = analog.wfm_rcv(demod_rate, audio_decim)
self.volume_control = gr.multiply_const_ff(1)
@@ -101,8 +103,8 @@ class wfm_rx_block (gr.top_block):
False) # ok_to_block
# now wire it all together
- self.connect (self.u, self.chan_filt, self.guts,
- self.volume_control, self.audio_sink)
+ self.connect(self.u, self.chan_filt, self.guts,
+ self.volume_control, self.audio_sink)
if options.gain is None:
# if no gain was specified, use the mid-point in dB
diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_pll.py b/gr-uhd/examples/python/usrp_wfm_rcv_pll.py
index a5c78cb24b..8cd3d5ab13 100755
--- a/gr-uhd/examples/python/usrp_wfm_rcv_pll.py
+++ b/gr-uhd/examples/python/usrp_wfm_rcv_pll.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005-2007,2011 Free Software Foundation, Inc.
+# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,7 +20,9 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, optfir, audio, blks2, uhd
+from gnuradio import gr, audio, uhd
+from gnuradio import filter
+from gnuradio import analog
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import slider, powermate
@@ -90,20 +92,20 @@ class wfm_rx_block (stdgui2.std_top_block):
dev_rate = self.u.get_samp_rate()
nfilts = 32
- chan_coeffs = gr.firdes.low_pass_2 (nfilts, # gain
- nfilts*usrp_rate, # sampling rate
- 90e3, # passband cutoff
- 30e3, # stopband cutoff
- 70) # stopband attenuation
+ chan_coeffs = filter.firdes.low_pass_2(nfilts, # gain
+ nfilts*usrp_rate, # sampling rate
+ 90e3, # passband cutoff
+ 30e3, # stopband cutoff
+ 70) # stopband attenuation
rrate = usrp_rate / dev_rate
- self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
+ self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts)
- self.guts = blks2.wfm_rcv_pll (demod_rate, audio_decim)
+ self.guts = analog.wfm_rcv_pll(demod_rate, audio_decim)
chan_rate = audio_rate / (demod_rate/audio_decim)
- self.rchan_filt = blks2.pfb_arb_resampler_fff(chan_rate)
- self.lchan_filt = blks2.pfb_arb_resampler_fff(chan_rate)
+ self.rchan_filt = filter.pfb.arb_resampler_fff(chan_rate)
+ self.lchan_filt = filter.pfb.arb_resampler_fff(chan_rate)
# FIXME rework {add,multiply}_const_* to handle multiple streams
self.volume_control_l = gr.multiply_const_ff(self.vol)
diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_sca.py b/gr-uhd/examples/python/usrp_wfm_rcv_sca.py
index 0e93e22fcd..68ff27ff30 100755
--- a/gr-uhd/examples/python/usrp_wfm_rcv_sca.py
+++ b/gr-uhd/examples/python/usrp_wfm_rcv_sca.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2006,2007,2011 Free Software Foundation, Inc.
+# Copyright 2006,2007,2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -50,7 +50,9 @@ OFDM.
"""
-from gnuradio import gr, optfir, audio, blks2, uhd
+from gnuradio import gr, audio, uhd
+from gnuradio import filter
+from gnuradio import analog
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import slider, powermate
from gnuradio.wxgui import stdgui2, fftsink2, form
@@ -121,19 +123,19 @@ class wfm_rx_sca_block (stdgui2.std_top_block):
dev_rate = self.u.get_samp_rate()
nfilts = 32
- chan_coeffs = optfir.low_pass (nfilts, # gain
- nfilts*usrp_rate, # sampling rate
- 100e3, # passband cutoff
- 140e3, # stopband cutoff
- 0.1, # passband ripple
- 60) # stopband attenuation
+ chan_coeffs = filter.optfir.low_pass(nfilts, # gain
+ nfilts*usrp_rate, # sampling rate
+ 100e3, # passband cutoff
+ 140e3, # stopband cutoff
+ 0.1, # passband ripple
+ 60) # stopband attenuation
rrate = usrp_rate / dev_rate
- self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
-
+ self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts)
+
#Create demodulator block for Main FM Channel
max_dev = 75e3
fm_demod_gain = demod_rate/(2*math.pi*max_dev)
- self.fm_demod = gr.quadrature_demod_cf (fm_demod_gain)
+ self.fm_demod = analog.quadrature_demod_cf(fm_demod_gain)
# Note - deemphasis is not applied to the Main FM Channel as
# main audio is not decoded
@@ -143,20 +145,20 @@ class wfm_rx_sca_block (stdgui2.std_top_block):
max_sca_dev = 6e3
# Create filter to get SCA channel we want
- sca_chan_coeffs = gr.firdes.low_pass (1.0, # gain
- demod_rate, # sampling rate
- max_sca_dev, # cutoff freq
- max_sca_dev/3, # trans. band
- gr.firdes.WIN_HANN) # filter type
+ sca_chan_coeffs = filter.firdes.low_pass(1.0, # gain
+ demod_rate, # sampling rate
+ max_sca_dev, # cutoff freq
+ max_sca_dev/3, # trans. band
+ analog.firdes.WIN_HANN) # filter type
- self.ddc = gr.freq_xlating_fir_filter_fcf(sca_chanfilt_decim, # decim rate
- sca_chan_coeffs, # taps
- 0, # freq translation amount (Gets set by the UI)
- demod_rate) # input sample rate
+ self.ddc = filter.freq_xlating_fir_filter_fcf(sca_chanfilt_decim, # decim rate
+ sca_chan_coeffs, # taps
+ 0, # freq translation amount (Gets set by the UI)
+ demod_rate) # input sample rate
#Create demodulator block for SCA Channel
sca_demod_gain = sca_demod_rate/(2*math.pi*max_sca_dev)
- self.fm_demod_sca = gr.quadrature_demod_cf (sca_demod_gain)
+ self.fm_demod_sca = analog.quadrature_demod_cf(sca_demod_gain)
# SCA analog audio is bandwidth limited to 5 KHz
@@ -166,31 +168,31 @@ class wfm_rx_sca_block (stdgui2.std_top_block):
sca_tau = 150e-6
# compute FIR filter taps for SCA audio filter
- audio_coeffs = gr.firdes.low_pass (1.0, # gain
- sca_demod_rate, # sampling rate
- max_sca_audio_freq, # cutoff freq
- max_sca_audio_freq/2.5, # trans. band
- gr.firdes.WIN_HAMMING)
+ audio_coeffs = filter.firdes.low_pass(1.0, # gain
+ sca_demod_rate, # sampling rate
+ max_sca_audio_freq, # cutoff freq
+ max_sca_audio_freq/2.5, # trans. band
+ filter.firdes.WIN_HAMMING)
# input: float; output: float
- self.audio_filter = gr.fir_filter_fff (audio_decim, audio_coeffs)
+ self.audio_filter = filter.fir_filter_fff(audio_decim, audio_coeffs)
# Create deemphasis block that is applied after SCA demodulation
- self.deemph = blks2.fm_deemph (audio_rate, sca_tau)
+ self.deemph = analog.fm_deemph(audio_rate, sca_tau)
self.volume_control = gr.multiply_const_ff(self.vol)
# sound card as final sink
- self.audio_sink = audio.sink (int (audio_rate),
- options.audio_output,
- False) # ok_to_block
+ self.audio_sink = audio.sink(int (audio_rate),
+ options.audio_output,
+ False) # ok_to_block
# now wire it all together
- self.connect (self.u, self.chan_filt, self.fm_demod,
- self.ddc, self.fm_demod_sca)
- self.connect (self.fm_demod_sca, self.audio_filter,
- self.deemph, self.volume_control,
- self.audio_sink)
+ self.connect(self.u, self.chan_filt, self.fm_demod,
+ self.ddc, self.fm_demod_sca)
+ self.connect(self.fm_demod_sca, self.audio_filter,
+ self.deemph, self.volume_control,
+ self.audio_sink)
self._build_gui(vbox, usrp_rate, demod_rate, sca_demod_rate, audio_rate)
diff --git a/gr-uhd/examples/python/usrp_wxapt_rcv.py b/gr-uhd/examples/python/usrp_wxapt_rcv.py
index 5cceca1e98..ef774e2a07 100755
--- a/gr-uhd/examples/python/usrp_wxapt_rcv.py
+++ b/gr-uhd/examples/python/usrp_wxapt_rcv.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005-2007,2011 Free Software Foundation, Inc.
+# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,7 +20,9 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, audio, blks2, uhd
+from gnuradio import gr, audio, uhd
+from gnuradio import filter
+from gnuradio import analog
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import slider, powermate
from gnuradio.wxgui import stdgui2, fftsink2, form
@@ -88,24 +90,24 @@ class wxapt_rx_block (stdgui2.std_top_block):
dev_rate = self.u.get_samp_rate()
nfilts = 32
- chan_coeffs = gr.firdes.low_pass_2 (nfilts, # gain
- nfilts*usrp_rate, # sampling rate
- 40e3, # passband cutoff
- 20e3, # transition bw
- 60) # stopband attenuation
+ chan_coeffs = filter.firdes.low_pass_2(nfilts, # gain
+ nfilts*usrp_rate, # sampling rate
+ 40e3, # passband cutoff
+ 20e3, # transition bw
+ 60) # stopband attenuation
rrate = usrp_rate / dev_rate
- self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
+ self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts)
- self.guts = blks2.wfm_rcv (demod_rate, audio_decim)
+ self.guts = analog.wfm_rcv(demod_rate, audio_decim)
self.volume_control = gr.multiply_const_ff(self.vol)
# sound card as final sink
- self.audio_sink = audio.sink (int (audio_rate), options.audio_output)
+ self.audio_sink = audio.sink(int (audio_rate), options.audio_output)
# now wire it all together
- self.connect (self.u, self.chan_filt, self.guts,
- self.volume_control, self.audio_sink)
+ self.connect(self.u, self.chan_filt, self.guts,
+ self.volume_control, self.audio_sink)
self._build_gui(vbox, usrp_rate, demod_rate, audio_rate)