Esempio n. 1
0
    def __init__(self):
        gr.top_block.__init__(self)

        self._nsamples = 1000000
        self._audio_rate = 8000

        # Set up N channels with their own baseband and IF frequencies
        self._N = 5
        chspacing = 16000
        freq = [10, 20, 30, 40, 50]
        f_lo = [0, 1*chspacing, -1*chspacing, 2*chspacing, -2*chspacing]

        self._if_rate = 4*self._N*self._audio_rate

        # Create a signal source and frequency modulate it
        self.sum = gr.add_cc ()
        for n in xrange(self._N):
            sig = gr.sig_source_f(self._audio_rate, gr.GR_SIN_WAVE, freq[n], 0.5)
            fm = fmtx(f_lo[n], self._audio_rate, self._if_rate)
            self.connect(sig, fm)
            self.connect(fm, (self.sum, n))

        self.head = gr.head(gr.sizeof_gr_complex, self._nsamples)
        self.snk_tx = gr.vector_sink_c()
        self.channel = blks2.channel_model(0.1)

        self.connect(self.sum, self.head, self.channel, self.snk_tx)


        # Design the channlizer
        self._M = 10
        bw = chspacing/2.0
        t_bw = chspacing/10.0
        self._chan_rate = self._if_rate / self._M
        self._taps = gr.firdes.low_pass_2(1, self._if_rate, bw, t_bw,
                                          attenuation_dB=100,
                                          window=gr.firdes.WIN_BLACKMAN_hARRIS)
        tpc = math.ceil(float(len(self._taps)) /  float(self._M))

        print "Number of taps:     ", len(self._taps)
        print "Number of channels: ", self._M
        print "Taps per channel:   ", tpc

        self.pfb = blks2.pfb_channelizer_ccf(self._M, self._taps)

        self.connect(self.channel, self.pfb)

        # Create a file sink for each of M output channels of the filter and connect it
        self.fmdet = list()
        self.squelch = list()
        self.snks = list()
        for i in xrange(self._M):
            self.fmdet.append(blks2.nbfm_rx(self._audio_rate, self._chan_rate))
            self.squelch.append(blks2.standard_squelch(self._audio_rate*10))
            self.snks.append(gr.vector_sink_f())
            self.connect((self.pfb, i), self.fmdet[i], self.squelch[i], self.snks[i])
Esempio n. 2
0
    def __init__(self):
        gr.top_block.__init__(self)

        self._nsamples = 1000000
        self._audio_rate = 8000

        # Set up N channels with their own baseband and IF frequencies
        self._N = 5
        chspacing = 16000
        freq = [10, 20, 30, 40, 50]
        f_lo = [0, 1*chspacing, -1*chspacing, 2*chspacing, -2*chspacing]

        self._if_rate = 4*self._N*self._audio_rate

        # Create a signal source and frequency modulate it
        self.sum = gr.add_cc ()
        for n in xrange(self._N):
            sig = gr.sig_source_f(self._audio_rate, gr.GR_SIN_WAVE, freq[n], 0.5)
            fm = fmtx(f_lo[n], self._audio_rate, self._if_rate)
            self.connect(sig, fm)
            self.connect(fm, (self.sum, n))

        self.head = gr.head(gr.sizeof_gr_complex, self._nsamples)
        self.snk_tx = gr.vector_sink_c()
        self.channel = blks2.channel_model(0.1)

        self.connect(self.sum, self.head, self.channel, self.snk_tx)


        # Design the channlizer
        self._M = 10
        bw = chspacing/2.0
        t_bw = chspacing/10.0
        self._chan_rate = self._if_rate / self._M
        self._taps = gr.firdes.low_pass_2(1, self._if_rate, bw, t_bw, 
                                          attenuation_dB=100,
                                          window=gr.firdes.WIN_BLACKMAN_hARRIS)
        tpc = math.ceil(float(len(self._taps)) /  float(self._M))

        print "Number of taps:     ", len(self._taps)
        print "Number of channels: ", self._M
        print "Taps per channel:   ", tpc
        
        self.pfb = blks2.pfb_channelizer_ccf(self._M, self._taps)
        
        self.connect(self.channel, self.pfb)
        
        # Create a file sink for each of M output channels of the filter and connect it
        self.fmdet = list()
        self.squelch = list()
        self.snks = list()
        for i in xrange(self._M):
            self.fmdet.append(blks2.nbfm_rx(self._audio_rate, self._chan_rate))
            self.squelch.append(blks2.standard_squelch(self._audio_rate*10))
            self.snks.append(gr.vector_sink_f())
            self.connect((self.pfb, i), self.fmdet[i], self.squelch[i], self.snks[i])
	def __init__(self):
		gr.top_block.__init__(self, "FM Receiver")

		##################################################
		# Variables
		##################################################
		self.samp_rate = samp_rate = 96000
		self.xlate_filter_taps = xlate_filter_taps = firdes.low_pass(1, samp_rate, 48000, 5000, firdes.WIN_HAMMING, 6.76)
		self.sql_lev = sql_lev = -100
		self.rf_gain = rf_gain = 20
		self.freq = freq = 144800000
		self.af_gain = af_gain = 2
		self.sat_file_name = sat_file_name = "Undefined"

		##################################################
		# Blocks
		##################################################
		self.xlating_fir_filter = gr.freq_xlating_fir_filter_ccc(1, (xlate_filter_taps), 0, samp_rate)
		self.nbfm_normal = blks2.nbfm_rx(
			audio_rate=48000,
			quad_rate=96000,
			tau=75e-6,
			max_dev=5e3,
		)
		self.low_pass_filter = gr.fir_filter_ccf(1, firdes.low_pass(
			1, samp_rate, 12500, 1500, firdes.WIN_HAMMING, 6.76))
		self.gr_simple_squelch_cc_0 = gr.simple_squelch_cc(sql_lev, 1)
		self.gr_multiply_const_vxx_1 = gr.multiply_const_vff((af_gain, ))
		self.fcd_source_c_1 = fcd.source_c("hw:1")
		self.fcd_source_c_1.set_freq(freq)
		self.fcd_source_c_1.set_freq_corr(-32)
		    
		self.audio_sink = audio.sink(48000, "", True)
		
		self.wavfile_sink = gr.wavfile_sink(self.sat_file_name, 1, 11025, 16)
		self.blks2_rational_resampler_xxx_0 = blks2.rational_resampler_fff(
			interpolation=11025,
			decimation=48000,
			taps=None,
			fractional_bw=None,
		)
		

		##################################################
		# Connections
		##################################################
		self.connect((self.xlating_fir_filter, 0), (self.low_pass_filter, 0))
		self.connect((self.low_pass_filter, 0), (self.gr_simple_squelch_cc_0, 0))
		self.connect((self.gr_multiply_const_vxx_1, 0), (self.audio_sink, 1))
		self.connect((self.gr_multiply_const_vxx_1, 0), (self.audio_sink, 0))
		self.connect((self.gr_simple_squelch_cc_0, 0), (self.nbfm_normal, 0))
		self.connect((self.nbfm_normal, 0), (self.gr_multiply_const_vxx_1, 0))
		self.connect((self.fcd_source_c_1, 0), (self.xlating_fir_filter, 0))
		self.connect((self.nbfm_normal, 0), (self.blks2_rational_resampler_xxx_0, 0))
		self.connect((self.blks2_rational_resampler_xxx_0, 0), (self.wavfile_sink, 0))
Esempio n. 4
0
	def __init__(self):
		gr.top_block.__init__(self, "FM Receiver")

		##################################################
		# Variables
		##################################################
		self.samp_rate = samp_rate = 96000
		self.xlate_filter_taps = xlate_filter_taps = firdes.low_pass(1, samp_rate, 48000, 5000, firdes.WIN_HAMMING, 6.76)
		self.sql_lev = sql_lev = -100
		self.rf_gain = rf_gain = 20
		self.freq = freq = 144800000
		self.af_gain = af_gain = 2

		##################################################
		# Blocks
		##################################################
		self.xlating_fir_filter = gr.freq_xlating_fir_filter_ccc(1, (xlate_filter_taps), 0, samp_rate)
		self.nbfm_normal = blks2.nbfm_rx(
			audio_rate=48000,
			quad_rate=96000,
			tau=75e-6,
			max_dev=5e3,
		)
		self.low_pass_filter = gr.fir_filter_ccf(1, firdes.low_pass(
			1, samp_rate, 12500, 1500, firdes.WIN_HAMMING, 6.76))
		self.gr_simple_squelch_cc_0 = gr.simple_squelch_cc(sql_lev, 1)
		self.gr_multiply_const_vxx_1 = gr.multiply_const_vff((af_gain, ))
		self.fcd_source_c_1 = fcd.source_c("hw:1")
		self.fcd_source_c_1.set_freq(freq)
		self.fcd_source_c_1.set_freq_corr(-32)
		    
		self.audio_sink = audio.sink(48000, "", True)

		##################################################
		# Connections
		##################################################
		self.connect((self.xlating_fir_filter, 0), (self.low_pass_filter, 0))
		self.connect((self.low_pass_filter, 0), (self.gr_simple_squelch_cc_0, 0))
		self.connect((self.gr_multiply_const_vxx_1, 0), (self.audio_sink, 1))
		self.connect((self.gr_multiply_const_vxx_1, 0), (self.audio_sink, 0))
		self.connect((self.gr_simple_squelch_cc_0, 0), (self.nbfm_normal, 0))
		self.connect((self.nbfm_normal, 0), (self.gr_multiply_const_vxx_1, 0))
		self.connect((self.fcd_source_c_1, 0), (self.xlating_fir_filter, 0))
Esempio n. 5
0
    def __init__(self, subdev_spec, gain, audio_output):
	gr.hier_block2.__init__(self, "receive_path",
				gr.io_signature(0, 0, 0), # Input signature
				gr.io_signature(0, 0, 0)) # Output signature

        self.u = usrp.source_c ()
        adc_rate = self.u.adc_rate()

        self.if_rate = 256e3                         # 256 kS/s
        usrp_decim = int(adc_rate // self.if_rate)
        if_decim = 4
        self.u.set_decim_rate(usrp_decim)
        self.quad_rate = self.if_rate // if_decim    #  64 kS/s
        audio_decim = 2
        audio_rate = self.quad_rate // audio_decim   #  32 kS/s

        if subdev_spec is None:
            subdev_spec = usrp.pick_rx_subdevice(self.u)
        self.subdev = usrp.selected_subdev(self.u, subdev_spec)
        print "RX using", self.subdev.name()

        self.u.set_mux(usrp.determine_rx_mux_value(self.u, subdev_spec))

        # Create filter to get actual channel we want
        chan_coeffs = gr.firdes.low_pass (1.0,                # gain
                                          self.if_rate,       # sampling rate
                                          13e3,               # low pass cutoff freq
                                          4e3,                # width of trans. band
                                          gr.firdes.WIN_HANN) # filter type 

        print "len(rx_chan_coeffs) =", len(chan_coeffs)

        # Decimating Channel filter with frequency translation
        # complex in and out, float taps
        self.ddc = gr.freq_xlating_fir_filter_ccf(if_decim,       # decimation rate
                                                  chan_coeffs,    # taps
                                                  0,              # frequency translation amount
                                                  self.if_rate)   # input sample rate

        # instantiate the guts of the single channel receiver
        self.fmrx = blks2.nbfm_rx(audio_rate, self.quad_rate)

        # standard squelch block
        self.squelch = blks2.standard_squelch(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(audio_rate), audio_output)
        
        # now wire it all together
        self.connect (self.u, self.ddc, self.fmrx, self.squelch, self._audio_gain, audio_sink)

        if gain is None:
            # if no gain was specified, use the mid-point in dB
            g = self.subdev.gain_range()
            gain = float(g[0]+g[1])/2

        self.enabled = True
        self.set_gain(gain)
        v = self.volume_range()
        self.set_volume((v[0]+v[1])/2)
        s = self.squelch_range()
        self.set_squelch((s[0]+s[1])/2)
Esempio n. 6
0
    def __init__(self, args, gain, audio_output):
	gr.hier_block2.__init__(self, "receive_path",
				gr.io_signature(0, 0, 0), # Input signature
				gr.io_signature(0, 0, 0)) # Output signature

        self.u = uhd.usrp_source(device_addr=args,
                                 io_type=uhd.io_type.COMPLEX_FLOAT32,
                                 num_channels=1)

        self.if_rate    = 256e3
        self.quad_rate  = 64e3
        self.audio_rate = 32e3

        self.u.set_samp_rate(self.if_rate)
        dev_rate = self.u.get_samp_rate()

        # Create filter to get actual channel we want
        nfilts = 32
        chan_coeffs = gr.firdes.low_pass (nfilts,             # gain
                                          nfilts*dev_rate,    # sampling rate
                                          13e3,               # low pass cutoff freq
                                          4e3,                # width of trans. band
                                          gr.firdes.WIN_HANN) # filter type

        rrate = self.quad_rate / dev_rate
        self.resamp = blks2.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)

        # standard squelch block
        self.squelch = blks2.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)

        # now wire it all together
        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
            g = self.u.get_gain_range()
            gain = float(g.start() + g.stop())/2.0

        self.enabled = True
        self.set_gain(gain)
        v = self.volume_range()
        self.set_volume((v[0]+v[1])/2)
        s = self.squelch_range()
        self.set_squelch((s[0]+s[1])/2)

        # Set the subdevice spec
        if(spec):
            self.u.set_subdev_spec(spec, 0)

        # Set the antenna
        if(antenna):
            self.u.set_antenna(antenna, 0)
Esempio n. 7
0
	def __init__(self):
		grc_wxgui.top_block_gui.__init__(self, title="APRS Receiver")

		##################################################
		# Variables
		##################################################
		self.space = space = 1200
		self.mark = mark = 2200
		self.xlate_decim = xlate_decim = 8
		self.xlate_bandwidth = xlate_bandwidth = 1200*6
		self.sym_dev = sym_dev = (mark-space)/2
		self.samp_rate = samp_rate = 1e6
		self.quad_rate = quad_rate = 96000
		self.gain = gain = 10
		self.freq_offset = freq_offset = 390e3
		self.freq = freq = 144e6
		self.baud = baud = 1200
		self.audio_rate = audio_rate = 48000
		self.audio_mul = audio_mul = 1
		self.aprs_rate = aprs_rate = 12000
		self.ant = ant = 'TX/RX'

		##################################################
		# Message Queues
		##################################################
		ax25_hdlc_framer_b_0_msgq_out = ax25_print_frame_0_msgq_in = gr.msg_queue(2)

		##################################################
		# Blocks
		##################################################
		self.nb = self.nb = wx.Notebook(self.GetWin(), style=wx.NB_TOP)
		self.nb.AddPage(grc_wxgui.Panel(self.nb), "Baseband")
		self.nb.AddPage(grc_wxgui.Panel(self.nb), "Waterfall")
		self.nb.AddPage(grc_wxgui.Panel(self.nb), "Signal")
		self.nb.AddPage(grc_wxgui.Panel(self.nb), "Slicer")
		self.nb.AddPage(grc_wxgui.Panel(self.nb), "Eye")
		self.Add(self.nb)
		_gain_sizer = wx.BoxSizer(wx.VERTICAL)
		self._gain_text_box = forms.text_box(
			parent=self.GetWin(),
			sizer=_gain_sizer,
			value=self.gain,
			callback=self.set_gain,
			label="RF Gain",
			converter=forms.float_converter(),
			proportion=0,
		)
		self._gain_slider = forms.slider(
			parent=self.GetWin(),
			sizer=_gain_sizer,
			value=self.gain,
			callback=self.set_gain,
			minimum=0,
			maximum=50,
			num_steps=50,
			style=wx.SL_HORIZONTAL,
			cast=float,
			proportion=1,
		)
		self.Add(_gain_sizer)
		_freq_offset_sizer = wx.BoxSizer(wx.VERTICAL)
		self._freq_offset_text_box = forms.text_box(
			parent=self.GetWin(),
			sizer=_freq_offset_sizer,
			value=self.freq_offset,
			callback=self.set_freq_offset,
			label="Freq Offset",
			converter=forms.float_converter(),
			proportion=0,
		)
		self._freq_offset_slider = forms.slider(
			parent=self.GetWin(),
			sizer=_freq_offset_sizer,
			value=self.freq_offset,
			callback=self.set_freq_offset,
			minimum=-500e3,
			maximum=500e3,
			num_steps=1000,
			style=wx.SL_HORIZONTAL,
			cast=float,
			proportion=1,
		)
		self.Add(_freq_offset_sizer)
		self._freq_text_box = forms.text_box(
			parent=self.GetWin(),
			value=self.freq,
			callback=self.set_freq,
			label="Freq",
			converter=forms.float_converter(),
		)
		self.Add(self._freq_text_box)
		_audio_mul_sizer = wx.BoxSizer(wx.VERTICAL)
		self._audio_mul_text_box = forms.text_box(
			parent=self.GetWin(),
			sizer=_audio_mul_sizer,
			value=self.audio_mul,
			callback=self.set_audio_mul,
			label="Audio",
			converter=forms.float_converter(),
			proportion=0,
		)
		self._audio_mul_slider = forms.slider(
			parent=self.GetWin(),
			sizer=_audio_mul_sizer,
			value=self.audio_mul,
			callback=self.set_audio_mul,
			minimum=0,
			maximum=10,
			num_steps=1000,
			style=wx.SL_HORIZONTAL,
			cast=float,
			proportion=1,
		)
		self.Add(_audio_mul_sizer)
		self._ant_chooser = forms.drop_down(
			parent=self.GetWin(),
			value=self.ant,
			callback=self.set_ant,
			label="Antenna",
			choices=['TX/RX', 'RX2'],
			labels=[],
		)
		self.Add(self._ant_chooser)
		self.wxgui_waterfallsink2_0 = waterfallsink2.waterfall_sink_c(
			self.nb.GetPage(1).GetWin(),
			baseband_freq=0,
			dynamic_range=50,
			ref_level=-65,
			ref_scale=2.0,
			sample_rate=aprs_rate,
			fft_size=512,
			fft_rate=15,
			average=False,
			avg_alpha=None,
			title="Waterfall Plot",
		)
		self.nb.GetPage(1).Add(self.wxgui_waterfallsink2_0.win)
		self.wxgui_scopesink2_0_0_0 = scopesink2.scope_sink_f(
			self.nb.GetPage(4).GetWin(),
			title="Scope Plot",
			sample_rate=aprs_rate/10,
			v_scale=0.5,
			v_offset=0,
			t_scale=0.002,
			ac_couple=False,
			xy_mode=False,
			num_inputs=1,
			trig_mode=gr.gr_TRIG_MODE_AUTO,
			y_axis_label="Counts",
		)
		self.nb.GetPage(4).Add(self.wxgui_scopesink2_0_0_0.win)
		self.wxgui_scopesink2_0_0 = scopesink2.scope_sink_f(
			self.nb.GetPage(3).GetWin(),
			title="Scope Plot",
			sample_rate=aprs_rate,
			v_scale=0.5,
			v_offset=0,
			t_scale=0.002,
			ac_couple=False,
			xy_mode=False,
			num_inputs=1,
			trig_mode=gr.gr_TRIG_MODE_AUTO,
			y_axis_label="Counts",
		)
		self.nb.GetPage(3).Add(self.wxgui_scopesink2_0_0.win)
		self.wxgui_scopesink2_0 = scopesink2.scope_sink_f(
			self.nb.GetPage(2).GetWin(),
			title="Scope Plot",
			sample_rate=aprs_rate,
			v_scale=0.05,
			v_offset=0,
			t_scale=0.002,
			ac_couple=False,
			xy_mode=False,
			num_inputs=1,
			trig_mode=gr.gr_TRIG_MODE_AUTO,
			y_axis_label="Counts",
		)
		self.nb.GetPage(2).Add(self.wxgui_scopesink2_0.win)
		self.wxgui_fftsink2_0 = fftsink2.fft_sink_c(
			self.nb.GetPage(0).GetWin(),
			baseband_freq=0,
			y_per_div=10,
			y_divs=10,
			ref_level=-20,
			ref_scale=2.0,
			sample_rate=samp_rate,
			fft_size=1024,
			fft_rate=15,
			average=True,
			avg_alpha=0.5,
			title="FFT Plot",
			peak_hold=False,
		)
		self.nb.GetPage(0).Add(self.wxgui_fftsink2_0.win)
		def wxgui_fftsink2_0_callback(x, y):
			self.set_freq_offset(x)
		
		self.wxgui_fftsink2_0.set_callback(wxgui_fftsink2_0_callback)
		self.uhd_usrp_source_0 = uhd.usrp_source(
			device_addr="",
			stream_args=uhd.stream_args(
				cpu_format="fc32",
				channels=range(1),
			),
		)
		self.uhd_usrp_source_0.set_samp_rate(samp_rate)
		self.uhd_usrp_source_0.set_center_freq(freq, 0)
		self.uhd_usrp_source_0.set_gain(gain, 0)
		self.uhd_usrp_source_0.set_antenna(ant, 0)
		self.low_pass_filter_0 = gr.fir_filter_ccf(1, firdes.low_pass(
			1, aprs_rate, 2e3, 600, firdes.WIN_HAMMING, 6.76))
		self.gr_single_pole_iir_filter_xx_0 = gr.single_pole_iir_filter_ff(0.0001, 1)
		self.gr_null_sink_0 = gr.null_sink(gr.sizeof_float*1)
		self.gr_multiply_xx_0 = gr.multiply_vcc(1)
		self.gr_multiply_const_vxx_0 = gr.multiply_const_vff((audio_mul, ))
		self.gr_agc_xx_1 = gr.agc_ff(1e-3, 0.8, 0.1, 10.0)
		self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(xlate_decim, (firdes.low_pass(1, samp_rate, xlate_bandwidth/2, 1000)), freq_offset, samp_rate)
		self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(10, .25 * (0.05)**2, 0.5, 0.005, 0.005)
		self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb()
		self.blocks_sub_xx_0 = blocks.sub_ff(1)
		self.blocks_float_to_complex_0 = blocks.float_to_complex(1)
		self.blks2_rational_resampler_xxx_0_0 = blks2.rational_resampler_ccc(
			interpolation=quad_rate,
			decimation=int(samp_rate/xlate_decim),
			taps=None,
			fractional_bw=None,
		)
		self.blks2_rational_resampler_xxx_0 = blks2.rational_resampler_ccc(
			interpolation=aprs_rate,
			decimation=quad_rate,
			taps=None,
			fractional_bw=None,
		)
		self.blks2_nbfm_rx_0_0 = blks2.nbfm_rx(
			audio_rate=audio_rate,
			quad_rate=quad_rate,
			tau=75e-6,
			max_dev=25000,
		)
		self.blks2_nbfm_rx_0 = blks2.nbfm_rx(
			audio_rate=aprs_rate,
			quad_rate=quad_rate,
			tau=75e-6,
			max_dev=3e3,
		)
		self.ax25_print_frame_0 = packetradio.queue_watcher_thread(ax25_print_frame_0_msgq_in)
		self.ax25_hdlc_framer_b_0 = packetradio.hdlc_framer(ax25_hdlc_framer_b_0_msgq_out, False)
		self.analog_sig_source_x_0 = analog.sig_source_c(aprs_rate, analog.GR_SIN_WAVE, -(min(mark,space)+sym_dev), 1, 0)
		self.analog_quadrature_demod_cf_0 = analog.quadrature_demod_cf(aprs_rate/(2*math.pi*sym_dev))
		self.analog_pwr_squelch_xx_0_0_0 = analog.pwr_squelch_cc(-70, 1e-1, 0, False)
		self.analog_pwr_squelch_xx_0_0 = analog.pwr_squelch_cc(-70, 1e-1, 0, False)

		##################################################
		# Connections
		##################################################
		self.connect((self.uhd_usrp_source_0, 0), (self.wxgui_fftsink2_0, 0))
		self.connect((self.blks2_rational_resampler_xxx_0_0, 0), (self.blks2_rational_resampler_xxx_0, 0))
		self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.blks2_rational_resampler_xxx_0_0, 0))
		self.connect((self.blks2_rational_resampler_xxx_0, 0), (self.wxgui_waterfallsink2_0, 0))
		self.connect((self.uhd_usrp_source_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0))
		self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0))
		self.connect((self.blocks_sub_xx_0, 0), (self.digital_clock_recovery_mm_xx_0, 0))
		self.connect((self.gr_single_pole_iir_filter_xx_0, 0), (self.blocks_sub_xx_0, 1))
		self.connect((self.analog_quadrature_demod_cf_0, 0), (self.gr_single_pole_iir_filter_xx_0, 0))
		self.connect((self.analog_quadrature_demod_cf_0, 0), (self.blocks_sub_xx_0, 0))
		self.connect((self.low_pass_filter_0, 0), (self.analog_quadrature_demod_cf_0, 0))
		self.connect((self.gr_multiply_xx_0, 0), (self.low_pass_filter_0, 0))
		self.connect((self.analog_sig_source_x_0, 0), (self.gr_multiply_xx_0, 1))
		self.connect((self.blocks_float_to_complex_0, 0), (self.gr_multiply_xx_0, 0))
		self.connect((self.blks2_nbfm_rx_0, 0), (self.blocks_float_to_complex_0, 0))
		self.connect((self.blks2_nbfm_rx_0, 0), (self.blocks_float_to_complex_0, 1))
		self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.wxgui_scopesink2_0_0_0, 0))
		self.connect((self.digital_binary_slicer_fb_0, 0), (self.ax25_hdlc_framer_b_0, 0))
		self.connect((self.blks2_nbfm_rx_0, 0), (self.wxgui_scopesink2_0, 0))
		self.connect((self.blks2_rational_resampler_xxx_0_0, 0), (self.analog_pwr_squelch_xx_0_0, 0))
		self.connect((self.analog_pwr_squelch_xx_0_0_0, 0), (self.blks2_nbfm_rx_0, 0))
		self.connect((self.blks2_rational_resampler_xxx_0_0, 0), (self.analog_pwr_squelch_xx_0_0_0, 0))
		self.connect((self.analog_quadrature_demod_cf_0, 0), (self.wxgui_scopesink2_0_0, 0))
		self.connect((self.blks2_nbfm_rx_0_0, 0), (self.gr_agc_xx_1, 0))
		self.connect((self.analog_pwr_squelch_xx_0_0, 0), (self.blks2_nbfm_rx_0_0, 0))
		self.connect((self.gr_agc_xx_1, 0), (self.gr_multiply_const_vxx_0, 0))
		self.connect((self.gr_multiply_const_vxx_0, 0), (self.gr_null_sink_0, 0))
Esempio n. 8
0
    def __init__(self, subdev_spec, gain, audio_output):
        gr.hier_block2.__init__(
            self,
            "receive_path",
            gr.io_signature(0, 0, 0),  # Input signature
            gr.io_signature(0, 0, 0))  # Output signature

        self.u = usrp.source_c()
        adc_rate = self.u.adc_rate()

        self.if_rate = 256e3  # 256 kS/s
        usrp_decim = int(adc_rate // self.if_rate)
        if_decim = 4
        self.u.set_decim_rate(usrp_decim)
        self.quad_rate = self.if_rate // if_decim  #  64 kS/s
        audio_decim = 2
        self.audio_rate = self.quad_rate // audio_decim  #  32 kS/s

        if subdev_spec is None:
            subdev_spec = usrp.pick_rx_subdevice(self.u)
        self.subdev = usrp.selected_subdev(self.u, subdev_spec)
        print "Using RX d'board %s" % (self.subdev.side_and_name(), )

        self.u.set_mux(usrp.determine_rx_mux_value(self.u, subdev_spec))

        # Create filter to get actual channel we want
        chan_coeffs = gr.firdes.low_pass(
            1.0,  # gain
            self.if_rate,  # sampling rate
            8e3,  # low pass cutoff freq
            2e3,  # width of trans. band
            gr.firdes.WIN_HANN)  # filter type

        print "len(rx_chan_coeffs) =", len(chan_coeffs)

        # Decimating Channel filter with frequency translation
        # complex in and out, float taps
        self.ddc = gr.freq_xlating_fir_filter_ccf(
            if_decim,  # decimation rate
            chan_coeffs,  # taps
            0,  # frequency translation amount
            self.if_rate)  # input sample rate

        if USE_SIMPLE_SQUELCH:
            self.squelch = gr.simple_squelch_cc(20)
        else:
            self.squelch = blks2.standard_squelch(self.audio_rate)

    # instantiate the guts of the single channel receiver
        self.fmrx = blks2.nbfm_rx(self.audio_rate, self.quad_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)

        # now wire it all together
        if USE_SIMPLE_SQUELCH:
            self.connect(self.u, self.ddc, self.squelch, self.fmrx,
                         self._audio_gain, audio_sink)
        else:
            self.connect(self.u, self.ddc, self.fmrx, self.squelch,
                         self._audio_gain, audio_sink)

        if gain is None:
            # if no gain was specified, use the mid-point in dB
            g = self.subdev.gain_range()
            gain = float(g[0] + g[1]) / 2

        self.set_gain(gain)

        v = self.volume_range()
        self.set_volume((v[0] + v[1]) / 2)
        s = self.squelch_range()
        self.set_squelch((s[0] + s[1]) / 2)
Esempio n. 9
0
    def __init__(self):
        grc_wxgui.top_block_gui.__init__(self, title="APRS Receiver")

        ##################################################
        # Variables
        ##################################################
        self.space = space = 1200
        self.mark = mark = 2200
        self.xlate_decim = xlate_decim = 8
        self.xlate_bandwidth = xlate_bandwidth = 1200 * 6
        self.sym_dev = sym_dev = (mark - space) / 2
        self.samp_rate = samp_rate = 1e6
        self.quad_rate = quad_rate = 96000
        self.gain = gain = 10
        self.freq_offset = freq_offset = 390e3
        self.freq = freq = 144e6
        self.baud = baud = 1200
        self.audio_rate = audio_rate = 48000
        self.audio_mul = audio_mul = 1
        self.aprs_rate = aprs_rate = 12000
        self.ant = ant = 'TX/RX'

        ##################################################
        # Message Queues
        ##################################################
        ax25_hdlc_framer_b_0_msgq_out = ax25_print_frame_0_msgq_in = gr.msg_queue(
            2)

        ##################################################
        # Blocks
        ##################################################
        self.nb = self.nb = wx.Notebook(self.GetWin(), style=wx.NB_TOP)
        self.nb.AddPage(grc_wxgui.Panel(self.nb), "Baseband")
        self.nb.AddPage(grc_wxgui.Panel(self.nb), "Waterfall")
        self.nb.AddPage(grc_wxgui.Panel(self.nb), "Signal")
        self.nb.AddPage(grc_wxgui.Panel(self.nb), "Slicer")
        self.nb.AddPage(grc_wxgui.Panel(self.nb), "Eye")
        self.Add(self.nb)
        _gain_sizer = wx.BoxSizer(wx.VERTICAL)
        self._gain_text_box = forms.text_box(
            parent=self.GetWin(),
            sizer=_gain_sizer,
            value=self.gain,
            callback=self.set_gain,
            label="RF Gain",
            converter=forms.float_converter(),
            proportion=0,
        )
        self._gain_slider = forms.slider(
            parent=self.GetWin(),
            sizer=_gain_sizer,
            value=self.gain,
            callback=self.set_gain,
            minimum=0,
            maximum=50,
            num_steps=50,
            style=wx.SL_HORIZONTAL,
            cast=float,
            proportion=1,
        )
        self.Add(_gain_sizer)
        _freq_offset_sizer = wx.BoxSizer(wx.VERTICAL)
        self._freq_offset_text_box = forms.text_box(
            parent=self.GetWin(),
            sizer=_freq_offset_sizer,
            value=self.freq_offset,
            callback=self.set_freq_offset,
            label="Freq Offset",
            converter=forms.float_converter(),
            proportion=0,
        )
        self._freq_offset_slider = forms.slider(
            parent=self.GetWin(),
            sizer=_freq_offset_sizer,
            value=self.freq_offset,
            callback=self.set_freq_offset,
            minimum=-500e3,
            maximum=500e3,
            num_steps=1000,
            style=wx.SL_HORIZONTAL,
            cast=float,
            proportion=1,
        )
        self.Add(_freq_offset_sizer)
        self._freq_text_box = forms.text_box(
            parent=self.GetWin(),
            value=self.freq,
            callback=self.set_freq,
            label="Freq",
            converter=forms.float_converter(),
        )
        self.Add(self._freq_text_box)
        _audio_mul_sizer = wx.BoxSizer(wx.VERTICAL)
        self._audio_mul_text_box = forms.text_box(
            parent=self.GetWin(),
            sizer=_audio_mul_sizer,
            value=self.audio_mul,
            callback=self.set_audio_mul,
            label="Audio",
            converter=forms.float_converter(),
            proportion=0,
        )
        self._audio_mul_slider = forms.slider(
            parent=self.GetWin(),
            sizer=_audio_mul_sizer,
            value=self.audio_mul,
            callback=self.set_audio_mul,
            minimum=0,
            maximum=10,
            num_steps=1000,
            style=wx.SL_HORIZONTAL,
            cast=float,
            proportion=1,
        )
        self.Add(_audio_mul_sizer)
        self._ant_chooser = forms.drop_down(
            parent=self.GetWin(),
            value=self.ant,
            callback=self.set_ant,
            label="Antenna",
            choices=['TX/RX', 'RX2'],
            labels=[],
        )
        self.Add(self._ant_chooser)
        self.wxgui_waterfallsink2_0 = waterfallsink2.waterfall_sink_c(
            self.nb.GetPage(1).GetWin(),
            baseband_freq=0,
            dynamic_range=50,
            ref_level=-65,
            ref_scale=2.0,
            sample_rate=aprs_rate,
            fft_size=512,
            fft_rate=15,
            average=False,
            avg_alpha=None,
            title="Waterfall Plot",
        )
        self.nb.GetPage(1).Add(self.wxgui_waterfallsink2_0.win)
        self.wxgui_scopesink2_0_0_0 = scopesink2.scope_sink_f(
            self.nb.GetPage(4).GetWin(),
            title="Scope Plot",
            sample_rate=aprs_rate / 10,
            v_scale=0.5,
            v_offset=0,
            t_scale=0.002,
            ac_couple=False,
            xy_mode=False,
            num_inputs=1,
            trig_mode=gr.gr_TRIG_MODE_AUTO,
            y_axis_label="Counts",
        )
        self.nb.GetPage(4).Add(self.wxgui_scopesink2_0_0_0.win)
        self.wxgui_scopesink2_0_0 = scopesink2.scope_sink_f(
            self.nb.GetPage(3).GetWin(),
            title="Scope Plot",
            sample_rate=aprs_rate,
            v_scale=0.5,
            v_offset=0,
            t_scale=0.002,
            ac_couple=False,
            xy_mode=False,
            num_inputs=1,
            trig_mode=gr.gr_TRIG_MODE_AUTO,
            y_axis_label="Counts",
        )
        self.nb.GetPage(3).Add(self.wxgui_scopesink2_0_0.win)
        self.wxgui_scopesink2_0 = scopesink2.scope_sink_f(
            self.nb.GetPage(2).GetWin(),
            title="Scope Plot",
            sample_rate=aprs_rate,
            v_scale=0.05,
            v_offset=0,
            t_scale=0.002,
            ac_couple=False,
            xy_mode=False,
            num_inputs=1,
            trig_mode=gr.gr_TRIG_MODE_AUTO,
            y_axis_label="Counts",
        )
        self.nb.GetPage(2).Add(self.wxgui_scopesink2_0.win)
        self.wxgui_fftsink2_0 = fftsink2.fft_sink_c(
            self.nb.GetPage(0).GetWin(),
            baseband_freq=0,
            y_per_div=10,
            y_divs=10,
            ref_level=-20,
            ref_scale=2.0,
            sample_rate=samp_rate,
            fft_size=1024,
            fft_rate=15,
            average=True,
            avg_alpha=0.5,
            title="FFT Plot",
            peak_hold=False,
        )
        self.nb.GetPage(0).Add(self.wxgui_fftsink2_0.win)

        def wxgui_fftsink2_0_callback(x, y):
            self.set_freq_offset(x)

        self.wxgui_fftsink2_0.set_callback(wxgui_fftsink2_0_callback)
        self.uhd_usrp_source_0 = uhd.usrp_source(
            device_addr="",
            stream_args=uhd.stream_args(
                cpu_format="fc32",
                channels=range(1),
            ),
        )
        self.uhd_usrp_source_0.set_samp_rate(samp_rate)
        self.uhd_usrp_source_0.set_center_freq(freq, 0)
        self.uhd_usrp_source_0.set_gain(gain, 0)
        self.uhd_usrp_source_0.set_antenna(ant, 0)
        self.low_pass_filter_0 = gr.fir_filter_ccf(
            1, firdes.low_pass(1, aprs_rate, 2e3, 600, firdes.WIN_HAMMING,
                               6.76))
        self.gr_single_pole_iir_filter_xx_0 = gr.single_pole_iir_filter_ff(
            0.0001, 1)
        self.gr_null_sink_0 = gr.null_sink(gr.sizeof_float * 1)
        self.gr_multiply_xx_0 = gr.multiply_vcc(1)
        self.gr_multiply_const_vxx_0 = gr.multiply_const_vff((audio_mul, ))
        self.gr_agc_xx_1 = gr.agc_ff(1e-3, 0.8, 0.1, 10.0)
        self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(
            xlate_decim,
            (firdes.low_pass(1, samp_rate, xlate_bandwidth / 2, 1000)),
            freq_offset, samp_rate)
        self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(
            10, .25 * (0.05)**2, 0.5, 0.005, 0.005)
        self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb()
        self.blocks_sub_xx_0 = blocks.sub_ff(1)
        self.blocks_float_to_complex_0 = blocks.float_to_complex(1)
        self.blks2_rational_resampler_xxx_0_0 = blks2.rational_resampler_ccc(
            interpolation=quad_rate,
            decimation=int(samp_rate / xlate_decim),
            taps=None,
            fractional_bw=None,
        )
        self.blks2_rational_resampler_xxx_0 = blks2.rational_resampler_ccc(
            interpolation=aprs_rate,
            decimation=quad_rate,
            taps=None,
            fractional_bw=None,
        )
        self.blks2_nbfm_rx_0_0 = blks2.nbfm_rx(
            audio_rate=audio_rate,
            quad_rate=quad_rate,
            tau=75e-6,
            max_dev=25000,
        )
        self.blks2_nbfm_rx_0 = blks2.nbfm_rx(
            audio_rate=aprs_rate,
            quad_rate=quad_rate,
            tau=75e-6,
            max_dev=3e3,
        )
        self.ax25_print_frame_0 = packetradio.queue_watcher_thread(
            ax25_print_frame_0_msgq_in)
        self.ax25_hdlc_framer_b_0 = packetradio.hdlc_framer(
            ax25_hdlc_framer_b_0_msgq_out, False)
        self.analog_sig_source_x_0 = analog.sig_source_c(
            aprs_rate, analog.GR_SIN_WAVE, -(min(mark, space) + sym_dev), 1, 0)
        self.analog_quadrature_demod_cf_0 = analog.quadrature_demod_cf(
            aprs_rate / (2 * math.pi * sym_dev))
        self.analog_pwr_squelch_xx_0_0_0 = analog.pwr_squelch_cc(
            -70, 1e-1, 0, False)
        self.analog_pwr_squelch_xx_0_0 = analog.pwr_squelch_cc(
            -70, 1e-1, 0, False)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.uhd_usrp_source_0, 0), (self.wxgui_fftsink2_0, 0))
        self.connect((self.blks2_rational_resampler_xxx_0_0, 0),
                     (self.blks2_rational_resampler_xxx_0, 0))
        self.connect((self.freq_xlating_fir_filter_xxx_0, 0),
                     (self.blks2_rational_resampler_xxx_0_0, 0))
        self.connect((self.blks2_rational_resampler_xxx_0, 0),
                     (self.wxgui_waterfallsink2_0, 0))
        self.connect((self.uhd_usrp_source_0, 0),
                     (self.freq_xlating_fir_filter_xxx_0, 0))
        self.connect((self.digital_clock_recovery_mm_xx_0, 0),
                     (self.digital_binary_slicer_fb_0, 0))
        self.connect((self.blocks_sub_xx_0, 0),
                     (self.digital_clock_recovery_mm_xx_0, 0))
        self.connect((self.gr_single_pole_iir_filter_xx_0, 0),
                     (self.blocks_sub_xx_0, 1))
        self.connect((self.analog_quadrature_demod_cf_0, 0),
                     (self.gr_single_pole_iir_filter_xx_0, 0))
        self.connect((self.analog_quadrature_demod_cf_0, 0),
                     (self.blocks_sub_xx_0, 0))
        self.connect((self.low_pass_filter_0, 0),
                     (self.analog_quadrature_demod_cf_0, 0))
        self.connect((self.gr_multiply_xx_0, 0), (self.low_pass_filter_0, 0))
        self.connect((self.analog_sig_source_x_0, 0),
                     (self.gr_multiply_xx_0, 1))
        self.connect((self.blocks_float_to_complex_0, 0),
                     (self.gr_multiply_xx_0, 0))
        self.connect((self.blks2_nbfm_rx_0, 0),
                     (self.blocks_float_to_complex_0, 0))
        self.connect((self.blks2_nbfm_rx_0, 0),
                     (self.blocks_float_to_complex_0, 1))
        self.connect((self.digital_clock_recovery_mm_xx_0, 0),
                     (self.wxgui_scopesink2_0_0_0, 0))
        self.connect((self.digital_binary_slicer_fb_0, 0),
                     (self.ax25_hdlc_framer_b_0, 0))
        self.connect((self.blks2_nbfm_rx_0, 0), (self.wxgui_scopesink2_0, 0))
        self.connect((self.blks2_rational_resampler_xxx_0_0, 0),
                     (self.analog_pwr_squelch_xx_0_0, 0))
        self.connect((self.analog_pwr_squelch_xx_0_0_0, 0),
                     (self.blks2_nbfm_rx_0, 0))
        self.connect((self.blks2_rational_resampler_xxx_0_0, 0),
                     (self.analog_pwr_squelch_xx_0_0_0, 0))
        self.connect((self.analog_quadrature_demod_cf_0, 0),
                     (self.wxgui_scopesink2_0_0, 0))
        self.connect((self.blks2_nbfm_rx_0_0, 0), (self.gr_agc_xx_1, 0))
        self.connect((self.analog_pwr_squelch_xx_0_0, 0),
                     (self.blks2_nbfm_rx_0_0, 0))
        self.connect((self.gr_agc_xx_1, 0), (self.gr_multiply_const_vxx_0, 0))
        self.connect((self.gr_multiply_const_vxx_0, 0),
                     (self.gr_null_sink_0, 0))
Esempio n. 10
0
	def __init__(self):
		grc_wxgui.top_block_gui.__init__(self, title="Top Block")

		##################################################
		# Variables
		##################################################
		self.variable_slider_0 = variable_slider_0 = 0
		self.samp_rate = samp_rate = 500e3

		##################################################
		# Controls
		##################################################
		_variable_slider_0_sizer = wx.BoxSizer(wx.VERTICAL)
		self._variable_slider_0_text_box = forms.text_box(
			parent=self.GetWin(),
			sizer=_variable_slider_0_sizer,
			value=self.variable_slider_0,
			callback=self.set_variable_slider_0,
			label="Volume",
			converter=forms.float_converter(),
			proportion=0,
		)
		self._variable_slider_0_slider = forms.slider(
			parent=self.GetWin(),
			sizer=_variable_slider_0_sizer,
			value=self.variable_slider_0,
			callback=self.set_variable_slider_0,
			minimum=0,
			maximum=100,
			num_steps=100,
			style=wx.SL_HORIZONTAL,
			cast=float,
			proportion=1,
		)
		self.Add(_variable_slider_0_sizer)

		##################################################
		# Blocks
		##################################################
		self.audio_sink_0 = audio.sink(48000, "", True)
		self.blks2_nbfm_rx_0 = blks2.nbfm_rx(
			audio_rate=25000,
			quad_rate=100000,
			tau=75e-6,
			max_dev=15e3,
		)
		self.blks2_rational_resampler_xxx_0 = blks2.rational_resampler_ccc(
			interpolation=1,
			decimation=5,
			taps=None,
			fractional_bw=None,
		)
		self.blks2_rational_resampler_xxx_1 = blks2.rational_resampler_fff(
			interpolation=48,
			decimation=25,
			taps=None,
			fractional_bw=None,
		)
		self.gr_multiply_const_vxx_0 = gr.multiply_const_vff((variable_slider_0, ))
		self.gr_multiply_const_vxx_1 = gr.multiply_const_vcc((100e3, ))
		self.low_pass_filter_0 = gr.fir_filter_ccf(1, firdes.low_pass(
			10, samp_rate, 5e3, 10e3, firdes.WIN_HAMMING, 6.76))
		self.uhd_single_usrp_source_0 = uhd.single_usrp_source(
			device_addr="addr=192.168.10.3",
			io_type=uhd.io_type.COMPLEX_FLOAT32,
			num_channels=1,
		)
		self.uhd_single_usrp_source_0.set_samp_rate(samp_rate)
		self.uhd_single_usrp_source_0.set_center_freq(462.5625e6, 0)
		self.uhd_single_usrp_source_0.set_gain(45, 0)
		self.wxgui_waterfallsink2_0 = waterfallsink2.waterfall_sink_c(
			self.GetWin(),
			baseband_freq=0,
			dynamic_range=100,
			ref_level=50,
			ref_scale=2.0,
			sample_rate=samp_rate,
			fft_size=512,
			fft_rate=15,
			average=False,
			avg_alpha=None,
			title="Waterfall Plot",
		)
		self.Add(self.wxgui_waterfallsink2_0.win)

		##################################################
		# Connections
		##################################################
		self.connect((self.blks2_nbfm_rx_0, 0), (self.blks2_rational_resampler_xxx_1, 0))
		self.connect((self.blks2_rational_resampler_xxx_0, 0), (self.blks2_nbfm_rx_0, 0))
		self.connect((self.low_pass_filter_0, 0), (self.blks2_rational_resampler_xxx_0, 0))
		self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.gr_multiply_const_vxx_0, 0))
		self.connect((self.uhd_single_usrp_source_0, 0), (self.gr_multiply_const_vxx_1, 0))
		self.connect((self.gr_multiply_const_vxx_1, 0), (self.low_pass_filter_0, 0))
		self.connect((self.gr_multiply_const_vxx_0, 0), (self.audio_sink_0, 0))
		self.connect((self.low_pass_filter_0, 0), (self.wxgui_waterfallsink2_0, 0))
Esempio n. 11
0
	def __init__(self):
		grc_wxgui.top_block_gui.__init__(self, title="Nbfm")
		_icon_path = "/usr/local/share/icons/hicolor/32x32/apps/gnuradio-grc.png"
		self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY))

		##################################################
		# Variables
		##################################################
		self.samp_rate = samp_rate = 1000000
		self.frq_offset = frq_offset = 0
		self.base_frq = base_frq = 144800000

		##################################################
		# Blocks
		##################################################
		_frq_offset_sizer = wx.BoxSizer(wx.VERTICAL)
		self._frq_offset_text_box = forms.text_box(
			parent=self.GetWin(),
			sizer=_frq_offset_sizer,
			value=self.frq_offset,
			callback=self.set_frq_offset,
			label='frq_offset',
			converter=forms.float_converter(),
			proportion=0,
		)
		self._frq_offset_slider = forms.slider(
			parent=self.GetWin(),
			sizer=_frq_offset_sizer,
			value=self.frq_offset,
			callback=self.set_frq_offset,
			minimum=-100000,
			maximum=100000,
			num_steps=1000,
			style=wx.SL_HORIZONTAL,
			cast=float,
			proportion=1,
		)
		self.Add(_frq_offset_sizer)
		self._base_frq_text_box = forms.text_box(
			parent=self.GetWin(),
			value=self.base_frq,
			callback=self.set_base_frq,
			label='base_frq',
			converter=forms.float_converter(),
		)
		self.Add(self._base_frq_text_box)
		self.wxgui_fftsink2_0 = fftsink2.fft_sink_c(
			self.GetWin(),
			baseband_freq=0,
			y_per_div=10,
			y_divs=10,
			ref_level=0,
			ref_scale=2.0,
			sample_rate=samp_rate,
			fft_size=1024,
			fft_rate=15,
			average=False,
			avg_alpha=None,
			title="FFT Plot",
			peak_hold=False,
		)
		self.Add(self.wxgui_fftsink2_0.win)
		self.rtl2832_source_0 = baz.rtl_source_c(defer_creation=True)
		self.rtl2832_source_0.set_verbose(True)
		self.rtl2832_source_0.set_vid(0x0)
		self.rtl2832_source_0.set_pid(0x0)
		self.rtl2832_source_0.set_tuner_name("")
		self.rtl2832_source_0.set_default_timeout(0)
		self.rtl2832_source_0.set_use_buffer(False)
		self.rtl2832_source_0.set_fir_coefficients(([]))
		
		
		
		
		
		if self.rtl2832_source_0.create() == False: raise Exception("Failed to create RTL2832 Source: rtl2832_source_0")
		
		self.rtl2832_source_0.set_bandwidth(300000)
		
		self.rtl2832_source_0.set_sample_rate(samp_rate)
		
		self.rtl2832_source_0.set_frequency(base_frq+frq_offset)
		
		
		self.rtl2832_source_0.set_auto_gain_mode(False)
		self.rtl2832_source_0.set_relative_gain(True)
		self.rtl2832_source_0.set_gain(30)
		  
		self.blks2_rational_resampler_xxx_0 = blks2.rational_resampler_ccc(
			interpolation=48,
			decimation=1000,
			taps=None,
			fractional_bw=None,
		)
		self.blks2_nbfm_rx_0 = blks2.nbfm_rx(
			audio_rate=48000,
			quad_rate=48000,
			tau=75e-6,
			max_dev=5e3,
		)
		self.audio_sink_0 = audio.sink(48000, "pulse", True)

		##################################################
		# Connections
		##################################################
		self.connect((self.blks2_nbfm_rx_0, 0), (self.audio_sink_0, 0))
		self.connect((self.blks2_rational_resampler_xxx_0, 0), (self.blks2_nbfm_rx_0, 0))
		self.connect((self.rtl2832_source_0, 0), (self.blks2_rational_resampler_xxx_0, 0))
		self.connect((self.rtl2832_source_0, 0), (self.wxgui_fftsink2_0, 0))