diff options
Diffstat (limited to 'gr-uhd')
36 files changed, 797 insertions, 642 deletions
diff --git a/gr-uhd/CMakeLists.txt b/gr-uhd/CMakeLists.txt index 38624b8712..252229d2a7 100644 --- a/gr-uhd/CMakeLists.txt +++ b/gr-uhd/CMakeLists.txt @@ -32,6 +32,9 @@ GR_REGISTER_COMPONENT("gr-uhd" ENABLE_GR_UHD Boost_FOUND UHD_FOUND ENABLE_GR_CORE + ENABLE_GR_FILTER + ENABLE_GR_BLOCKS + ENABLE_GR_ANALOG ) GR_SET_GLOBAL(GR_UHD_INCLUDE_DIRS diff --git a/gr-uhd/apps/hf_explorer/hfx.py b/gr-uhd/apps/hf_explorer/hfx.py index 1f08bd8ba6..15962f9e4d 100755 --- a/gr-uhd/apps/hf_explorer/hfx.py +++ b/gr-uhd/apps/hf_explorer/hfx.py @@ -81,6 +81,9 @@ import os, wx, sys, math import wx.lib.evtmgr as em from gnuradio.wxgui import powermate, fftsink2 from gnuradio import gr, audio, eng_notation +from gnuradio import analog +from gnuradio import filter +from gnuradio import blocks from gnuradio.eng_option import eng_option from gnuradio import uhd from optparse import OptionParser @@ -256,10 +259,10 @@ class MyFrame(wx.Frame): self.tune_offset = 2200 # 2200 works for 3.5-4Mhz band # convert rf data in interleaved short int form to complex - s2ss = gr.stream_to_streams(gr.sizeof_short,2) - s2f1 = gr.short_to_float() - s2f2 = gr.short_to_float() - src_f2c = gr.float_to_complex() + s2ss = blocks.stream_to_streams(gr.sizeof_short,2) + s2f1 = blocks.short_to_float() + s2f2 = blocks.short_to_float() + src_f2c = blocks.float_to_complex() self.tb.connect(self.src,s2ss) self.tb.connect((s2ss,0),s2f1) self.tb.connect((s2ss,1),s2f2) @@ -272,23 +275,23 @@ class MyFrame(wx.Frame): self.tb.connect (self.src, radio_file) # 2nd DDC - xlate_taps = gr.firdes.low_pass ( \ - 1.0, input_rate, 16e3, 4e3, gr.firdes.WIN_HAMMING ) - self.xlate = gr.freq_xlating_fir_filter_ccf ( \ + xlate_taps = filter.firdes.low_pass ( \ + 1.0, input_rate, 16e3, 4e3, filter.firdes.WIN_HAMMING ) + self.xlate = filter.freq_xlating_fir_filter_ccf ( \ fir_decim, xlate_taps, self.tune_offset, input_rate ) # Complex Audio filter - audio_coeffs = gr.firdes.complex_band_pass ( + audio_coeffs = filter.firdes.complex_band_pass ( 1.0, # gain self.af_sample_rate, # sample rate -3000, # low cutoff 0, # high cutoff 100, # transition - gr.firdes.WIN_HAMMING) # window + filter.firdes.WIN_HAMMING) # window self.slider_fcutoff_hi.SetValue(0) self.slider_fcutoff_lo.SetValue(-3000) - self.audio_filter = gr.fir_filter_ccc(1, audio_coeffs) + self.audio_filter = filter.fir_filter_ccc(1, audio_coeffs) # Main +/- 16Khz spectrum display self.fft = fftsink2.fft_sink_c(self.panel_2, fft_size=512, @@ -305,43 +308,43 @@ class MyFrame(wx.Frame): c2f = gr.complex_to_float() # AM branch - self.sel_am = gr.multiply_const_cc(0) + self.sel_am = blocks.multiply_const_cc(0) # the following frequencies turn out to be in radians/sample - # gr.pll_refout_cc(alpha,beta,min_freq,max_freq) + # analog.pll_refout_cc(alpha,beta,min_freq,max_freq) # suggested alpha = X, beta = .25 * X * X - pll = gr.pll_refout_cc(.5,.0625,(2.*math.pi*7.5e3/self.af_sample_rate), - (2.*math.pi*6.5e3/self.af_sample_rate)) - self.pll_carrier_scale = gr.multiply_const_cc(complex(10,0)) - am_det = gr.multiply_cc() + pll = analog.pll_refout_cc(.5,.0625,(2.*math.pi*7.5e3/self.af_sample_rate), + (2.*math.pi*6.5e3/self.af_sample_rate)) + self.pll_carrier_scale = blocks.multiply_const_cc(complex(10,0)) + am_det = blocks.multiply_cc() # these are for converting +7.5kHz to -7.5kHz - # for some reason gr.conjugate_cc() adds noise ?? + # for some reason blocks.conjugate_cc() adds noise ?? c2f2 = gr.complex_to_float() c2f3 = gr.complex_to_float() - f2c = gr.float_to_complex() - phaser1 = gr.multiply_const_ff(1) - phaser2 = gr.multiply_const_ff(-1) + f2c = blocks.float_to_complex() + phaser1 = blocks.multiply_const_ff(1) + phaser2 = blocks.multiply_const_ff(-1) # filter for pll generated carrier - pll_carrier_coeffs = gr.firdes.complex_band_pass ( + pll_carrier_coeffs = filter.firdes.complex_band_pass ( 2.0, # gain self.af_sample_rate, # sample rate 7400, # low cutoff 7600, # high cutoff 100, # transition - gr.firdes.WIN_HAMMING) # window + filter.firdes.WIN_HAMMING) # window - self.pll_carrier_filter = gr.fir_filter_ccc (1, pll_carrier_coeffs) + self.pll_carrier_filter = filter.fir_filter_ccc (1, pll_carrier_coeffs) - self.sel_sb = gr.multiply_const_ff(1) - combine = gr.add_ff() + self.sel_sb = blocks.multiply_const_ff(1) + combine = blocks.add_ff() #AGC - sqr1 = gr.multiply_ff() - intr = gr.iir_filter_ffd ( [.004, 0], [0, .999] ) - offset = gr.add_const_ff(1) - agc = gr.divide_ff() + sqr1 = blocks.multiply_ff() + intr = filter.iir_filter_ffd( [.004, 0], [0, .999] ) + offset = blocks.add_const_ff(1) + agc = blocks.divide_ff() - self.scale = gr.multiply_const_ff(0.00001) + self.scale = blocks.multiply_const_ff(0.00001) dst = audio.sink(long(self.af_sample_rate), options.audio_output) @@ -373,8 +376,8 @@ class MyFrame(wx.Frame): if SAVE_AUDIO_TO_FILE: f_out = gr.file_sink(gr.sizeof_short,options.audio_file) - sc1 = gr.multiply_const_ff(64000) - f2s1 = gr.float_to_short() + sc1 = blocks.multiply_const_ff(64000) + f2s1 = blocks.float_to_short() self.tb.connect(agc,sc1,f2s1,f_out) self.tb.start() @@ -610,13 +613,13 @@ class MyFrame(wx.Frame): # Calculate taps and apply def filter(self): - audio_coeffs = gr.firdes.complex_band_pass ( + audio_coeffs = filter.firdes.complex_band_pass ( 1.0, # gain self.af_sample_rate, # sample rate self.slider_fcutoff_lo.GetValue(), # low cutoff self.slider_fcutoff_hi.GetValue(), # high cutoff 100, # transition - gr.firdes.WIN_HAMMING) # window + filter.firdes.WIN_HAMMING) # window self.audio_filter.set_taps(audio_coeffs) def set_lsb(self, event): diff --git a/gr-uhd/apps/hf_radio/input.py b/gr-uhd/apps/hf_radio/input.py index 78e800bb6c..fd2ac47a5c 100644 --- a/gr-uhd/apps/hf_radio/input.py +++ b/gr-uhd/apps/hf_radio/input.py @@ -47,8 +47,8 @@ class uhd_input(gr.hier_block2): """ Set the center frequency. - @param target_freq: frequency in Hz - @type: bool + Args: + target_freq: frequency in Hz """ r = self.src.set_center_freq(target_freq, 0) diff --git a/gr-uhd/apps/hf_radio/output.py b/gr-uhd/apps/hf_radio/output.py index 70add5b84a..3e80c8d315 100644 --- a/gr-uhd/apps/hf_radio/output.py +++ b/gr-uhd/apps/hf_radio/output.py @@ -24,6 +24,7 @@ # M. Revnell 2005-Dec from gnuradio import gr, gru +from gnuradio import blocks from gnuradio import audio class output( gr.hier_block2 ): @@ -32,7 +33,7 @@ class output( gr.hier_block2 ): gr.io_signature(1,1,gr.sizeof_float), gr.io_signature(0,0,0)) - self.vol = gr.multiply_const_ff( 0.1 ) + self.vol = blocks.multiply_const_ff( 0.1 ) self.out = audio.sink( int(rate), device ) self.connect( self, self.vol, self.out ) diff --git a/gr-uhd/apps/hf_radio/ssbagc.py b/gr-uhd/apps/hf_radio/ssbagc.py index 6a2e0a7cd4..48cc009101 100644 --- a/gr-uhd/apps/hf_radio/ssbagc.py +++ b/gr-uhd/apps/hf_radio/ssbagc.py @@ -43,6 +43,8 @@ # M. Revnell 2006-Jan from gnuradio import gr +from gnuradio import blocks +from gnuradio import filter class agc( gr.hier_block2 ): def __init__( self ): @@ -50,13 +52,13 @@ class agc( gr.hier_block2 ): gr.io_signature(1,1,gr.sizeof_float), gr.io_signature(1,1,gr.sizeof_float)) - self.split = gr.multiply_const_ff( 1 ) - self.sqr = gr.multiply_ff( ) - self.int0 = gr.iir_filter_ffd( [.004, 0], [0, .999] ) - self.offs = gr.add_const_ff( -30 ) - self.gain = gr.multiply_const_ff( 70 ) - self.log = gr.nlog10_ff( 10, 1 ) - self.agc = gr.divide_ff( ) + self.split = blocks.multiply_const_ff( 1 ) + self.sqr = blocks.multiply_ff( ) + self.int0 = filter.iir_filter_ffd( [.004, 0], [0, .999] ) + self.offs = blocks.add_const_ff( -30 ) + self.gain = blocks.multiply_const_ff( 70 ) + self.log = blocks.nlog10_ff( 10, 1 ) + self.agc = blocks.divide_ff( ) self.connect(self, self.split) self.connect(self.split, (self.agc, 0)) diff --git a/gr-uhd/apps/hf_radio/ssbdemod.py b/gr-uhd/apps/hf_radio/ssbdemod.py index 3c533f617f..a77fb6cfcb 100644 --- a/gr-uhd/apps/hf_radio/ssbdemod.py +++ b/gr-uhd/apps/hf_radio/ssbdemod.py @@ -32,6 +32,7 @@ # M. Revnell Jan 06 from gnuradio import gr +from gnuradio import blocks class ssb_demod( gr.hier_block2 ): def __init__( self, if_rate, af_rate ): @@ -64,10 +65,10 @@ class ssb_demod( gr.hier_block2 ): self.lpf = gr.fir_filter_fff( 1, self.audio_taps ) - self.sum = gr.add_ff( ) - self.am_sel = gr.multiply_const_ff( 0 ) - self.sb_sel = gr.multiply_const_ff( 1 ) - self.mixer = gr.add_ff() + self.sum = blocks.add_ff( ) + self.am_sel = blocks.multiply_const_ff( 0 ) + self.sb_sel = blocks.multiply_const_ff( 1 ) + self.mixer = blocks.add_ff() self.am_det = gr.complex_to_mag() self.connect(self, self.xlate) diff --git a/gr-uhd/apps/uhd_rx_nogui b/gr-uhd/apps/uhd_rx_nogui index f0cfdd8bed..ea43a43be6 100755 --- a/gr-uhd/apps/uhd_rx_nogui +++ b/gr-uhd/apps/uhd_rx_nogui @@ -20,7 +20,9 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gru, uhd, optfir, audio, blks2 +from gnuradio import gr, gru, uhd, audio +from gnuradio import filter +from gnuradio import analog from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -69,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): @@ -104,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() @@ -142,27 +144,27 @@ 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 = gr.agc_cc(1.0/channel_rate, # Time constant - 1.0, # Reference power - 1.0, # Initial gain - 1.0) # Maximum gain + AGC = analog.agc_cc(1.0/channel_rate, # Time constant + 1.0, # Reference power + 1.0, # Initial gain + 1.0) # Maximum gain DEMOD = demod(channel_rate, audio_decim) @@ -173,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 @@ -182,7 +184,7 @@ class app_top_block(gr.top_block): out_lcm = gru.lcm(audio_rate, options.output_rate) out_interp = int(out_lcm // audio_rate) out_decim = int(out_lcm // options.output_rate) - RSAMP = blks2.rational_resampler_fff(out_interp, out_decim) + RSAMP = filter.rational_resampler_fff(out_interp, out_decim) self.connect(tail, RSAMP) tail = RSAMP diff --git a/gr-uhd/apps/uhd_siggen_base.py b/gr-uhd/apps/uhd_siggen_base.py index 8c69da1ccb..6b51bfcb50 100644 --- a/gr-uhd/apps/uhd_siggen_base.py +++ b/gr-uhd/apps/uhd_siggen_base.py @@ -39,6 +39,8 @@ TYPE_KEY = 'type' def setter(ps, key, val): ps[key] = val from gnuradio import gr, gru, uhd, eng_notation +from gnuradio import analog +from gnuradio import blocks from gnuradio.gr.pubsub import pubsub from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -47,10 +49,10 @@ import math n2s = eng_notation.num_to_str -waveforms = { gr.GR_SIN_WAVE : "Complex Sinusoid", - gr.GR_CONST_WAVE : "Constant", - gr.GR_GAUSSIAN : "Gaussian Noise", - gr.GR_UNIFORM : "Uniform Noise", +waveforms = { analog.GR_SIN_WAVE : "Complex Sinusoid", + analog.GR_CONST_WAVE : "Constant", + analog.GR_GAUSSIAN : "Gaussian Noise", + analog.GR_UNIFORM : "Uniform Noise", "2tone" : "Two Tone", "sweep" : "Sweep" } @@ -151,7 +153,9 @@ class top_block(gr.top_block, pubsub): def _set_tx_amplitude(self, ampl): """ Sets the transmit amplitude sent to the USRP - @param ampl the amplitude or None for automatic + + Args: + ampl: the amplitude or None for automatic """ ampl_range = self[AMPL_RANGE_KEY] if ampl is None: @@ -162,7 +166,7 @@ class top_block(gr.top_block, pubsub): self._u.set_samp_rate(sr) sr = self._u.get_samp_rate() - if self[TYPE_KEY] in (gr.GR_SIN_WAVE, gr.GR_CONST_WAVE): + if self[TYPE_KEY] in (analog.GR_SIN_WAVE, analog.GR_CONST_WAVE): self._src.set_sampling_freq(self[SAMP_RATE_KEY]) elif self[TYPE_KEY] == "2tone": self._src1.set_sampling_freq(self[SAMP_RATE_KEY]) @@ -215,7 +219,7 @@ class top_block(gr.top_block, pubsub): return tr def set_waveform_freq(self, freq): - if self[TYPE_KEY] == gr.GR_SIN_WAVE: + if self[TYPE_KEY] == analog.GR_SIN_WAVE: self._src.set_frequency(freq) elif self[TYPE_KEY] == "2tone": self._src1.set_frequency(freq) @@ -237,29 +241,29 @@ class top_block(gr.top_block, pubsub): def set_waveform(self, type): self.lock() self.disconnect_all() - if type == gr.GR_SIN_WAVE or type == gr.GR_CONST_WAVE: - self._src = gr.sig_source_c(self[SAMP_RATE_KEY], # Sample rate - type, # Waveform type - self[WAVEFORM_FREQ_KEY], # Waveform frequency - self[AMPLITUDE_KEY], # Waveform amplitude - self[WAVEFORM_OFFSET_KEY]) # Waveform offset - elif type == gr.GR_GAUSSIAN or type == gr.GR_UNIFORM: - self._src = gr.noise_source_c(type, self[AMPLITUDE_KEY]) + if type == analog.GR_SIN_WAVE or type == analog.GR_CONST_WAVE: + self._src = analog.sig_source_c(self[SAMP_RATE_KEY], # Sample rate + type, # Waveform type + self[WAVEFORM_FREQ_KEY], # Waveform frequency + self[AMPLITUDE_KEY], # Waveform amplitude + self[WAVEFORM_OFFSET_KEY]) # Waveform offset + elif type == analog.GR_GAUSSIAN or type == analog.GR_UNIFORM: + self._src = analog.noise_source_c(type, self[AMPLITUDE_KEY]) elif type == "2tone": - self._src1 = gr.sig_source_c(self[SAMP_RATE_KEY], - gr.GR_SIN_WAVE, - self[WAVEFORM_FREQ_KEY], - self[AMPLITUDE_KEY]/2.0, - 0) + self._src1 = analog.sig_source_c(self[SAMP_RATE_KEY], + analog.GR_SIN_WAVE, + self[WAVEFORM_FREQ_KEY], + self[AMPLITUDE_KEY]/2.0, + 0) if(self[WAVEFORM2_FREQ_KEY] is None): self[WAVEFORM2_FREQ_KEY] = -self[WAVEFORM_FREQ_KEY] - self._src2 = gr.sig_source_c(self[SAMP_RATE_KEY], - gr.GR_SIN_WAVE, - self[WAVEFORM2_FREQ_KEY], - self[AMPLITUDE_KEY]/2.0, - 0) - self._src = gr.add_cc() + self._src2 = analog.sig_source_c(self[SAMP_RATE_KEY], + analog.GR_SIN_WAVE, + self[WAVEFORM2_FREQ_KEY], + self[AMPLITUDE_KEY]/2.0, + 0) + self._src = blocks.add_cc() self.connect(self._src1,(self._src,0)) self.connect(self._src2,(self._src,1)) elif type == "sweep": @@ -270,13 +274,13 @@ class top_block(gr.top_block, pubsub): if self[WAVEFORM2_FREQ_KEY] is None: self[WAVEFORM2_FREQ_KEY] = 0.1 - self._src1 = gr.sig_source_f(self[SAMP_RATE_KEY], - gr.GR_TRI_WAVE, - self[WAVEFORM2_FREQ_KEY], - 1.0, - -0.5) - self._src2 = gr.frequency_modulator_fc(self[WAVEFORM_FREQ_KEY]*2*math.pi/self[SAMP_RATE_KEY]) - self._src = gr.multiply_const_cc(self[AMPLITUDE_KEY]) + self._src1 = analog.sig_source_f(self[SAMP_RATE_KEY], + analog.GR_TRI_WAVE, + self[WAVEFORM2_FREQ_KEY], + 1.0, + -0.5) + self._src2 = analog.frequency_modulator_fc(self[WAVEFORM_FREQ_KEY]*2*math.pi/self[SAMP_RATE_KEY]) + self._src = blocks.multiply_const_cc(self[AMPLITUDE_KEY]) self.connect(self._src1,self._src2,self._src) else: raise RuntimeError("Unknown waveform type") @@ -286,7 +290,7 @@ class top_block(gr.top_block, pubsub): if self._verbose: print "Set baseband modulation to:", waveforms[type] - if type == gr.GR_SIN_WAVE: + if type == analog.GR_SIN_WAVE: print "Modulation frequency: %sHz" % (n2s(self[WAVEFORM_FREQ_KEY]),) print "Initial phase:", self[WAVEFORM_OFFSET_KEY] elif type == "2tone": @@ -304,7 +308,7 @@ class top_block(gr.top_block, pubsub): print "Amplitude out of range:", amplitude return False - if self[TYPE_KEY] in (gr.GR_SIN_WAVE, gr.GR_CONST_WAVE, gr.GR_GAUSSIAN, gr.GR_UNIFORM): + if self[TYPE_KEY] in (analog.GR_SIN_WAVE, analog.GR_CONST_WAVE, analog.GR_GAUSSIAN, analog.GR_UNIFORM): self._src.set_amplitude(amplitude) elif self[TYPE_KEY] == "2tone": self._src1.set_amplitude(amplitude/2.0) @@ -339,16 +343,16 @@ def get_options(): help="Set baseband waveform frequency to FREQ [default=%default]") parser.add_option("-y", "--waveform2-freq", type="eng_float", default=None, help="Set 2nd waveform frequency to FREQ [default=%default]") - parser.add_option("--sine", dest="type", action="store_const", const=gr.GR_SIN_WAVE, + parser.add_option("--sine", dest="type", action="store_const", const=analog.GR_SIN_WAVE, help="Generate a carrier modulated by a complex sine wave", - default=gr.GR_SIN_WAVE) - parser.add_option("--const", dest="type", action="store_const", const=gr.GR_CONST_WAVE, + default=analog.GR_SIN_WAVE) + parser.add_option("--const", dest="type", action="store_const", const=analog.GR_CONST_WAVE, help="Generate a constant carrier") parser.add_option("--offset", type="eng_float", default=0, help="Set waveform phase offset to OFFSET [default=%default]") - parser.add_option("--gaussian", dest="type", action="store_const", const=gr.GR_GAUSSIAN, + parser.add_option("--gaussian", dest="type", action="store_const", const=analog.GR_GAUSSIAN, help="Generate Gaussian random output") - parser.add_option("--uniform", dest="type", action="store_const", const=gr.GR_UNIFORM, + parser.add_option("--uniform", dest="type", action="store_const", const=analog.GR_UNIFORM, help="Generate Uniform random output") parser.add_option("--2tone", dest="type", action="store_const", const="2tone", help="Generate Two Tone signal for IMD testing") diff --git a/gr-uhd/apps/uhd_siggen_gui b/gr-uhd/apps/uhd_siggen_gui index 70929b1825..80fcf8e673 100755 --- a/gr-uhd/apps/uhd_siggen_gui +++ b/gr-uhd/apps/uhd_siggen_gui @@ -22,6 +22,7 @@ import wx from gnuradio import gr, uhd +from gnuradio import analog from gnuradio.gr.pubsub import pubsub from gnuradio.wxgui import gui, forms from gnuradio.uhd import uhd_siggen_base as uhd_siggen @@ -58,7 +59,7 @@ class app_gui(pubsub): self.vbox.AddStretchSpacer() #callback to show/hide forms def set_type(type): - sine_bb_hbox.ShowItems(type == gr.GR_SIN_WAVE) + sine_bb_hbox.ShowItems(type == analog.GR_SIN_WAVE) sweep_bb_hbox.ShowItems(type == 'sweep') tone_bb_hbox.ShowItems(type == '2tone') self.vbox.Layout() 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/c++/tag_sink_demo.h b/gr-uhd/examples/c++/tag_sink_demo.h index 5417bd3242..676005e06c 100644 --- a/gr-uhd/examples/c++/tag_sink_demo.h +++ b/gr-uhd/examples/c++/tag_sink_demo.h @@ -47,7 +47,7 @@ public: //grab all "rx time" tags in this work call const uint64_t samp0_count = this->nitems_read(0); std::vector<gr_tag_t> rx_time_tags; - get_tags_in_range(rx_time_tags, 0, samp0_count, samp0_count + ninput_items, pmt::pmt_string_to_symbol("rx_time")); + get_tags_in_range(rx_time_tags, 0, samp0_count, samp0_count + ninput_items, pmt::string_to_symbol("rx_time")); //print all tags BOOST_FOREACH(const gr_tag_t &rx_time_tag, rx_time_tags){ @@ -55,8 +55,8 @@ public: const pmt::pmt_t &value = rx_time_tag.value; std::cout << boost::format("Full seconds %u, Frac seconds %f, abs sample offset %u") - % pmt::pmt_to_uint64(pmt::pmt_tuple_ref(value, 0)) - % pmt::pmt_to_double(pmt::pmt_tuple_ref(value, 1)) + % pmt::to_uint64(pmt::tuple_ref(value, 0)) + % pmt::to_double(pmt::tuple_ref(value, 1)) % offset << std::endl; } diff --git a/gr-uhd/examples/c++/tag_source_demo.h b/gr-uhd/examples/c++/tag_source_demo.h index 7d48502b24..6efe4667e5 100644 --- a/gr-uhd/examples/c++/tag_source_demo.h +++ b/gr-uhd/examples/c++/tag_source_demo.h @@ -53,26 +53,26 @@ public: } void make_time_tag(const uint64_t tag_count){; - const pmt::pmt_t key = pmt::pmt_string_to_symbol("tx_time"); - const pmt::pmt_t value = pmt::pmt_make_tuple( - pmt::pmt_from_uint64(_time_secs), - pmt::pmt_from_double(_time_fracs) + const pmt::pmt_t key = pmt::string_to_symbol("tx_time"); + const pmt::pmt_t value = pmt::make_tuple( + pmt::from_uint64(_time_secs), + pmt::from_double(_time_fracs) ); - const pmt::pmt_t srcid = pmt::pmt_string_to_symbol(this->name()); + const pmt::pmt_t srcid = pmt::string_to_symbol(this->name()); this->add_item_tag(0/*chan0*/, tag_count, key, value, srcid); } void make_sob_tag(const uint64_t tag_count){ - const pmt::pmt_t key = pmt::pmt_string_to_symbol("tx_sob"); + const pmt::pmt_t key = pmt::string_to_symbol("tx_sob"); const pmt::pmt_t value = pmt::PMT_T; - const pmt::pmt_t srcid = pmt::pmt_string_to_symbol(this->name()); + const pmt::pmt_t srcid = pmt::string_to_symbol(this->name()); this->add_item_tag(0/*chan0*/, tag_count, key, value, srcid); } void make_eob_tag(const uint64_t tag_count){; - const pmt::pmt_t key = pmt::pmt_string_to_symbol("tx_eob"); + const pmt::pmt_t key = pmt::string_to_symbol("tx_eob"); const pmt::pmt_t value = pmt::PMT_T; - const pmt::pmt_t srcid = pmt::pmt_string_to_symbol(this->name()); + const pmt::pmt_t srcid = pmt::string_to_symbol(this->name()); this->add_item_tag(0/*chan0*/, tag_count, key, value, srcid); } diff --git a/gr-uhd/examples/grc/uhd_dpsk_mod.grc b/gr-uhd/examples/grc/uhd_dpsk_mod.grc index 18ae9c3db7..9caafbb6ac 100644 --- a/gr-uhd/examples/grc/uhd_dpsk_mod.grc +++ b/gr-uhd/examples/grc/uhd_dpsk_mod.grc @@ -281,10 +281,10 @@ </param> </block> <block> - <key>gr_multiply_const_vxx</key> + <key>blocks_multiply_const_vxx</key> <param> <key>id</key> - <value>gr_multiply_const_vxx_0</value> + <value>blocks_multiply_const_vxx_0</value> </param> <param> <key>_enabled</key> @@ -2218,7 +2218,7 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_multiply_const_vxx_0</source_block_id> + <source_block_id>blocks_multiply_const_vxx_0</source_block_id> <sink_block_id>uhd_usrp_sink_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> @@ -2231,7 +2231,7 @@ </connection> <connection> <source_block_id>digital_dxpsk_mod_0</source_block_id> - <sink_block_id>gr_multiply_const_vxx_0</sink_block_id> + <sink_block_id>blocks_multiply_const_vxx_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> diff --git a/gr-uhd/examples/grc/uhd_two_tone_loopback.grc b/gr-uhd/examples/grc/uhd_two_tone_loopback.grc index 8bcbc07927..1884dd3ebf 100644 --- a/gr-uhd/examples/grc/uhd_two_tone_loopback.grc +++ b/gr-uhd/examples/grc/uhd_two_tone_loopback.grc @@ -1,6 +1,65 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Sat Oct 8 15:27:04 2011</timestamp> + <timestamp>Sat Nov 10 14:55:26 2012</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>uhd_two_tone_loopback</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value>UHD Loopback - 2 Tone</value> + </param> + <param> + <key>author</key> + <value>Example</value> + </param> + <param> + <key>description</key> + <value>Loopback test</value> + </param> + <param> + <key>window_size</key> + <value>1280, 1024</value> + </param> + <param> + <key>generate_options</key> + <value>wx_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> <block> <key>parameter</key> <param> @@ -177,53 +236,10 @@ </param> </block> <block> - <key>gr_sig_source_x</key> - <param> - <key>id</key> - <value>gr_sig_source_x</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>samp_rate</key> - <value>samp_rate</value> - </param> - <param> - <key>waveform</key> - <value>gr.GR_COS_WAVE</value> - </param> - <param> - <key>freq</key> - <value>tone1</value> - </param> - <param> - <key>amp</key> - <value>tone_ampl</value> - </param> - <param> - <key>offset</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(258, 136)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_sig_source_x</key> + <key>uhd_usrp_sink</key> <param> <key>id</key> - <value>gr_sig_source_x0</value> + <value>uhd_usrp_sink_0</value> </param> <param> <key>_enabled</key> @@ -231,160 +247,122 @@ </param> <param> <key>type</key> - <value>complex</value> - </param> - <param> - <key>samp_rate</key> - <value>samp_rate</value> - </param> - <param> - <key>waveform</key> - <value>gr.GR_COS_WAVE</value> - </param> - <param> - <key>freq</key> - <value>tone2</value> + <value>fc32</value> </param> <param> - <key>amp</key> - <value>tone_ampl</value> - </param> - <param> - <key>offset</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(259, 248)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_noise_source_x</key> - <param> - <key>id</key> - <value>gr_noise_source_x</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> + <key>otw</key> + <value></value> </param> <param> - <key>type</key> - <value>complex</value> + <key>stream_args</key> + <value></value> </param> <param> - <key>noise_type</key> - <value>gr.GR_GAUSSIAN</value> + <key>dev_addr</key> + <value>address0</value> </param> <param> - <key>amp</key> - <value>noise_ampl</value> + <key>sync</key> + <value></value> </param> <param> - <key>seed</key> - <value>42</value> + <key>clock_rate</key> + <value>0.0</value> </param> <param> - <key>_coordinate</key> - <value>(279, 364)</value> + <key>num_mboards</key> + <value>1</value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>clock_source0</key> + <value></value> </param> - </block> - <block> - <key>uhd_usrp_sink</key> <param> - <key>id</key> - <value>uhd_usrp_sink_0</value> + <key>time_source0</key> + <value></value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>sd_spec0</key> + <value></value> </param> <param> - <key>type</key> - <value>complex</value> + <key>clock_source1</key> + <value></value> </param> <param> - <key>dev_addr</key> - <value>address0</value> + <key>time_source1</key> + <value></value> </param> <param> - <key>sync</key> + <key>sd_spec1</key> <value></value> </param> <param> - <key>clock_rate</key> - <value>0.0</value> + <key>clock_source2</key> + <value></value> </param> <param> - <key>num_mboards</key> - <value>1</value> + <key>time_source2</key> + <value></value> </param> <param> - <key>ref_source0</key> + <key>sd_spec2</key> <value></value> </param> <param> - <key>sd_spec0</key> + <key>clock_source3</key> <value></value> </param> <param> - <key>ref_source1</key> + <key>time_source3</key> <value></value> </param> <param> - <key>sd_spec1</key> + <key>sd_spec3</key> <value></value> </param> <param> - <key>ref_source2</key> + <key>clock_source4</key> <value></value> </param> <param> - <key>sd_spec2</key> + <key>time_source4</key> <value></value> </param> <param> - <key>ref_source3</key> + <key>sd_spec4</key> <value></value> </param> <param> - <key>sd_spec3</key> + <key>clock_source5</key> <value></value> </param> <param> - <key>ref_source4</key> + <key>time_source5</key> <value></value> </param> <param> - <key>sd_spec4</key> + <key>sd_spec5</key> <value></value> </param> <param> - <key>ref_source5</key> + <key>clock_source6</key> <value></value> </param> <param> - <key>sd_spec5</key> + <key>time_source6</key> <value></value> </param> <param> - <key>ref_source6</key> + <key>sd_spec6</key> <value></value> </param> <param> - <key>sd_spec6</key> + <key>clock_source7</key> <value></value> </param> <param> - <key>ref_source7</key> + <key>time_source7</key> <value></value> </param> <param> @@ -1242,7 +1220,15 @@ </param> <param> <key>type</key> - <value>complex</value> + <value>fc32</value> + </param> + <param> + <key>otw</key> + <value></value> + </param> + <param> + <key>stream_args</key> + <value></value> </param> <param> <key>dev_addr</key> @@ -1261,7 +1247,11 @@ <value>1</value> </param> <param> - <key>ref_source0</key> + <key>clock_source0</key> + <value></value> + </param> + <param> + <key>time_source0</key> <value></value> </param> <param> @@ -1269,7 +1259,11 @@ <value></value> </param> <param> - <key>ref_source1</key> + <key>clock_source1</key> + <value></value> + </param> + <param> + <key>time_source1</key> <value></value> </param> <param> @@ -1277,7 +1271,11 @@ <value></value> </param> <param> - <key>ref_source2</key> + <key>clock_source2</key> + <value></value> + </param> + <param> + <key>time_source2</key> <value></value> </param> <param> @@ -1285,7 +1283,11 @@ <value></value> </param> <param> - <key>ref_source3</key> + <key>clock_source3</key> + <value></value> + </param> + <param> + <key>time_source3</key> <value></value> </param> <param> @@ -1293,7 +1295,11 @@ <value></value> </param> <param> - <key>ref_source4</key> + <key>clock_source4</key> + <value></value> + </param> + <param> + <key>time_source4</key> <value></value> </param> <param> @@ -1301,7 +1307,11 @@ <value></value> </param> <param> - <key>ref_source5</key> + <key>clock_source5</key> + <value></value> + </param> + <param> + <key>time_source5</key> <value></value> </param> <param> @@ -1309,7 +1319,11 @@ <value></value> </param> <param> - <key>ref_source6</key> + <key>clock_source6</key> + <value></value> + </param> + <param> + <key>time_source6</key> <value></value> </param> <param> @@ -1317,7 +1331,11 @@ <value></value> </param> <param> - <key>ref_source7</key> + <key>clock_source7</key> + <value></value> + </param> + <param> + <key>time_source7</key> <value></value> </param> <param> @@ -1964,10 +1982,10 @@ </param> </block> <block> - <key>gr_add_xx</key> + <key>wxgui_fftsink2</key> <param> <key>id</key> - <value>gr_add_xx</value> + <value>wxgui_fftsink2</value> </param> <param> <key>_enabled</key> @@ -1978,71 +1996,76 @@ <value>complex</value> </param> <param> - <key>num_inputs</key> - <value>3</value> + <key>title</key> + <value>FFT Plot</value> </param> <param> - <key>vlen</key> - <value>1</value> + <key>samp_rate</key> + <value>samp_rate</value> </param> <param> - <key>_coordinate</key> - <value>(529, 172)</value> + <key>baseband_freq</key> + <value>0</value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>y_per_div</key> + <value>10</value> </param> - </block> - <block> - <key>options</key> <param> - <key>id</key> - <value>uhd_two_tone_loopback</value> + <key>y_divs</key> + <value>10</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>ref_level</key> + <value>0</value> </param> <param> - <key>title</key> - <value>UHD Loopback - 2 Tone</value> + <key>ref_scale</key> + <value>2.0</value> </param> <param> - <key>author</key> - <value>Example</value> + <key>fft_size</key> + <value>512*2</value> </param> <param> - <key>description</key> - <value>Loopback test</value> + <key>fft_rate</key> + <value>15</value> </param> <param> - <key>window_size</key> - <value>1280, 1024</value> + <key>peak_hold</key> + <value>False</value> </param> <param> - <key>generate_options</key> - <value>wx_gui</value> + <key>average</key> + <value>False</value> </param> <param> - <key>category</key> - <value>Custom</value> + <key>avg_alpha</key> + <value>0</value> </param> <param> - <key>run_options</key> - <value>prompt</value> + <key>win</key> + <value>window.blackmanharris</value> </param> <param> - <key>run</key> - <value>True</value> + <key>win_size</key> + <value></value> </param> <param> - <key>realtime_scheduling</key> + <key>grid_pos</key> + <value>1, 2, 2, 4</value> + </param> + <param> + <key>notebook</key> <value></value> </param> <param> + <key>freqvar</key> + <value>None</value> + </param> + <param> <key>_coordinate</key> - <value>(10, 10)</value> + <value>(1114, 264)</value> </param> <param> <key>_rotation</key> @@ -2050,86 +2073,120 @@ </param> </block> <block> - <key>wxgui_fftsink2</key> + <key>parameter</key> <param> <key>id</key> - <value>wxgui_fftsink2</value> + <value>samp_rate</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> + <key>label</key> + <value>Sample Rate</value> + </param> + <param> + <key>value</key> + <value>500e3</value> + </param> + <param> <key>type</key> - <value>complex</value> + <value>eng_float</value> </param> <param> - <key>title</key> - <value>FFT Plot</value> + <key>short_id</key> + <value>s</value> + </param> + <param> + <key>_coordinate</key> + <value>(539, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_sig_source_x</key> + <param> + <key>id</key> + <value>analog_sig_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> </param> <param> <key>samp_rate</key> <value>samp_rate</value> </param> <param> - <key>baseband_freq</key> - <value>0</value> + <key>waveform</key> + <value>analog.GR_COS_WAVE</value> </param> <param> - <key>y_per_div</key> - <value>10</value> + <key>freq</key> + <value>tone1</value> </param> <param> - <key>y_divs</key> - <value>10</value> + <key>amp</key> + <value>tone_ampl</value> </param> <param> - <key>ref_level</key> + <key>offset</key> <value>0</value> </param> <param> - <key>ref_scale</key> - <value>2.0</value> + <key>_coordinate</key> + <value>(264, 136)</value> </param> <param> - <key>fft_size</key> - <value>512*2</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>analog_sig_source_x</key> <param> - <key>fft_rate</key> - <value>15</value> + <key>id</key> + <value>analog_sig_source_x_1</value> </param> <param> - <key>peak_hold</key> - <value>False</value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>average</key> - <value>False</value> + <key>type</key> + <value>complex</value> </param> <param> - <key>avg_alpha</key> - <value>0</value> + <key>samp_rate</key> + <value>samp_rate</value> </param> <param> - <key>win</key> - <value>window.blackmanharris</value> + <key>waveform</key> + <value>analog.GR_COS_WAVE</value> </param> <param> - <key>win_size</key> - <value></value> + <key>freq</key> + <value>tone2</value> </param> <param> - <key>grid_pos</key> - <value>1, 2, 2, 4</value> + <key>amp</key> + <value>tone_ampl</value> </param> <param> - <key>notebook</key> - <value></value> + <key>offset</key> + <value>0</value> </param> <param> <key>_coordinate</key> - <value>(1114, 264)</value> + <value>(265, 247)</value> </param> <param> <key>_rotation</key> @@ -2137,34 +2194,65 @@ </param> </block> <block> - <key>parameter</key> + <key>blocks_add_xx</key> <param> <key>id</key> - <value>samp_rate</value> + <value>blocks_add_xx</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>label</key> - <value>Sample Rate</value> + <key>type</key> + <value>complex</value> </param> <param> - <key>value</key> - <value>500e3</value> + <key>num_inputs</key> + <value>3</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(529, 172)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_noise_source_x</key> + <param> + <key>id</key> + <value>analog_noise_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> </param> <param> <key>type</key> - <value>eng_float</value> + <value>complex</value> </param> <param> - <key>short_id</key> - <value>s</value> + <key>noise_type</key> + <value>analog.GR_GAUSSIAN</value> + </param> + <param> + <key>amp</key> + <value>noise_ampl</value> + </param> + <param> + <key>seed</key> + <value>-42</value> </param> <param> <key>_coordinate</key> - <value>(539, 11)</value> + <value>(288, 359)</value> </param> <param> <key>_rotation</key> @@ -2172,33 +2260,33 @@ </param> </block> <connection> - <source_block_id>gr_noise_source_x</source_block_id> - <sink_block_id>gr_add_xx</sink_block_id> + <source_block_id>blocks_add_xx</source_block_id> + <sink_block_id>uhd_usrp_sink_0</sink_block_id> <source_key>0</source_key> - <sink_key>2</sink_key> + <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_sig_source_x0</source_block_id> - <sink_block_id>gr_add_xx</sink_block_id> + <source_block_id>uhd_usrp_source_0</source_block_id> + <sink_block_id>wxgui_fftsink2</sink_block_id> <source_key>0</source_key> - <sink_key>1</sink_key> + <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_sig_source_x</source_block_id> - <sink_block_id>gr_add_xx</sink_block_id> + <source_block_id>analog_sig_source_x_0</source_block_id> + <sink_block_id>blocks_add_xx</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_add_xx</source_block_id> - <sink_block_id>uhd_usrp_sink_0</sink_block_id> + <source_block_id>analog_sig_source_x_1</source_block_id> + <sink_block_id>blocks_add_xx</sink_block_id> <source_key>0</source_key> - <sink_key>0</sink_key> + <sink_key>1</sink_key> </connection> <connection> - <source_block_id>uhd_usrp_source_0</source_block_id> - <sink_block_id>wxgui_fftsink2</sink_block_id> + <source_block_id>analog_noise_source_x_0</source_block_id> + <sink_block_id>blocks_add_xx</sink_block_id> <source_key>0</source_key> - <sink_key>0</sink_key> + <sink_key>2</sink_key> </connection> </flow_graph> diff --git a/gr-uhd/examples/grc/uhd_tx_dpsk.grc b/gr-uhd/examples/grc/uhd_tx_dpsk.grc index 281ba84295..38318bef4b 100644 --- a/gr-uhd/examples/grc/uhd_tx_dpsk.grc +++ b/gr-uhd/examples/grc/uhd_tx_dpsk.grc @@ -1035,10 +1035,10 @@ </param> </block> <block> - <key>gr_multiply_const_vxx</key> + <key>blocks_multiply_const_vxx</key> <param> <key>id</key> - <value>gr_multiply_const_vxx_0</value> + <value>blocks_multiply_const_vxx_0</value> </param> <param> <key>_enabled</key> @@ -1214,20 +1214,20 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_multiply_const_vxx_0</source_block_id> + <source_block_id>blocks_multiply_const_vxx_0</source_block_id> <sink_block_id>wxgui_fftsink2_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_multiply_const_vxx_0</source_block_id> + <source_block_id>blocks_multiply_const_vxx_0</source_block_id> <sink_block_id>uhd_usrp_sink_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> <source_block_id>digital_dxpsk_mod_0</source_block_id> - <sink_block_id>gr_multiply_const_vxx_0</sink_block_id> + <sink_block_id>blocks_multiply_const_vxx_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> diff --git a/gr-uhd/examples/grc/uhd_wbfm_receive.grc b/gr-uhd/examples/grc/uhd_wbfm_receive.grc index 7f14123f2e..943e82cf31 100644 --- a/gr-uhd/examples/grc/uhd_wbfm_receive.grc +++ b/gr-uhd/examples/grc/uhd_wbfm_receive.grc @@ -347,10 +347,10 @@ </param> </block> <block> - <key>gr_multiply_const_vxx</key> + <key>blocks_multiply_const_vxx</key> <param> <key>id</key> - <value>gr_multiply_const_vxx</value> + <value>blocks_multiply_const_vxx</value> </param> <param> <key>_enabled</key> @@ -1373,14 +1373,14 @@ </param> </block> <connection> - <source_block_id>gr_multiply_const_vxx</source_block_id> + <source_block_id>blocks_multiply_const_vxx</source_block_id> <sink_block_id>audio_sink</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> <source_block_id>blks2_wfm_rcv</source_block_id> - <sink_block_id>gr_multiply_const_vxx</sink_block_id> + <sink_block_id>blocks_multiply_const_vxx</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> diff --git a/gr-uhd/examples/python/fm_tx4.py b/gr-uhd/examples/python/fm_tx4.py index f412ffb5dc..e4cf3ded24 100755 --- a/gr-uhd/examples/python/fm_tx4.py +++ b/gr-uhd/examples/python/fm_tx4.py @@ -34,7 +34,8 @@ audio_to_file.py from gnuradio import gr, eng_notation from gnuradio import uhd -from gnuradio import blks2 +from gnuradio import analog +from gnuradio import blocks from gnuradio.eng_option import eng_option from optparse import OptionParser import math @@ -62,19 +63,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 () + 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 = blocks.multiply_cc() - self.connect (src, fmtx, (mixer, 0)) - self.connect (lo, (mixer, 1)) - self.connect (mixer, self) + 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): @@ -141,7 +142,7 @@ class fm_tx_block(stdgui2.std_top_block): self.set_gain(options.gain) self.set_freq(options.freq) - self.sum = gr.add_cc () + self.sum = blocks.add_cc () # Instantiate N NBFM channels step = 25e3 @@ -153,7 +154,7 @@ class fm_tx_block(stdgui2.std_top_block): self.audio_rate, self.usrp_rate) self.connect(t, (self.sum, i)) - self.gain = gr.multiply_const_cc (1.0 / options.nchannels) + self.gain = blocks.multiply_const_cc (1.0 / options.nchannels) # connect it all self.connect (self.sum, self.gain) @@ -179,7 +180,8 @@ class fm_tx_block(stdgui2.std_top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool Tuning is a two step process. First we ask the front-end to diff --git a/gr-uhd/examples/python/fm_tx_2_daughterboards.py b/gr-uhd/examples/python/fm_tx_2_daughterboards.py index b5763e8e19..b4958b8596 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,10 @@ 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 import blocks from gnuradio.eng_notation import num_to_str, str_to_num from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -47,11 +50,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,18 +68,18 @@ 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 - sum = gr.add_cc() + 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 = blocks.add_cc() self.connect(src0, (sum, 0)) self.connect(src1, (sum, 1)) self.connect(sum, self) @@ -86,7 +89,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]") @@ -152,13 +155,13 @@ class my_top_block(gr.top_block): sig0 = example_signal_0(self.usrp_rate) sig1 = example_signal_1(self.usrp_rate) - intl = gr.interleave(gr.sizeof_gr_complex) + intl = blocks.interleave(gr.sizeof_gr_complex) self.connect(sig0, (intl, 0)) self.connect(sig1, (intl, 1)) # 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) @@ -184,8 +187,9 @@ class my_top_block(gr.top_block): """ Set the center frequency we're interested in. - @param side: 0 = side A, 1 = side B - @param target_freq: frequency in Hz + Args: + side: 0 = side A, 1 = side B + target_freq: frequency in Hz @rtype: bool """ diff --git a/gr-uhd/examples/python/max_power.py b/gr-uhd/examples/python/max_power.py index 5d23f16afc..79fe120641 100755 --- a/gr-uhd/examples/python/max_power.py +++ b/gr-uhd/examples/python/max_power.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2007,2011 Free Software Foundation, Inc. +# Copyright 2004,2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,6 +26,7 @@ Setup USRP for maximum power consumption. from gnuradio import gr +from gnuradio import analog from gnuradio import uhd from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -63,9 +64,9 @@ class build_block(gr.top_block): self.u_tx = uhd.usrp_sink(device_addr=args, stream_args=stream_args) self.u_tx.set_samp_rate(MAX_RATE) - self.tx_src0 = gr.sig_source_c(self.u_tx.get_samp_rate(), - gr.GR_CONST_WAVE, - 0, 1.0, 0) + self.tx_src0 = analog.sig_source_c(self.u_tx.get_samp_rate(), + analog.GR_CONST_WAVE, + 0, 1.0, 0) # Get dboard gain range and select maximum tx_gain_range = self.u_tx.get_gain_range() @@ -94,7 +95,7 @@ class build_block(gr.top_block): self.u_rx = uhd.usrp_source(device_addr=args, io_type=uhd.io_type.COMPLEX_FLOAT32, num_channels=rx_nchan) - self.rx_dst0 = gr.null_sink (gr.sizeof_gr_complex) + self.rx_dst0 = gr.null_sink(gr.sizeof_gr_complex) self.u_rx.set_samp_rate(MAX_RATE) diff --git a/gr-uhd/examples/python/usrp_am_mw_rcv.py b/gr-uhd/examples/python/usrp_am_mw_rcv.py index 02863b32fd..51b065e794 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,10 +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 @@ -96,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 = gr.agc_cc(0.1, 1, 1, 100000) + 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) + self.volume_control = blocks.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 @@ -276,7 +277,8 @@ class wfm_rx_block (stdgui2.std_top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ r = self.u.set_center_freq(target_freq + self.IF_freq, 0) diff --git a/gr-uhd/examples/python/usrp_nbfm_ptt.py b/gr-uhd/examples/python/usrp_nbfm_ptt.py index 791b8cb990..651204a050 100755 --- a/gr-uhd/examples/python/usrp_nbfm_ptt.py +++ b/gr-uhd/examples/python/usrp_nbfm_ptt.py @@ -25,7 +25,9 @@ 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 import blocks from gnuradio.eng_option import eng_option from gnuradio.wxgui import stdgui2, fftsink2, scopesink2, slider, form @@ -300,7 +302,7 @@ class transmit_path(gr.hier_block2): self.normal_gain = 32000 self.audio = audio.source(int(self.audio_rate), audio_input) - self.audio_amp = gr.multiply_const_ff(self.audio_gain) + self.audio_amp = blocks.multiply_const_ff(self.audio_gain) lpf = gr.firdes.low_pass (1, # gain self.audio_rate, # sampling rate @@ -317,15 +319,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.add_pl = gr.add_ff() + self.pl = analog.ctcss_gen_f(self.audio_rate,123.0) + self.add_pl = blocks.add_ff() self.connect(self.pl,(self.add_pl,1)) - self.fmtx = blks2.nbfm_tx(self.audio_rate, self.if_rate) - self.amp = gr.multiply_const_cc (self.normal_gain) + self.fmtx = analog.nbfm_tx(self.audio_rate, self.if_rate) + self.amp = blocks.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, @@ -344,7 +346,8 @@ class transmit_path(gr.hier_block2): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ r = self.u.set_center_freq(target_freq) @@ -394,23 +397,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) + self._audio_gain = blocks.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 @@ -464,7 +467,8 @@ class receive_path(gr.hier_block2): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ r = self.u.set_center_freq(target_freq) diff --git a/gr-uhd/examples/python/usrp_nbfm_rcv.py b/gr-uhd/examples/python/usrp_nbfm_rcv.py index be890f02d8..e3dc7eac6b 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,10 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import blocks +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,24 +288,24 @@ 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) + self._audio_gain = blocks.multiply_const_ff(1.0) # sound card as final sink audio_sink = audio.sink (int(self.audio_rate), audio_output) @@ -357,7 +360,8 @@ class receive_path(gr.hier_block2): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ diff --git a/gr-uhd/examples/python/usrp_spectrum_sense.py b/gr-uhd/examples/python/usrp_spectrum_sense.py index 32980adbfa..62349da941 100755 --- a/gr-uhd/examples/python/usrp_spectrum_sense.py +++ b/gr-uhd/examples/python/usrp_spectrum_sense.py @@ -21,6 +21,7 @@ # from gnuradio import gr, eng_notation, window +from gnuradio import blocks from gnuradio import audio from gnuradio import uhd from gnuradio.eng_option import eng_option @@ -151,7 +152,7 @@ class my_top_block(gr.top_block): self.u.set_samp_rate(usrp_rate) dev_rate = self.u.get_samp_rate() - s2v = gr.stream_to_vector(gr.sizeof_gr_complex, self.fft_size) + s2v = blocks.stream_to_vector(gr.sizeof_gr_complex, self.fft_size) mywindow = window.blackmanharris(self.fft_size) fft = gr.fft_vcc(self.fft_size, True, mywindow) @@ -162,8 +163,8 @@ class my_top_block(gr.top_block): c2mag = gr.complex_to_mag_squared(self.fft_size) # FIXME the log10 primitive is dog slow - log = gr.nlog10_ff(10, self.fft_size, - -20*math.log10(self.fft_size)-10*math.log10(power/self.fft_size)) + log = blocks.nlog10_ff(10, self.fft_size, + -20*math.log10(self.fft_size)-10*math.log10(power/self.fft_size)) # Set the freq_step to 75% of the actual data throughput. # This allows us to discard the bins on both ends of the spectrum. @@ -213,7 +214,8 @@ class my_top_block(gr.top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ r = self.u.set_center_freq(target_freq) diff --git a/gr-uhd/examples/python/usrp_tv_rcv.py b/gr-uhd/examples/python/usrp_tv_rcv.py index b49a5ea71a..cd54fad3ae 100755 --- a/gr-uhd/examples/python/usrp_tv_rcv.py +++ b/gr-uhd/examples/python/usrp_tv_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 # @@ -47,6 +47,8 @@ except: print "FYI: gr-video-sdl is not installed" print "realtime SDL video output window will not be available" from gnuradio import uhd +from gnuradio import analog +from gnuradio import blocks from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate from gnuradio.wxgui import stdgui2, fftsink2, form @@ -123,7 +125,7 @@ class tv_rx_block (stdgui2.std_top_block): if not ((filename is None) or (filename=="usrp")): # file is data source self.filesource = gr.file_source(gr.sizeof_short,filename,options.repeat) - self.istoc = gr.interleaved_short_to_complex() + self.istoc = blocks.interleaved_short_to_complex() self.connect(self.filesource,self.istoc) self.src=self.istoc @@ -153,7 +155,7 @@ class tv_rx_block (stdgui2.std_top_block): self.gain = options.gain - f2uc=gr.float_to_uchar() + f2uc = blocks.float_to_uchar() # sdl window as final sink if not (options.pal or options.ntsc): @@ -194,10 +196,10 @@ class tv_rx_block (stdgui2.std_top_block): file_sink=gr.file_sink(gr.sizeof_char, options.out_filename) self.dst =file_sink - self.agc=gr.agc_cc(1e-7,1.0,1.0) #1e-7 + self.agc = analog.agc_cc(1e-7,1.0,1.0) #1e-7 self.am_demod = gr.complex_to_mag () - self.set_blacklevel=gr.add_const_ff(0.0) - self.invert_and_scale = gr.multiply_const_ff (0.0) #-self.contrast *128.0*255.0/(200.0) + self.set_blacklevel = blocks.add_const_ff(0.0) + self.invert_and_scale = blocks.multiply_const_ff (0.0) #-self.contrast *128.0*255.0/(200.0) # now wire it all together #sample_rate=options.width*options.height*options.framerate @@ -237,14 +239,14 @@ class tv_rx_block (stdgui2.std_top_block): #Note: this block is not yet in cvs tv_corr=gr.tv_correlator_ff(frame_size,nframes, search_window, video_alpha, corr_alpha,debug) - shift=gr.add_const_ff(-0.7) + shift = blocks.add_const_ff(-0.7) self.connect (self.src, self.agc, self.am_demod, tv_corr, self.invert_and_scale, self.set_blacklevel, f2uc, self.dst) else: # process_type=='do_test_image': - src_vertical_bars = gr.sig_source_f (usrp_rate, gr.GR_SIN_WAVE, - 10.0 *usrp_rate/320, 255,128) + src_vertical_bars = analog.sig_source_f(usrp_rate, analog.GR_SIN_WAVE, + 10.0 *usrp_rate/320, 255,128) self.connect(src_vertical_bars, f2uc, self.dst) self._build_gui(vbox, usrp_rate, usrp_rate, usrp_rate) @@ -403,7 +405,8 @@ class tv_rx_block (stdgui2.std_top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool Tuning is a two step process. First we ask the front-end to diff --git a/gr-uhd/examples/python/usrp_tv_rcv_nogui.py b/gr-uhd/examples/python/usrp_tv_rcv_nogui.py index cfb36222cb..dfa6ceec1f 100755 --- a/gr-uhd/examples/python/usrp_tv_rcv_nogui.py +++ b/gr-uhd/examples/python/usrp_tv_rcv_nogui.py @@ -35,6 +35,8 @@ development but not yet in cvs. """ from gnuradio import gr, eng_notation +from gnuradio import analog +from gnuradio import blocks from gnuradio import audio from gnuradio import uhd from gnuradio.eng_option import eng_option @@ -121,7 +123,7 @@ class my_top_block(gr.top_block): self.filesource = gr.file_source(gr.sizeof_short, options.in_filename, options.repeat) - self.istoc = gr.interleaved_short_to_complex() + self.istoc = blocks.interleaved_short_to_complex() self.connect(self.filesource,self.istoc) self.src=self.istoc else: @@ -158,11 +160,11 @@ class my_top_block(gr.top_block): raise SystemExit, 1 - self.agc = gr.agc_cc(1e-7,1.0,1.0) #1e-7 + self.agc = analog.agc_cc(1e-7,1.0,1.0) #1e-7 self.am_demod = gr.complex_to_mag () - self.set_blacklevel = gr.add_const_ff(options.brightness +255.0) - self.invert_and_scale = gr.multiply_const_ff (-options.contrast *128.0*255.0/(200.0)) - self.f2uc = gr.float_to_uchar() + self.set_blacklevel = blocks.add_const_ff(options.brightness +255.0) + self.invert_and_scale = blocks.multiply_const_ff(-options.contrast *128.0*255.0/(200.0)) + self.f2uc = blocks.float_to_uchar() # sdl window as final sink if not (options.pal or options.ntsc): @@ -180,8 +182,7 @@ class my_top_block(gr.top_block): if filename=="sdl": #Here comes the tv screen, you have to build and install - #gr-video-sdl for this (subproject of gnuradio, only in cvs - #for now) + #gr-video-sdl for this (subproject of gnuradio) try: video_sink = video_sdl.sink_uc(frames_per_sec, width, height, 0, show_width,height) diff --git a/gr-uhd/examples/python/usrp_wfm_rcv.py b/gr-uhd/examples/python/usrp_wfm_rcv.py index 8ec08260ad..30c23dc77e 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,10 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, optfir, audio, uhd +from gnuradio import blocks +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 +91,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) + self.volume_control = blocks.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) @@ -252,7 +255,8 @@ class wfm_rx_block (stdgui2.std_top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ diff --git a/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py b/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py index 83f1726c42..c5b42cbf08 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,10 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import blocks +from gnuradio import filter +from gnuradio import analog from gnuradio.eng_option import eng_option from optparse import OptionParser import sys @@ -94,12 +97,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,9 +114,9 @@ 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) - volume_control = gr.multiply_const_ff(self.vol) + chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) + guts = analog.wfm_rcv(demod_rate, audio_decim) + volume_control = blocks.multiply_const_ff(self.vol) #self.connect((self.di, n), chan_filt) self.connect((self.u, 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 967a3bd8fc..e486449a7f 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,10 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, audio, uhdf +from gnuradio import blocks +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 +93,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) + self.volume_control_l = blocks.multiply_const_ff(self.vol) + self.volume_control_r = blocks.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, @@ -314,7 +317,8 @@ class wfm_rx_block (stdgui2.std_top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py b/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py index 9a7558dc77..d855d37bcb 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,10 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, optfir, audio, uhd +from gnuradio import blocks +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,18 +85,18 @@ 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) + self.volume_control = blocks.multiply_const_ff(1) # sound card as final sink self.audio_sink = audio.sink(int(audio_rate), @@ -101,8 +104,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 @@ -137,7 +140,8 @@ class wfm_rx_block (gr.top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_pll.py b/gr-uhd/examples/python/usrp_wfm_rcv_pll.py index 874cab4a8e..4b33cdcbb3 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,10 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import blocks +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,24 +93,24 @@ 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) - self.volume_control_r = gr.multiply_const_ff(self.vol) + self.volume_control_l = blocks.multiply_const_ff(self.vol) + self.volume_control_r = blocks.multiply_const_ff(self.vol) # sound card as final sink self.audio_sink = audio.sink (int (audio_rate), @@ -311,7 +314,8 @@ class wfm_rx_block (stdgui2.std_top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_sca.py b/gr-uhd/examples/python/usrp_wfm_rcv_sca.py index 4c6aec23f6..53d1fa5f00 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,10 @@ OFDM. """ -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import blocks +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 +124,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 +146,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 +169,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) + self.volume_control = blocks.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) @@ -357,7 +360,8 @@ class wfm_rx_sca_block (stdgui2.std_top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool Tuning is a two step process. First we ask the front-end to diff --git a/gr-uhd/examples/python/usrp_wxapt_rcv.py b/gr-uhd/examples/python/usrp_wxapt_rcv.py index aaf297089e..305149b682 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,10 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import blocks +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 +91,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) + self.volume_control = blocks.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) @@ -247,7 +250,8 @@ class wxapt_rx_block (stdgui2.std_top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ diff --git a/gr-uhd/include/gr_uhd_usrp_sink.h b/gr-uhd/include/gr_uhd_usrp_sink.h index eaf60fb777..b684ca146f 100644 --- a/gr-uhd/include/gr_uhd_usrp_sink.h +++ b/gr-uhd/include/gr_uhd_usrp_sink.h @@ -59,9 +59,9 @@ class uhd_usrp_sink; * TX Stream tagging: * * The following tag keys will be consumed by the work function: - * - pmt::pmt_string_to_symbol("tx_sob") - * - pmt::pmt_string_to_symbol("tx_eob") - * - pmt::pmt_string_to_symbol("tx_time") + * - pmt::string_to_symbol("tx_sob") + * - pmt::string_to_symbol("tx_eob") + * - pmt::string_to_symbol("tx_time") * * The sob and eob (start and end of burst) tag values are pmt booleans. * When present, burst tags should be set to true (pmt::PMT_T). @@ -92,9 +92,9 @@ GR_UHD_API boost::shared_ptr<uhd_usrp_sink> uhd_make_usrp_sink( * TX Stream tagging: * * The following tag keys will be consumed by the work function: - * - pmt::pmt_string_to_symbol("tx_sob") - * - pmt::pmt_string_to_symbol("tx_eob") - * - pmt::pmt_string_to_symbol("tx_time") + * - pmt::string_to_symbol("tx_sob") + * - pmt::string_to_symbol("tx_eob") + * - pmt::string_to_symbol("tx_time") * * The sob and eob (start and end of burst) tag values are pmt booleans. * When present, burst tags should be set to true (pmt::PMT_T). diff --git a/gr-uhd/include/gr_uhd_usrp_source.h b/gr-uhd/include/gr_uhd_usrp_source.h index 1243ddcc2f..a56da6ab09 100644 --- a/gr-uhd/include/gr_uhd_usrp_source.h +++ b/gr-uhd/include/gr_uhd_usrp_source.h @@ -59,9 +59,9 @@ class uhd_usrp_source; * RX Stream tagging: * * The following tag keys will be produced by the work function: - * - pmt::pmt_string_to_symbol("rx_time") - * - pmt::pmt_string_to_symbol("rx_rate") - * - pmt::pmt_string_to_symbol("rx_freq") + * - pmt::string_to_symbol("rx_time") + * - pmt::string_to_symbol("rx_rate") + * - pmt::string_to_symbol("rx_freq") * * The timstamp tag value is a pmt tuple of the following: * (uint64 seconds, and double fractional seconds). @@ -94,7 +94,7 @@ GR_UHD_API boost::shared_ptr<uhd_usrp_source> uhd_make_usrp_source( * RX Stream tagging: * * The following tag keys will be produced by the work function: - * - pmt::pmt_string_to_symbol("rx_time") + * - pmt::string_to_symbol("rx_time") * * The timstamp tag value is a pmt tuple of the following: * (uint64 seconds, and double fractional seconds). diff --git a/gr-uhd/lib/gr_uhd_usrp_sink.cc b/gr-uhd/lib/gr_uhd_usrp_sink.cc index 6216c94a83..3b8fcea405 100644 --- a/gr-uhd/lib/gr_uhd_usrp_sink.cc +++ b/gr-uhd/lib/gr_uhd_usrp_sink.cc @@ -25,9 +25,9 @@ #include <boost/make_shared.hpp> #include "gr_uhd_common.h" -static const pmt::pmt_t SOB_KEY = pmt::pmt_string_to_symbol("tx_sob"); -static const pmt::pmt_t EOB_KEY = pmt::pmt_string_to_symbol("tx_eob"); -static const pmt::pmt_t TIME_KEY = pmt::pmt_string_to_symbol("tx_time"); +static const pmt::pmt_t SOB_KEY = pmt::string_to_symbol("tx_sob"); +static const pmt::pmt_t EOB_KEY = pmt::string_to_symbol("tx_eob"); +static const pmt::pmt_t TIME_KEY = pmt::string_to_symbol("tx_time"); #include <uhd/convert.hpp> inline gr_io_signature_sptr args_to_io_sig(const uhd::stream_args_t &args){ @@ -374,23 +374,23 @@ public: } //handle end of burst with a mini end of burst packet - else if (pmt::pmt_equal(key, EOB_KEY)){ - _metadata.end_of_burst = pmt::pmt_to_bool(value); + else if (pmt::equal(key, EOB_KEY)){ + _metadata.end_of_burst = pmt::to_bool(value); ninput_items = 1; return; } //set the start of burst flag in the metadata - else if (pmt::pmt_equal(key, SOB_KEY)){ - _metadata.start_of_burst = pmt::pmt_to_bool(value); + else if (pmt::equal(key, SOB_KEY)){ + _metadata.start_of_burst = pmt::to_bool(value); } //set the time specification in the metadata - else if (pmt::pmt_equal(key, TIME_KEY)){ + else if (pmt::equal(key, TIME_KEY)){ _metadata.has_time_spec = true; _metadata.time_spec = uhd::time_spec_t( - pmt::pmt_to_uint64(pmt::pmt_tuple_ref(value, 0)), - pmt::pmt_to_double(pmt::pmt_tuple_ref(value, 1)) + pmt::to_uint64(pmt::tuple_ref(value, 0)), + pmt::to_double(pmt::tuple_ref(value, 1)) ); } } diff --git a/gr-uhd/lib/gr_uhd_usrp_source.cc b/gr-uhd/lib/gr_uhd_usrp_source.cc index 3813673b4b..6403d3d913 100644 --- a/gr-uhd/lib/gr_uhd_usrp_source.cc +++ b/gr-uhd/lib/gr_uhd_usrp_source.cc @@ -28,9 +28,9 @@ #include <boost/make_shared.hpp> #include "gr_uhd_common.h" -static const pmt::pmt_t TIME_KEY = pmt::pmt_string_to_symbol("rx_time"); -static const pmt::pmt_t RATE_KEY = pmt::pmt_string_to_symbol("rx_rate"); -static const pmt::pmt_t FREQ_KEY = pmt::pmt_string_to_symbol("rx_freq"); +static const pmt::pmt_t TIME_KEY = pmt::string_to_symbol("rx_time"); +static const pmt::pmt_t RATE_KEY = pmt::string_to_symbol("rx_rate"); +static const pmt::pmt_t FREQ_KEY = pmt::string_to_symbol("rx_freq"); #include <uhd/convert.hpp> inline gr_io_signature_sptr args_to_io_sig(const uhd::stream_args_t &args){ @@ -69,7 +69,7 @@ public: if (stream_args.cpu_format == "sc16") _type = boost::make_shared<uhd::io_type_t>(uhd::io_type_t::COMPLEX_INT16); std::stringstream str; str << name() << unique_id(); - _id = pmt::pmt_string_to_symbol(str.str()); + _id = pmt::string_to_symbol(str.str()); _dev = uhd::usrp::multi_usrp::make(device_addr); } @@ -363,15 +363,15 @@ public: if (_tag_now){ _tag_now = false; //create a timestamp pmt for the first sample - const pmt::pmt_t val = pmt::pmt_make_tuple( - pmt::pmt_from_uint64(_metadata.time_spec.get_full_secs()), - pmt::pmt_from_double(_metadata.time_spec.get_frac_secs()) + const pmt::pmt_t val = pmt::make_tuple( + pmt::from_uint64(_metadata.time_spec.get_full_secs()), + pmt::from_double(_metadata.time_spec.get_frac_secs()) ); //create a tag set for each channel for (size_t i = 0; i < _nchan; i++){ this->add_item_tag(i, nitems_written(0), TIME_KEY, val, _id); - this->add_item_tag(i, nitems_written(0), RATE_KEY, pmt::pmt_from_double(_samp_rate), _id); - this->add_item_tag(i, nitems_written(0), FREQ_KEY, pmt::pmt_from_double(_center_freq), _id); + this->add_item_tag(i, nitems_written(0), RATE_KEY, pmt::from_double(_samp_rate), _id); + this->add_item_tag(i, nitems_written(0), FREQ_KEY, pmt::from_double(_center_freq), _id); } } break; |