예제 #1
0
 def _setup_usrp(self, options):
     print "******************************************************Reception parameters***************************"
     print "USRP Adress: ", options.address
     print "Transmission Freqeuncy: ", eng_notation.num_to_str(options.freq)
     print "Sample rate or (Freqeuncy Sampling): ", eng_notation.num_to_str(options.samp_rate)
     print "Samples per symbol: ", options.samples_per_symbol
     print "Data rate : ", eng_notation.num_to_str(options.data_rate)
     print "Gain  : ", options.gain
     print "*******************************************************Reception parameters************************"
                     
     self.data_rate = options.data_rate
     self.samples_per_symbol = options.samples_per_symbol
     
     samp_rate= options.samp_rate
     
     u = uhd.usrp_source(
         device_addr=options.address, 
         stream_args=uhd.stream_args(
         cpu_format="fc32",
         channels=range(1),
         ),
     )
     u.set_subdev_spec("A:0", 0)
     u.set_samp_rate(samp_rate)
     u.set_center_freq(options.freq, 0)
     u.set_gain(options.gain, 0)
     
     self._usrp = u
예제 #2
0
    def __init__(self, options):
        gr.top_block.__init__(self)

        self.u = usrp2.sink_32fc(options.interface, options.mac_addr)
        self.samples_per_symbol = 2
        self.chan_num = options.channel
        self.data_rate = int(self.u.dac_rate() / self.samples_per_symbol / options.interp_rate)

        self.u.set_center_freq(ieee802_15_4_pkt.chan_802_15_4.chan_map[self.chan_num])
        self.u.set_interp(options.interp_rate)
        if not options.gain:
            g = self.u.gain_range()
            options.gain = float(g[0] + g[1]) / 2

        self.u.set_gain(options.gain)

        print "cordic_freq = %s" % (eng_notation.num_to_str(ieee802_15_4_pkt.chan_802_15_4.chan_map[self.chan_num]))
        print "data_rate = ", eng_notation.num_to_str(self.data_rate)
        print "samples_per_symbol = ", self.samples_per_symbol
        print "usrp_interp = ", options.interp_rate

        # self.u.set_pga(0, options.gain)
        # self.u.set_pga(1, options.gain)

        # transmitter
        self.packet_transmitter = ieee802_15_4_pkt.ieee802_15_4_mod_pkts(
            self, spb=self.samples_per_symbol, msgq_limit=2
        )
        self.gain = gr.multiply_const_cc(1)

        self.connect(self.packet_transmitter, self.gain, self.u)
예제 #3
0
    def _setup_usrp_sink(self, options):
        """
        Creates a USRP sink, determines the settings for best bitrate,
        and attaches to the transmitter's subdevice.
        """
        self.u = usrp_options.create_usrp_sink(options)
        dac_rate = self.u.dac_rate()
        self.rs_rate = options.bitrate    # Store requested bit rate
            
        (self._bitrate, self._samples_per_symbol, self._interp) = \
                        pick_tx_bitrate(options.bitrate, self._modulator_class.bits_per_symbol(),
                                        options.samples_per_symbol, options.interp,
                                        dac_rate, self.u.get_interp_rates())

        options.interp = self._interp
        options.samples_per_symbol = self._samples_per_symbol
        options.bitrate = self._bitrate

        if options.verbose:
            print 'USRP Sink:', self.u
            print "Interpolation Rate: ", self._interp
        
        self.u.set_interp(self._interp)
        self.u.set_auto_tr(True)

        if not self.u.set_center_freq(options.tx_freq):
            print "Failed to set Rx frequency to %s" % (eng_notation.num_to_str(options.tx_freq))
            raise ValueError, eng_notation.num_to_str(options.tx_freq)
예제 #4
0
파일: bts_top.py 프로젝트: csboyer/RFID-BTS
  def __init__(self,options,usrp_rate,usrp_interp,tari_rate):
    gr.hier_block2.__init__(self,"downlink_usrp_sink",
                            gr.io_signature(1,1,gr.sizeof_gr_complex),
                            gr.io_signature(0,0,0))

    self.u = usrp.sink_c()

    #setup daughter boards
    #subdev_spec = usrp.pick_tx_subdevice(self.u)
    subdev_spec = (1, 0)
    self.subdev = usrp.selected_subdev(self.u,subdev_spec)
    self.u.set_mux(usrp.determine_tx_mux_value(self.u,subdev_spec))
    print "Using TX d'board %s" % (self.subdev.side_and_name(),)

    #set interp rate
    self.u.set_interp_rate(usrp_interp)
    self.subdev.set_gain(self.subdev.gain_range()[2])
    
    #setup frequency
    if not self.set_freq(options.freq):
      freq_range = self.subdev.freq_range()
      print "Failed to set frequency to %s.  Daughterboard supports %s to %s" % (
            eng_notation.num_to_str(options.freq),
            eng_notation.num_to_str(freq_range[0]),
            eng_notation.num_to_str(freq_range[1]))
      raise SystemExit
    
    self.subdev.set_enable(True)

    self.connect(self,self.u)
예제 #5
0
파일: usrp_tx.py 프로젝트: alring/op25
    def set_freq(self, target_freq):
        """
        Set the center frequency we're interested in.

        @param target_freq: frequency in Hz
        @rypte: bool

        Tuning is a two step process.  First we ask the front-end to
        tune as close to the desired frequency as it can.  Then we use
        the result of that operation and our target_frequency to
        determine the value for the digital up converter.  Finally, we feed
        any residual_freq to the s/w freq translater.
        """

        r = self.u.tune(self.subdev.which(), self.subdev, target_freq)
        if r:
            print "r.baseband_freq =", eng_notation.num_to_str(r.baseband_freq)
            print "r.dxc_freq      =", eng_notation.num_to_str(r.dxc_freq)
            print "r.residual_freq =", eng_notation.num_to_str(r.residual_freq)
            print "r.inverted      =", r.inverted
            
            # Could use residual_freq in s/w freq translator
            return True

        return False
예제 #6
0
    def set_freq(self, side, target_freq):
        """
        Set the center frequency we're interested in.

        @param side: 0 = side A, 1 = side B
        @param target_freq: frequency in Hz
        @rtype: bool

        Tuning is a two step process.  First we ask the front-end to
        tune as close to the desired frequency as it can.  Then we use
        the result of that operation and our target_frequency to
        determine the value for the digital up converter.
        """

        print "Tuning side %s to %sHz" % (("A", "B")[side], num_to_str(target_freq))
        r = self.u.tune(self.subdev[side].which(), self.subdev[side], target_freq)
        if r:
            print "  r.baseband_freq =", num_to_str(r.baseband_freq)
            print "  r.dxc_freq      =", num_to_str(r.dxc_freq)
            print "  r.residual_freq =", num_to_str(r.residual_freq)
            print "  r.inverted      =", r.inverted
            print "  OK"
            return True

        else:
            print "  Failed!"

        return False
예제 #7
0
def time_it(tb):
    start = os.times()
    tb.run()
    stop = os.times()
    delta = map((lambda a, b: a-b), stop, start)
    user, sys, childrens_user, childrens_sys, real = delta
    total_user = user + childrens_user
    total_sys  = sys + childrens_sys
    res = dict()
    res = {'pipes': tb.npipes, 'stages': tb.nstages, 'nsamples': tb.nsamples,
                                            'realtime': real, 'usertime': total_user,
                                            'systime': total_sys, 
                                            'totaltime': (total_user+total_sys)/real,
                                            'pseudo_flop': tb.flop,
                                            'pseudoflopreal': tb.flop/real}
    if tb.machine_readable:
        # print "%3d %3d %.3e %7.3f %7.3f %7.3f %7.3f %.6e %.3e" % (
        #     tb.npipes, tb.nstages, tb.nsamples, real, total_user, total_sys, (total_user+total_sys)/real, tb.flop, tb.flop/real)
        insert_results(tb.conn, res)
    else:
        print "npipes           %7d"   % (tb.npipes,)
        print "nstages          %7d"   % (tb.nstages,)
        print "nsamples         %s"    % (eng_notation.num_to_str(tb.nsamples),)
        print "real             %7.3f" % (real,)
        print "user             %7.3f" % (total_user,)
        print "sys              %7.3f" % (total_sys,)
        print "(user+sys)/real  %7.3f" % ((total_user + total_sys)/real,)
        print "pseudo_flop      %s"    % (eng_notation.num_to_str(tb.flop),)
        print "pseudo_flop/real %s"    % (eng_notation.num_to_str(tb.flop/real),)
예제 #8
0
    def __init__(self, callback, options):
        gr.top_block.__init__(self)

        self._rx_freq            = options.rx_freq         # receiver's center frequency
        self._rx_gain            = options.rx_gain         # receiver's gain
        self._rx_subdev_spec     = options.rx_subdev_spec  # daughterboard to use
        self._decim              = options.decim           # Decimating rate for the USRP (prelim)
        self._fusb_block_size    = options.fusb_block_size # usb info for USRP
        self._fusb_nblocks       = options.fusb_nblocks    # usb info for USRP

        if self._rx_freq is None:
            sys.stderr.write("-f FREQ or --freq FREQ or --rx-freq FREQ must be specified\n")
            raise SystemExit

        # Set up USRP source
        self._setup_usrp_source()
        ok = self.set_freq(self._rx_freq)
        if not ok:
            print "Failed to set Rx frequency to %s" % (eng_notation.num_to_str(self._rx_freq))
            raise ValueError, eng_notation.num_to_str(self._rx_freq)
        g = self.subdev.gain_range()
        if options.show_rx_gain_range:
            print "Rx Gain Range: minimum = %g, maximum = %g, step size = %g" \
                  % (g[0], g[1], g[2])
        self.set_gain(options.rx_gain)
        self.set_auto_tr(True)                 # enable Auto Transmit/Receive switching

        # Set up receive path
        self.rxpath = receive_path(callback, options)

        self.connect(self.u, self.rxpath)
예제 #9
0
def argument_parser():
    parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
    parser.add_option(
        "-c", "--chan-est", dest="chan_est", type="intx", default=1,
        help="Set chan_est [default=%default]")
    parser.add_option(
        "-d", "--dopp", dest="dopp", type="eng_float", default=eng_notation.num_to_str(400),
        help="Set dopp [default=%default]")
    parser.add_option(
        "-e", "--encoding", dest="encoding", type="intx", default=0,
        help="Set encoding [default=%default]")
    parser.add_option(
        "-o", "--freq-offset", dest="freq_offset", type="eng_float", default=eng_notation.num_to_str(0),
        help="Set freq_offset [default=%default]")
    parser.add_option(
        "-i", "--interval", dest="interval", type="intx", default=500,
        help="Set interval [default=%default]")
    parser.add_option(
        "-n", "--nmessages", dest="nmessages", type="intx", default=50,
        help="Set nmessages [default=%default]")
    parser.add_option(
        "-t", "--ntrials", dest="ntrials", type="intx", default=0,
        help="Set ntrials [default=%default]")
    parser.add_option(
        "-r", "--resultdir", dest="resultdir", type="string", default="0",
        help="Set resultdir [default=%default]")
    parser.add_option(
        "-s", "--snr", dest="snr", type="eng_float", default=eng_notation.num_to_str(10),
        help="Set snr [default=%default]")
    return parser
예제 #10
0
파일: howto_rx.py 프로젝트: sherlock/ofdm
def main():
	tb = gr.top_block()
	ofdm_rx = howto.ofdm_rx();
        #rs = gr.vector_source_c()
	#rs = gr.file_source(gr.sizeof_gr_complex,'out.dat')
	src = usrp.source_c(0)
	#nchannel
	src.set_nchannels(1)
	sample_rate = 1e6

	ulist = [src]
	print "ulist"
	print ulist
	
	for u in ulist:
		rdecim = int(u.adc_rate() / sample_rate)
		u.set_decim_rate(rdecim)
	sys.stderr.write("the decimate = %d\n"%(rdecim))


	srx1 = usrp.pick_rx_subdevice(src)
	print "srx1="
	print srx1

	subdev = ()
	"""configure USRP mux and set rx/tx subdev """
	ulist = [src]
	assert len(ulist) == 1
	src = ulist[0]
	src.set_mux( usrp.determine_rx_mux_value(src, srx1))
	subdev += (usrp.selected_subdev(src, srx1), )
	for s in subdev: exec("if not hasattr(s, '_u'): s._u = src")
	for s in subdev: s.set_auto_tr(True)
	
	print "subdev"
	print subdev

	freq = 2400000000.0
	for s in subdev:
		r = usrp.tune(s._u, s.which(), s, freq)
		if r:
			sys.stderr.write("setting frequency of %s :\n"%(str(s)))
			sys.stderr.write(" baseband frequency = %s \n" %(eng_notation.num_to_str(r.baseband_freq)))
			sys.stderr.write(" DUC/DDC offset = %s\n" %(eng_notation.num_to_str(r.dxc_freq)))
		elif not r:
			sys.stderr.write("Unable to set frequency of %s to %g MHz \n"%(str(s), freq/ 1.0e6))

	#g = 40.0
	for s in subdev:
		gain_range = s.gain_range()
		#rx_gain = max(min(g, gain_range[1]), gain_range[0])
		rx_gain = 0.3 * gain_range[1]
		s.set_gain(rx_gain)
	sys.stderr.write("the rx_gain = %d \n " %(rx_gain))


	tb.connect(src, ofdm_rx)
	print 'connect'
	tb.run()
예제 #11
0
 def _print_verbage(self):
     """
     Prints information about the UHD transmitter
     """
     print "\nUHD Receiver:"
     print "Freq:         %sHz"  % (eng_notation.num_to_str(self._freq))
     print "Gain:         %f dB" % (self._gain)
     print "Sample Rate:  %ssps" % (eng_notation.num_to_str(self._rate))
예제 #12
0
def argument_parser():
    description = 'A NOAA APT Decoder with automatic image synchronization'
    parser = OptionParser(usage="%prog: [options]", option_class=eng_option, description=description)
    parser.add_option(
        "", "--antenna", dest="antenna", type="string", default=satnogs.not_set_antenna,
        help="Set antenna [default=%default]")
    parser.add_option(
        "", "--bb-gain", dest="bb_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_bb_gain),
        help="Set bb_gain [default=%default]")
    parser.add_option(
        "", "--decoded-data-file-path", dest="decoded_data_file_path", type="string", default='/tmp/.satnogs/data/noaa',
        help="Set decoded_data_file_path [default=%default]")
    parser.add_option(
        "", "--dev-args", dest="dev_args", type="string", default=satnogs.not_set_dev_args,
        help="Set dev_args [default=%default]")
    parser.add_option(
        "", "--doppler-correction-per-sec", dest="doppler_correction_per_sec", type="intx", default=20,
        help="Set doppler_correction_per_sec [default=%default]")
    parser.add_option(
        "", "--enable-iq-dump", dest="enable_iq_dump", type="intx", default=0,
        help="Set enable_iq_dump [default=%default]")
    parser.add_option(
        "", "--file-path", dest="file_path", type="string", default='/tmp/test.ogg',
        help="Set file_path [default=%default]")
    parser.add_option(
        "", "--flip-images", dest="flip_images", type="intx", default=0,
        help="Set flip_images [default=%default]")
    parser.add_option(
        "", "--if-gain", dest="if_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_if_gain),
        help="Set if_gain [default=%default]")
    parser.add_option(
        "", "--iq-file-path", dest="iq_file_path", type="string", default='/tmp/iq.dat',
        help="Set iq_file_path [default=%default]")
    parser.add_option(
        "", "--lo-offset", dest="lo_offset", type="eng_float", default=eng_notation.num_to_str(100e3),
        help="Set lo_offset [default=%default]")
    parser.add_option(
        "", "--ppm", dest="ppm", type="intx", default=0,
        help="Set ppm [default=%default]")
    parser.add_option(
        "", "--rf-gain", dest="rf_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_rf_gain),
        help="Set rf_gain [default=%default]")
    parser.add_option(
        "", "--rigctl-port", dest="rigctl_port", type="intx", default=4532,
        help="Set rigctl_port [default=%default]")
    parser.add_option(
        "", "--rx-freq", dest="rx_freq", type="eng_float", default=eng_notation.num_to_str(90.4e6),
        help="Set rx_freq [default=%default]")
    parser.add_option(
        "", "--rx-sdr-device", dest="rx_sdr_device", type="string", default='usrpb200',
        help="Set rx_sdr_device [default=%default]")
    parser.add_option(
        "", "--sync", dest="sync", type="intx", default=1,
        help="Set sync [default=%default]")
    parser.add_option(
        "", "--waterfall-file-path", dest="waterfall_file_path", type="string", default='/tmp/waterfall.dat',
        help="Set waterfall_file_path [default=%default]")
    return parser
예제 #13
0
def argument_parser():
    description = 'FSK9600 AX.25 decoder'
    parser = OptionParser(usage="%prog: [options]", option_class=eng_option, description=description)
    parser.add_option(
        "", "--antenna", dest="antenna", type="string", default=satnogs.not_set_antenna,
        help="Set antenna [default=%default]")
    parser.add_option(
        "", "--bb-gain", dest="bb_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_bb_gain),
        help="Set bb_gain [default=%default]")
    parser.add_option(
        "", "--decoded-data-file-path", dest="decoded_data_file_path", type="string", default='/tmp/.satnogs/data/data',
        help="Set decoded_data_file_path [default=%default]")
    parser.add_option(
        "", "--dev-args", dest="dev_args", type="string", default=satnogs.not_set_dev_args,
        help="Set dev_args [default=%default]")
    parser.add_option(
        "", "--doppler-correction-per-sec", dest="doppler_correction_per_sec", type="intx", default=1000,
        help="Set doppler_correction_per_sec [default=%default]")
    parser.add_option(
        "", "--enable-iq-dump", dest="enable_iq_dump", type="intx", default=0,
        help="Set enable_iq_dump [default=%default]")
    parser.add_option(
        "", "--file-path", dest="file_path", type="string", default='test.wav',
        help="Set file_path [default=%default]")
    parser.add_option(
        "", "--if-gain", dest="if_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_if_gain),
        help="Set if_gain [default=%default]")
    parser.add_option(
        "", "--iq-file-path", dest="iq_file_path", type="string", default='/tmp/iq.dat',
        help="Set iq_file_path [default=%default]")
    parser.add_option(
        "", "--lo-offset", dest="lo_offset", type="eng_float", default=eng_notation.num_to_str(100e3),
        help="Set lo_offset [default=%default]")
    parser.add_option(
        "", "--ppm", dest="ppm", type="intx", default=0,
        help="Set ppm [default=%default]")
    parser.add_option(
        "", "--rf-gain", dest="rf_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_rf_gain),
        help="Set rf_gain [default=%default]")
    parser.add_option(
        "", "--rigctl-port", dest="rigctl_port", type="intx", default=4532,
        help="Set rigctl_port [default=%default]")
    parser.add_option(
        "", "--rx-freq", dest="rx_freq", type="eng_float", default=eng_notation.num_to_str(100e6),
        help="Set rx_freq [default=%default]")
    parser.add_option(
        "", "--rx-sdr-device", dest="rx_sdr_device", type="string", default='usrpb200',
        help="Set rx_sdr_device [default=%default]")
    parser.add_option(
        "", "--udp-IP", dest="udp_IP", type="string", default='127.0.0.1',
        help="Set udp_IP [default=%default]")
    parser.add_option(
        "", "--udp-port", dest="udp_port", type="intx", default=16887,
        help="Set udp_port [default=%default]")
    parser.add_option(
        "", "--waterfall-file-path", dest="waterfall_file_path", type="string", default='/tmp/waterfall.dat',
        help="Set waterfall_file_path [default=%default]")
    return parser
예제 #14
0
파일: Param.py 프로젝트: BillX86/gnuradio
 def num_to_str(num):
     if isinstance(num, COMPLEX_TYPES):
         num = complex(num) #cast to python complex
         if num == 0: return '0' #value is zero
         elif num.imag == 0: return '%s'%eng_notation.num_to_str(num.real) #value is real
         elif num.real == 0: return '%sj'%eng_notation.num_to_str(num.imag) #value is imaginary
         elif num.imag < 0: return '%s-%sj'%(eng_notation.num_to_str(num.real), eng_notation.num_to_str(abs(num.imag)))
         else: return '%s+%sj'%(eng_notation.num_to_str(num.real), eng_notation.num_to_str(num.imag))
     else: return str(num)
예제 #15
0
    def __init__(self, callback, options):
        gr.top_block.__init__(self)


        self._tx_freq            = options.tx_freq         # tranmitter's center frequency
        self._tx_subdev_spec     = options.tx_subdev_spec  # daughterboard to use
        self._interp             = options.interp          # interpolating rate for the USRP (prelim)
        self._rx_freq            = options.rx_freq         # receiver's center frequency
        self._rx_gain            = options.rx_gain         # receiver's gain
        self._rx_subdev_spec     = options.rx_subdev_spec  # daughterboard to use
        self._decim              = options.decim           # Decimating rate for the USRP (prelim)
        self._fusb_block_size    = options.fusb_block_size # usb info for USRP
        self._fusb_nblocks       = options.fusb_nblocks    # usb info for USRP
        
        # linklab
        self.carrier_map         = options.carrier_map     # carrier map
        self.occupied_tones      = options.occupied_tones  # occupied tones
        self.which               = options.which           # usrp in use 
        self.id                  = options.id              # link ID
        self.nosense             = options.nosense         # sensing or not
        self.tx_amplitude        = options.tx_amplitude    # tx amplitude
        self._fft_length         = options.fft_length      # fft length
        self._strategy           = options.strategy         # spectrum access strategy
        
        if self._tx_freq is None:
            sys.stderr.write("-f FREQ or --freq FREQ or --tx-freq FREQ must be specified\n")
            raise SystemExit

        if self._rx_freq is None:
            sys.stderr.write("-f FREQ or --freq FREQ or --rx-freq FREQ must be specified\n")
            raise SystemExit

        # Set up USRP sink and source
        self._setup_usrp_sink()
        ok = self.set_snk_freq(self._tx_freq)
        if not ok:
            print "Failed to set Tx frequency to %s" % (eng_notation.num_to_str(self._tx_freq),)
            raise ValueError

        self._setup_usrp_source()
        ok = self.set_src_freq(self._tx_freq)
        if not ok:
            print "Failed to set Rx frequency to %s" % (eng_notation.num_to_str(self._tx_freq),)
            raise ValueError

        # copy the final answers back into options for use by modulator
        #options.bitrate = self._bitrate

        self.txpath = transmit_path(options)
        self.rxpath = receive_path(callback, options)
        self.senspath = sensing_path(options)

        self.connect(self.txpath, self.u_snk)
        self.connect(self.u_src, self.rxpath)
        
        #if options.sender and not self.nosense:
        self.connect(self.u_src, self.senspath)
예제 #16
0
 def _setup_source(self, options):
     self.u = usrp_options.create_usrp_source(options)
     adc_rate = self.u.adc_rate()
     self.u.set_decim(options.decim)
     self.u.set_bandwidth(options.bandwidth)
     self.u.set_samp_rate(options.sample_rate)
     if not self.u.set_center_freq(options.rx_freq):
         print "Failed to set Rx frequency to %s" % (eng_notation.num_to_str(options.rx_freq))
         raise ValueError, eng_notation.num_to_str(options.rx_freq)
예제 #17
0
    def __init__(self, options, rx_callback):
        gr.top_block.__init__(self)
        print "cordic_freq = %s" % (eng_notation.num_to_str (options.cordic_freq))


        # ----------------------------------------------------------------

        self.data_rate = options.data_rate
        self.samples_per_symbol = 2
        self.usrp_decim = int (64e6 / self.samples_per_symbol / self.data_rate)
        self.fs = self.data_rate * self.samples_per_symbol
        payload_size = 128             # bytes

        print "data_rate = ", eng_notation.num_to_str(self.data_rate)
        print "samples_per_symbol = ", self.samples_per_symbol
        print "usrp_decim = ", self.usrp_decim
        print "fs = ", eng_notation.num_to_str(self.fs)

        samp_rate=1e6
        u = uhd.usrp_source(
            device_addr="serial=4c758445",
            stream_args=uhd.stream_args(
            cpu_format="fc32",
            channels=range(1),
            ),
        )
        u.set_subdev_spec("A:0", 0)
        u.set_samp_rate(samp_rate)
        u.set_center_freq(options.cordic_freq, 0)
        u.set_gain(options.gain, 0)
        
        #u = usrp.source_c (0, self.usrp_decim)
        
        #if options.rx_subdev_spec is None:
        #    options.rx_subdev_spec = pick_subdevice(u)
        #u.set_mux(usrp.determine_rx_mux_value(u, options.rx_subdev_spec))
        
    
        #subdev = usrp.selected_subdev(u, options.rx_subdev_spec)
        # print "Using RX d'board %s" % (subdev.side_and_name(),)
       
        # u.tune(0, subdev, options.cordic_freq)
       
        #u.set_pga(0, options.gain)
        #u.set_pga(1, options.gain)

        self.u = u

        self.packet_receiver = ieee802_15_4_pkt.ieee802_15_4_demod_pkts(self,
                                                                callback=rx_callback,
                                                                sps=self.samples_per_symbol,
                                                                symbol_rate=self.data_rate,
                                                                threshold=-1)

        self.squelch = gr.pwr_squelch_cc(50, 1, 0, True)
        self.connect(self.u, self.squelch, self.packet_receiver)
 def _print_verbage(self):
     """
     Prints information about the transmit path
     """
     print "Using TX d'board %s"    % (self.subdev.side_and_name(),)
     print "Tx amplitude     %s"    % (self._tx_amplitude)
     print "modulation:      %s"    % (self._modulator_class.__name__)
     print "bitrate:         %sb/s" % (eng_notation.num_to_str(self._bitrate))
     print "samples/symbol:  %3d"   % (self._samples_per_symbol)
     print "interp:          %3d"   % (self._interp)
     print "Tx Frequency:    %s"    % (eng_notation.num_to_str(self._tx_freq))
예제 #19
0
 def _print_verbage(self):
     """
     Prints information about the UHD transmitter
     """
     print "\nUHD Transmitter:"
     print "Args:     %s"    % (self._args)
     print "Freq:        %sHz"  % (eng_notation.num_to_str(self._freq))
     print "Gain:        %f dB" % (self._gain)
     print "Sample Rate: %ssps" % (eng_notation.num_to_str(self._rate))
     print "Antenna:     %s"    % (self._ant)
     print "Subdev Sec:  %s"    % (self._spec)
예제 #20
0
파일: bts_top.py 프로젝트: csboyer/RFID-BTS
 def set_freq(self,target_freq):
   r = self.u.tune(self.subdev.which(),self.subdev,target_freq)
   if r:
     print "r.baseband_freq =", eng_notation.num_to_str(r.baseband_freq)
     print "r.dxc_freq      =", eng_notation.num_to_str(r.dxc_freq)
     print "r.residual_freq =", eng_notation.num_to_str(r.residual_freq)
     print "r.inverted      =", r.inverted
     # Could use residual_freq in s/w freq translator
     return True
   
   return False
예제 #21
0
파일: ss2.py 프로젝트: michaelld/gr-pyqt
def argument_parser():
    parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
    parser.add_option(
        "", "--center-freq", dest="center_freq", type="eng_float", default=eng_notation.num_to_str(0),
        help="Set center_freq [default=%default]")
    parser.add_option(
        "", "--filename", dest="filename", type="string", default="/tmp/such_samples.cfile",
        help="Set filename [default=%default]")
    parser.add_option(
        "", "--samp-rate", dest="samp_rate", type="eng_float", default=eng_notation.num_to_str(2.4e6),
        help="Set samp_rate [default=%default]")
    return parser
예제 #22
0
 def _print_verbage(self):
     """
     Prints information about the receive path
     """
     print "\nReceive Path:"
     print "Using RX d'board %s"    % (self.subdev.side_and_name(),)
     print "Rx gain:         %g"    % (self.gain,)
     print "modulation:      %s"    % (self._demod_class.__name__)
     print "bitrate:         %sb/s" % (eng_notation.num_to_str(self._bitrate))
     print "samples/symbol:  %3d"   % (self._samples_per_symbol)
     print "decim:           %3d"   % (self._decim)
     print "Rx Frequency:    %s"    % (eng_notation.num_to_str(self._rx_freq))
예제 #23
0
def argument_parser():
    parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
    parser.add_option(
        "-n", "--filename", dest="filename", type="string", default="0.dat",
        help="Set name [default=%default]")
    parser.add_option(
        "-f", "--freq", dest="freq", type="eng_float", default=eng_notation.num_to_str(90.1e6),
        help="Set freq [default=%default]")
    parser.add_option(
        "-r", "--samp-rate", dest="samp_rate", type="eng_float", default=eng_notation.num_to_str(1e6),
        help="Set rate [default=%default]")
    return parser
예제 #24
0
파일: top_block.py 프로젝트: viraptor/ook
def argument_parser():
    parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
    parser.add_option(
        "", "--large-sig-len", dest="large_sig_len", type="eng_float", default=eng_notation.num_to_str(0.0015),
        help="Set large_sig_len [default=%default]")
    parser.add_option(
        "", "--signal-mult", dest="signal_mult", type="eng_float", default=eng_notation.num_to_str(2),
        help="Set signal_mult [default=%default]")
    parser.add_option(
        "", "--freq", dest="freq", type="intx", default=433866000,
        help="Set freq [default=%default]")
    return parser
예제 #25
0
    def __init__(self):
        gr.flow_graph.__init__(self)

        parser = OptionParser (option_class=eng_option)
        parser.add_option("-R", "--rx-subdev-spec", type="subdev", default='B',
                          help="select USRP Rx side A or B (default=first one with a daughterboard)")
        parser.add_option ("-c", "--cordic-freq", type="eng_float", default=434845200,
                           help="set rx cordic frequency to FREQ", metavar="FREQ")
        parser.add_option ("-g", "--gain", type="eng_float", default=0,
                           help="set Rx PGA gain in dB [0,20]")
        
        (options, args) = parser.parse_args ()
        print "cordic_freq = %s" % (eng_notation.num_to_str (options.cordic_freq))
        

        # ----------------------------------------------------------------

        self.freq = 1000
        self.samples_per_symbol = 256
        self.usrp_decim = int (64e6 / self.samples_per_symbol / self.freq)
        self.fs = self.freq * self.samples_per_symbol

        print "freq = ", eng_notation.num_to_str(self.freq)
        print "samples_per_symbol = ", self.samples_per_symbol
        print "usrp_decim = ", self.usrp_decim
        print "fs = ", eng_notation.num_to_str(self.fs)

        u = usrp.source_s (0, self.usrp_decim)
        if options.rx_subdev_spec is None:
            options.rx_subdev_spec = pick_subdevice(u)
        u.set_mux(usrp.determine_rx_mux_value(u, options.rx_subdev_spec))

        subdev = usrp.selected_subdev(u, options.rx_subdev_spec)
        print "Using RX d'board %s" % (subdev.side_and_name(),)

        u.tune(0, subdev, options.cordic_freq)
        u.set_pga(0, options.gain)
        u.set_pga(1, options.gain)

        self.u = u

        self.filesink = gr.file_sink(gr.sizeof_float, 'rx_sin.dat')
        self.stof = gr.short_to_float()

        filter_coeffs = gr.firdes.low_pass (1.0,                # gain
                                          self.fs,                # sampling rate
                                          self.freq,              # low pass cutoff freq
                                          0.1*self.freq,                # width of trans. band
                                          gr.firdes.WIN_HANN) # filter type 
        
        self.lowpass = gr.fir_filter_fff(1, filter_coeffs)
        self.connect(self.u, self.stof, self.lowpass, self.filesink)
예제 #26
0
def argument_parser():
    parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
    parser.add_option(
        "", "--ampl", dest="ampl", type="eng_float", default=eng_notation.num_to_str(0.7),
        help="Set TX BB amp [default=%default]")
    parser.add_option(
        "-a", "--args", dest="args", type="string", default='',
        help="Set USRP device args [default=%default]")
    parser.add_option(
        "-t", "--arq-timeout", dest="arq_timeout", type="eng_float", default=eng_notation.num_to_str(.1*0 + 0.04),
        help="Set ARQ timeout [default=%default]")
    parser.add_option(
        "-d", "--dest-addr", dest="dest_addr", type="intx", default=-1,
        help="Set Destination address [default=%default]")
    parser.add_option(
        "", "--iface", dest="iface", type="string", default='tun0',
        help="Set Interface name [default=%default]")
    parser.add_option(
        "", "--max-arq-attempts", dest="max_arq_attempts", type="intx", default=5 * 2,
        help="Set Max ARQ attempts [default=%default]")
    parser.add_option(
        "", "--mtu", dest="mtu", type="intx", default=128,
        help="Set MTU [default=%default]")
    parser.add_option(
        "-l", "--ogradio-addr", dest="ogradio_addr", type="intx", default=0,
        help="Set Local address [default=%default]")
    parser.add_option(
        "", "--ogrx-freq", dest="ogrx_freq", type="eng_float", default=eng_notation.num_to_str(915e6),
        help="Set RX freq [default=%default]")
    parser.add_option(
        "", "--ogtx-freq", dest="ogtx_freq", type="eng_float", default=eng_notation.num_to_str(915e6),
        help="Set TX freq [default=%default]")
    parser.add_option(
        "", "--port", dest="port", type="string", default="12345",
        help="Set TCP port [default=%default]")
    parser.add_option(
        "-r", "--rate", dest="rate", type="eng_float", default=eng_notation.num_to_str(1e6),
        help="Set Sample rate [default=%default]")
    parser.add_option(
        "-A", "--rx-antenna", dest="rx_antenna", type="string", default="TX/RX",
        help="Set RX antenna [default=%default]")
    parser.add_option(
        "", "--rx-gain", dest="rx_gain", type="eng_float", default=eng_notation.num_to_str(65-20),
        help="Set RX gain [default=%default]")
    parser.add_option(
        "", "--rx-lo-offset", dest="rx_lo_offset", type="eng_float", default=eng_notation.num_to_str(0),
        help="Set RX LO offset [default=%default]")
    parser.add_option(
        "", "--samps-per-sym", dest="samps_per_sym", type="intx", default=4,
        help="Set Samples/symbol [default=%default]")
    parser.add_option(
        "", "--tx-gain", dest="tx_gain", type="eng_float", default=eng_notation.num_to_str(45),
        help="Set TX gain [default=%default]")
    parser.add_option(
        "", "--tx-lo-offset", dest="tx_lo_offset", type="eng_float", default=eng_notation.num_to_str(0),
        help="Set TX LO offset [default=%default]")
    return parser
예제 #27
0
 def _print_verbage(self):
     """
     Prints information about the UHD transmitter
     """
     print "\nUHD Receiver:"
     print "UHD Args:     %s"    % (self._args)
     print "Freq:         %sHz"  % (eng_notation.num_to_str(self._freq))
     print "LO Offset:    %sHz"  % (eng_notation.num_to_str(self._lo_offset)) 
     print "Gain:         %f dB" % (self._gain)
     print "Sample Rate:  %ssps" % (eng_notation.num_to_str(self._rate))
     print "Antenna:      %s"    % (self._ant)
     print "Spec:         %s"    % (self._spec)
     print "Clock Source: %s"    % (self._clock_source) 
예제 #28
0
 def _print_verbage(self):
     """
     Prints information about the UHD transmitter
     """
     print "\nUHD Receiver:"
     print "UHD Args:    %s"    % (self._args)
     print "Freq:        %sHz"  % (eng_notation.num_to_str(self._freq))
     print "Gain:        %f dB" % (self._gain)
     print "Sample Rate: %ssps" % (eng_notation.num_to_str(self._rate))
     print "Antenna:     %s"    % (self._ant)
     print "Subdev Sec:  %s"    % (self._spec)
     if self._external:
         print "\n Using External Clock and PPS \n"
예제 #29
0
 def _print_verbage(self):
   """
   Prints information about the transmit path
   """
   print "\nTransmit Path:"
   print "Bandwidth:       %s"    % (eng_notation.num_to_str(self._bandwidth))
   if "self.u" in vars(self):
     print "Using TX d'board %s"    % (self.subdev.side_and_name(),)
     print "Tx gain:         %g"    % (self.gain,)
     print "FPGA interp:    %3d"    % (self._interp)
     print "Software interp:%3d"    % (self._interpolation)
     print "Tx Frequency:    %s"    % (eng_notation.num_to_str(self._tx_freq))
     print "DAC rate:        %s"    % (eng_notation.num_to_str(self.u.dac_rate()))
   print ""
예제 #30
0
def argument_parser():
    parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
    parser.add_option(
        "", "--addr", dest="addr", type="string", default="127.0.0.1",
        help="Set addr [default=%default]")
    parser.add_option(
        "", "--alpha", dest="alpha", type="eng_float", default=eng_notation.num_to_str(0.5),
        help="Set alpha [default=%default]")
    parser.add_option(
        "", "--bb-gain", dest="bb_gain", type="eng_float", default=eng_notation.num_to_str(0.65),
        help="Set bb_gain [default=%default]")
    parser.add_option(
        "", "--port", dest="port", type="string", default="4000",
        help="Set port [default=%default]")
    parser.add_option(
        "", "--samps-per-symb", dest="samps_per_symb", type="eng_float", default=eng_notation.num_to_str(4),
        help="Set samps_per_symb [default=%default]")
    parser.add_option(
        "", "--tx-correct", dest="tx_correct", type="eng_float", default=eng_notation.num_to_str(0),
        help="Set tx_correct [default=%default]")
    parser.add_option(
        "", "--tx-freq", dest="tx_freq", type="eng_float", default=eng_notation.num_to_str(2402e6),
        help="Set tx_freq [default=%default]")
    parser.add_option(
        "", "--tx-gain", dest="tx_gain", type="eng_float", default=eng_notation.num_to_str(20),
        help="Set tx_gain [default=%default]")
    parser.add_option(
        "", "--samp-rate", dest="samp_rate", type="eng_float", default=eng_notation.num_to_str(100e3),
        help="Set samp_rate [default=%default]")
    parser.add_option(
        "", "--tx-offset", dest="tx_offset", type="eng_float", default=eng_notation.num_to_str(50e3),
        help="Set tx_offset [default=%default]")
    return parser
예제 #31
0
    def __init__(self, ppm=0, osr=4, fc=925.2e6, samp_rate_in=20e6, ca=[]):
        self.num_streams = len(ca)
        gr.hier_block2.__init__(
            self, "GSM wideband input adaptor",
            gr.io_signature(1, 1, gr.sizeof_gr_complex*1),
            gr.io_signature(self.num_streams, self.num_streams, gr.sizeof_gr_complex*1),
        )

        ##################################################
        # Parameters
        ##################################################
        self.ppm = ppm
        self.osr = osr
        self.fc = fc
        self.samp_rate_in = samp_rate_in
        self.ca = ca
        self.blocks_fir_filters = {}
        self.blocks_resamplers = {}
        self.blocks_ocs = {}
        self.band = band = 'E-GSM'  # TODO make selectable

        ##################################################
        # Variables
        ##################################################
        self.samp_rate_out = samp_rate_out = 1625000.0/6.0*osr

        ##################################################
        # Blocks
        ##################################################
        self.ppm_in = None
        self.message_port_register_hier_out("ppm_in")
        #self.lpf = firdes.low_pass(1, samp_rate_out, 125e3, 5e3, firdes.WIN_HAMMING, 6.76)
        self.lpf = firdes.low_pass(1, samp_rate_in, 125e3, 75e3, firdes.WIN_HAMMING, 6.76)
        self.gsm_clock_offset_corrector_0 = grgsm.clock_offset_corrector(
            fc=fc,
            ppm=ppm,
            samp_rate_in=samp_rate_in,
        )

        c0_arfcn = arfcn.downlink2arfcn(fc, band)
        print("Extracting channels %s, given that the center frequency is at ARFCN %d (%s)" % (str(ca), c0_arfcn, eng_notation.num_to_str(fc)))

        self.connect((self, 0), (self.gsm_clock_offset_corrector_0, 0))

        output_port = 0
        for channel in ca:
            channel_freq = arfcn.arfcn2downlink(channel, band)
            if channel_freq is None:
                print("Warning: invalid ARFCN %d for band %s" % (channel, band))
                continue
            freq_diff = channel_freq - fc
            print("ARFCN %d is at C0 %+d KHz" % (channel, int(freq_diff / 1000.0)))

            self.blocks_resamplers[channel] = filter.fractional_resampler_cc(0, samp_rate_in/samp_rate_out)
            self.blocks_fir_filters[channel] = filter.freq_xlating_fir_filter_ccc(1, self.lpf, freq_diff, samp_rate_in)
            self.connect((self.gsm_clock_offset_corrector_0, 0), (self.blocks_fir_filters[channel], 0))
            self.connect((self.blocks_fir_filters[channel], 0), (self.blocks_resamplers[channel], 0))
            self.connect((self.blocks_resamplers[channel], 0), (self, output_port))
            output_port += 1

        ##################################################
        # Asynch Message Connections
        ##################################################
        self.msg_connect(self, "ppm_in", self.gsm_clock_offset_corrector_0, "ppm_in")
예제 #32
0
def listUsrp(option, opt, value, parser):
    id = 0
    while (true) :
        try:
            version = usrp._look_for_usrp(id)
            print "USRP #%i" % id
            print " Rev: %i" % version
            dst = usrp.sink_c(id)
            src = usrp.source_c(id)
            print " Tx"
            for db in dst.db:
                if (db[0].dbid() != -1):
                    print "  %s" % db[0].side_and_name()
                    (min, max, offset) = db[0].freq_range()
                    print "   Frequency"
                    print "    Min:    %sHz" % num_to_str(min)
                    print "    Max:    %sHz" % num_to_str(max)
                    print "    Offset: %sHz" % num_to_str(offset)
                    (min, max, offset) = db[0].gain_range()
                    print "   Gain"
                    print "    Min:    %sdB" % num_to_str(min)
                    print "    Max:    %sdB" % num_to_str(max)
                    print "    Offset: %sdB" % num_to_str(offset)
            print " Rx"
            for db in src.db:
                if (db[0].dbid() != -1):
                    print "  %s" % db[0].side_and_name()
                    (min, max, offset) = db[0].freq_range()
                    print "   Frequency"
                    print "    Min:    %sHz" % num_to_str(min)
                    print "    Max:    %sHz" % num_to_str(max)
                    print "    Offset: %sHz" % num_to_str(offset)
                    (min, max, offset) = db[0].gain_range()
                    print "   Gain"
                    print "    Min:    %sdB" % num_to_str(min)
                    print "    Max:    %sdB" % num_to_str(max)
                    print "    Offset: %sdB" % num_to_str(offset)
        except RuntimeError:
            break
        id += 1

    raise SystemExit
예제 #33
0
 def set_Gain1(self, Gain1):
     self.Gain1 = Gain1
     Qt.QMetaObject.invokeMethod(self._Gain1_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.Gain1)))
     self.rtlsdr_source_0.set_gain(self.Gain1, 0)
예제 #34
0
 def set_Elevation(self, Elevation):
     self.Elevation = Elevation
     Qt.QMetaObject.invokeMethod(self._Elevation_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.Elevation)))
예제 #35
0
 def set_Azimuth(self, Azimuth):
     self.Azimuth = Azimuth
     Qt.QMetaObject.invokeMethod(self._Azimuth_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.Azimuth)))
예제 #36
0
 def set_alpha(self, alpha):
     self.alpha = alpha
     Qt.QMetaObject.invokeMethod(self._alpha_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.alpha)))
    def __init__(self):
        gr.top_block.__init__(self, "VCC Burst TX/RX, 9600 Baud GMSK, AX.25, w/ PTT")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("VCC Burst TX/RX, 9600 Baud GMSK, AX.25, w/ PTT")
        qtgui.util.check_set_qss()
        try:
            self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
        except:
            pass
        self.top_scroll_layout = Qt.QVBoxLayout()
        self.setLayout(self.top_scroll_layout)
        self.top_scroll = Qt.QScrollArea()
        self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame)
        self.top_scroll_layout.addWidget(self.top_scroll)
        self.top_scroll.setWidgetResizable(True)
        self.top_widget = Qt.QWidget()
        self.top_scroll.setWidget(self.top_widget)
        self.top_layout = Qt.QVBoxLayout(self.top_widget)
        self.top_grid_layout = Qt.QGridLayout()
        self.top_layout.addLayout(self.top_grid_layout)

        self.settings = Qt.QSettings("GNU Radio", "burst_trx_gmsk9600_ax25_n210")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())


        ##################################################
        # Variables
        ##################################################
        self.tx_freq = tx_freq = 401.12e6
        self.uplink_freq = uplink_freq = tx_freq
        self.ts_str = ts_str = dt.strftime(dt.utcnow(), "%Y%m%d_%H%M%S" )
        self.gs_id = gs_id = "VTGS"
        self.tx_tune = tx_tune = tx_freq - uplink_freq
        self.samp_rate = samp_rate = float(250e3)
        self.man_tune = man_tune = 0.0
        self.fn = fn = "VCC_{:s}_{:s}".format(gs_id, ts_str)
        self.uplink_offset = uplink_offset = -1* tx_tune
        self.tx_tune_sel = tx_tune_sel = 0
        self.tx_sel = tx_sel = [tx_tune, -1*man_tune]
        self.tx_offset = tx_offset = samp_rate/2
        self.tx_gain = tx_gain = 10
        self.trigger_thresh = trigger_thresh = -2
        self.rx_offset = rx_offset = samp_rate/2.0
        self.rx_gain = rx_gain = 20
        self.rx_freq = rx_freq = 401.08e6
        self.interp_2 = interp_2 = 1
        self.interp = interp = 48
        self.fsk_dev = fsk_dev = 10000
        self.fp = fp = "/vtgs/captures/vcc/{:s}".format(fn)
        self.decim_2 = decim_2 = 2
        self.decim = decim = int(samp_rate/2000)
        self.chan_filt_trans = chan_filt_trans = 1000
        self.chan_filt_cutoff = chan_filt_cutoff = 24000
        self.ceres_offset = ceres_offset = 40e3
        self.bb_gain = bb_gain = .75

        ##################################################
        # Blocks
        ##################################################
        self.main_tab = Qt.QTabWidget()
        self.main_tab_widget_0 = Qt.QWidget()
        self.main_tab_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.main_tab_widget_0)
        self.main_tab_grid_layout_0 = Qt.QGridLayout()
        self.main_tab_layout_0.addLayout(self.main_tab_grid_layout_0)
        self.main_tab.addTab(self.main_tab_widget_0, 'Full Band')
        self.main_tab_widget_1 = Qt.QWidget()
        self.main_tab_layout_1 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.main_tab_widget_1)
        self.main_tab_grid_layout_1 = Qt.QGridLayout()
        self.main_tab_layout_1.addLayout(self.main_tab_grid_layout_1)
        self.main_tab.addTab(self.main_tab_widget_1, 'RX Channel')
        self.main_tab_widget_2 = Qt.QWidget()
        self.main_tab_layout_2 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.main_tab_widget_2)
        self.main_tab_grid_layout_2 = Qt.QGridLayout()
        self.main_tab_layout_2.addLayout(self.main_tab_grid_layout_2)
        self.main_tab.addTab(self.main_tab_widget_2, 'TX Channel')
        self.top_grid_layout.addWidget(self.main_tab, 0, 0, 2, 8)
        for r in range(0, 2):
            self.top_grid_layout.setRowStretch(r, 1)
        for c in range(0, 8):
            self.top_grid_layout.setColumnStretch(c, 1)
        self._tx_tune_sel_options = (0, 1, )
        self._tx_tune_sel_labels = ('Auto', 'Manual', )
        self._tx_tune_sel_tool_bar = Qt.QToolBar(self)
        self._tx_tune_sel_tool_bar.addWidget(Qt.QLabel('TX Tune Mode'+": "))
        self._tx_tune_sel_combo_box = Qt.QComboBox()
        self._tx_tune_sel_tool_bar.addWidget(self._tx_tune_sel_combo_box)
        for label in self._tx_tune_sel_labels: self._tx_tune_sel_combo_box.addItem(label)
        self._tx_tune_sel_callback = lambda i: Qt.QMetaObject.invokeMethod(self._tx_tune_sel_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._tx_tune_sel_options.index(i)))
        self._tx_tune_sel_callback(self.tx_tune_sel)
        self._tx_tune_sel_combo_box.currentIndexChanged.connect(
        	lambda i: self.set_tx_tune_sel(self._tx_tune_sel_options[i]))
        self.main_tab_grid_layout_2.addWidget(self._tx_tune_sel_tool_bar, 3, 1, 1, 1)
        for r in range(3, 4):
            self.main_tab_grid_layout_2.setRowStretch(r, 1)
        for c in range(1, 2):
            self.main_tab_grid_layout_2.setColumnStretch(c, 1)
        self._tx_gain_tool_bar = Qt.QToolBar(self)
        self._tx_gain_tool_bar.addWidget(Qt.QLabel('TX Gain'+": "))
        self._tx_gain_line_edit = Qt.QLineEdit(str(self.tx_gain))
        self._tx_gain_tool_bar.addWidget(self._tx_gain_line_edit)
        self._tx_gain_line_edit.returnPressed.connect(
        	lambda: self.set_tx_gain(eng_notation.str_to_num(str(self._tx_gain_line_edit.text().toAscii()))))
        self.main_tab_grid_layout_2.addWidget(self._tx_gain_tool_bar, 2, 3, 1, 1)
        for r in range(2, 3):
            self.main_tab_grid_layout_2.setRowStretch(r, 1)
        for c in range(3, 4):
            self.main_tab_grid_layout_2.setColumnStretch(c, 1)
        self._tx_freq_tool_bar = Qt.QToolBar(self)
        self._tx_freq_tool_bar.addWidget(Qt.QLabel('TX Freq'+": "))
        self._tx_freq_line_edit = Qt.QLineEdit(str(self.tx_freq))
        self._tx_freq_tool_bar.addWidget(self._tx_freq_line_edit)
        self._tx_freq_line_edit.returnPressed.connect(
        	lambda: self.set_tx_freq(eng_notation.str_to_num(str(self._tx_freq_line_edit.text().toAscii()))))
        self.main_tab_grid_layout_2.addWidget(self._tx_freq_tool_bar, 2, 0, 1, 1)
        for r in range(2, 3):
            self.main_tab_grid_layout_2.setRowStretch(r, 1)
        for c in range(0, 1):
            self.main_tab_grid_layout_2.setColumnStretch(c, 1)
        self._trigger_thresh_tool_bar = Qt.QToolBar(self)
        self._trigger_thresh_tool_bar.addWidget(Qt.QLabel('Trigger Thresh'+": "))
        self._trigger_thresh_line_edit = Qt.QLineEdit(str(self.trigger_thresh))
        self._trigger_thresh_tool_bar.addWidget(self._trigger_thresh_line_edit)
        self._trigger_thresh_line_edit.returnPressed.connect(
        	lambda: self.set_trigger_thresh(eng_notation.str_to_num(str(self._trigger_thresh_line_edit.text().toAscii()))))
        self.main_tab_grid_layout_1.addWidget(self._trigger_thresh_tool_bar, 4, 4, 1, 2)
        for r in range(4, 5):
            self.main_tab_grid_layout_1.setRowStretch(r, 1)
        for c in range(4, 6):
            self.main_tab_grid_layout_1.setColumnStretch(c, 1)
        self._rx_gain_tool_bar = Qt.QToolBar(self)
        self._rx_gain_tool_bar.addWidget(Qt.QLabel('RX Gain'+": "))
        self._rx_gain_line_edit = Qt.QLineEdit(str(self.rx_gain))
        self._rx_gain_tool_bar.addWidget(self._rx_gain_line_edit)
        self._rx_gain_line_edit.returnPressed.connect(
        	lambda: self.set_rx_gain(eng_notation.str_to_num(str(self._rx_gain_line_edit.text().toAscii()))))
        self.main_tab_grid_layout_0.addWidget(self._rx_gain_tool_bar, 4, 2, 1, 2)
        for r in range(4, 5):
            self.main_tab_grid_layout_0.setRowStretch(r, 1)
        for c in range(2, 4):
            self.main_tab_grid_layout_0.setColumnStretch(c, 1)
        self._rx_freq_tool_bar = Qt.QToolBar(self)
        self._rx_freq_tool_bar.addWidget(Qt.QLabel('RX Freq'+": "))
        self._rx_freq_line_edit = Qt.QLineEdit(str(self.rx_freq))
        self._rx_freq_tool_bar.addWidget(self._rx_freq_line_edit)
        self._rx_freq_line_edit.returnPressed.connect(
        	lambda: self.set_rx_freq(eng_notation.str_to_num(str(self._rx_freq_line_edit.text().toAscii()))))
        self.main_tab_grid_layout_0.addWidget(self._rx_freq_tool_bar, 4, 0, 1, 2)
        for r in range(4, 5):
            self.main_tab_grid_layout_0.setRowStretch(r, 1)
        for c in range(0, 2):
            self.main_tab_grid_layout_0.setColumnStretch(c, 1)
        self._ceres_offset_tool_bar = Qt.QToolBar(self)
        self._ceres_offset_tool_bar.addWidget(Qt.QLabel('Ceres Offset'+": "))
        self._ceres_offset_line_edit = Qt.QLineEdit(str(self.ceres_offset))
        self._ceres_offset_tool_bar.addWidget(self._ceres_offset_line_edit)
        self._ceres_offset_line_edit.returnPressed.connect(
        	lambda: self.set_ceres_offset(eng_notation.str_to_num(str(self._ceres_offset_line_edit.text().toAscii()))))
        self.main_tab_grid_layout_1.addWidget(self._ceres_offset_tool_bar, 3, 4, 1, 2)
        for r in range(3, 4):
            self.main_tab_grid_layout_1.setRowStretch(r, 1)
        for c in range(4, 6):
            self.main_tab_grid_layout_1.setColumnStretch(c, 1)
        self._bb_gain_tool_bar = Qt.QToolBar(self)
        self._bb_gain_tool_bar.addWidget(Qt.QLabel('BB Gain'+": "))
        self._bb_gain_line_edit = Qt.QLineEdit(str(self.bb_gain))
        self._bb_gain_tool_bar.addWidget(self._bb_gain_line_edit)
        self._bb_gain_line_edit.returnPressed.connect(
        	lambda: self.set_bb_gain(eng_notation.str_to_num(str(self._bb_gain_line_edit.text().toAscii()))))
        self.main_tab_grid_layout_2.addWidget(self._bb_gain_tool_bar, 2, 2, 1, 1)
        for r in range(2, 3):
            self.main_tab_grid_layout_2.setRowStretch(r, 1)
        for c in range(2, 3):
            self.main_tab_grid_layout_2.setColumnStretch(c, 1)
        self.vcc_qt_hex_text_tx_0 = vcc.qt_hex_text()
        self._vcc_qt_hex_text_tx_0_win = self.vcc_qt_hex_text_tx_0;
        self.main_tab_grid_layout_1.addWidget(self._vcc_qt_hex_text_tx_0_win, 5, 0, 2, 6)
        for r in range(5, 7):
            self.main_tab_grid_layout_1.setRowStretch(r, 1)
        for c in range(0, 6):
            self.main_tab_grid_layout_1.setColumnStretch(c, 1)

        self.vcc_qt_hex_text_tx = vcc.qt_hex_text()
        self._vcc_qt_hex_text_tx_win = self.vcc_qt_hex_text_tx;
        self.main_tab_grid_layout_2.addWidget(self._vcc_qt_hex_text_tx_win, 0, 0, 2, 2)
        for r in range(0, 2):
            self.main_tab_grid_layout_2.setRowStretch(r, 1)
        for c in range(0, 2):
            self.main_tab_grid_layout_2.setColumnStretch(c, 1)

        self._uplink_offset_tool_bar = Qt.QToolBar(self)

        if None:
          self._uplink_offset_formatter = None
        else:
          self._uplink_offset_formatter = lambda x: eng_notation.num_to_str(x)

        self._uplink_offset_tool_bar.addWidget(Qt.QLabel("uplink_offset"+": "))
        self._uplink_offset_label = Qt.QLabel(str(self._uplink_offset_formatter(self.uplink_offset)))
        self._uplink_offset_tool_bar.addWidget(self._uplink_offset_label)
        self.main_tab_grid_layout_2.addWidget(self._uplink_offset_tool_bar, 2, 1, 1, 1)
        for r in range(2, 3):
            self.main_tab_grid_layout_2.setRowStretch(r, 1)
        for c in range(1, 2):
            self.main_tab_grid_layout_2.setColumnStretch(c, 1)
        self.uhd_usrp_source_1 = uhd.usrp_source(
        	",".join(("", "")),
        	uhd.stream_args(
        		cpu_format="fc32",
        		channels=range(1),
        	),
        )
        self.uhd_usrp_source_1.set_clock_source('external', 0)
        self.uhd_usrp_source_1.set_time_source('external', 0)
        self.uhd_usrp_source_1.set_samp_rate(samp_rate)
        self.uhd_usrp_source_1.set_time_now(uhd.time_spec(time.time()), uhd.ALL_MBOARDS)
        self.uhd_usrp_source_1.set_center_freq(uhd.tune_request(rx_freq, rx_offset), 0)
        self.uhd_usrp_source_1.set_gain(rx_gain, 0)
        self.uhd_usrp_source_1.set_antenna('RX2', 0)
        self.uhd_usrp_source_1.set_auto_dc_offset(True, 0)
        self.uhd_usrp_source_1.set_auto_iq_balance(True, 0)
        self.uhd_usrp_sink_0 = uhd.usrp_sink(
        	",".join(("addr=192.168.10.6", "")),
        	uhd.stream_args(
        		cpu_format="fc32",
        		channels=range(1),
        	),
        )
        self.uhd_usrp_sink_0.set_clock_source('external', 0)
        self.uhd_usrp_sink_0.set_time_source('external', 0)
        self.uhd_usrp_sink_0.set_samp_rate(samp_rate)
        self.uhd_usrp_sink_0.set_time_now(uhd.time_spec(time.time()), uhd.ALL_MBOARDS)
        self.uhd_usrp_sink_0.set_center_freq(uhd.tune_request(tx_freq, tx_offset), 0)
        self.uhd_usrp_sink_0.set_gain(tx_gain, 0)
        self.uhd_usrp_sink_0.set_antenna('TX/RX', 0)
        self.sigmf_sink_0 = gr_sigmf.sink("cf32", fp, gr_sigmf.sigmf_time_mode_absolute, False)
        self.sigmf_sink_0.set_global_meta("core:sample_rate", samp_rate)
        self.sigmf_sink_0.set_global_meta("core:description", 'VCC TM/TC v1.0.0, GMSK9600, AX.25, w/ PTT')
        self.sigmf_sink_0.set_global_meta("core:author", 'Zach Leffke')
        self.sigmf_sink_0.set_global_meta("core:license", 'MIT')
        self.sigmf_sink_0.set_global_meta("core:hw", '2X M2 400CP30, ARR Preamp, N210 w/ UBX')

        self.rffe_ctl_tag_ptt_pdu_0 = rffe_ctl.tag_ptt_pdu(samp_rate,"tx_sob","tx_eob","tx_time","TX")
        self.rational_resampler_xxx_4 = filter.rational_resampler_ccc(
                interpolation=interp/2,
                decimation=decim,
                taps=None,
                fractional_bw=None,
        )
        self.rational_resampler_xxx_3 = filter.rational_resampler_ccc(
                interpolation=1,
                decimation=2,
                taps=None,
                fractional_bw=None,
        )
        self.rational_resampler_xxx_2 = filter.rational_resampler_ccc(
                interpolation=1,
                decimation=2,
                taps=None,
                fractional_bw=None,
        )
        self.rational_resampler_xxx_1_0 = filter.rational_resampler_ccc(
                interpolation=interp_2,
                decimation=decim_2,
                taps=None,
                fractional_bw=None,
        )
        self.rational_resampler_xxx_1 = filter.rational_resampler_ccc(
                interpolation=interp,
                decimation=decim,
                taps=None,
                fractional_bw=None,
        )
        self.qtgui_waterfall_sink_x_0_0 = qtgui.waterfall_sink_c(
        	2048, #size
        	firdes.WIN_BLACKMAN_hARRIS, #wintype
        	0, #fc
        	samp_rate / decim*interp / decim_2 * interp_2, #bw
        	"", #name
                1 #number of inputs
        )
        self.qtgui_waterfall_sink_x_0_0.set_update_time(0.0010)
        self.qtgui_waterfall_sink_x_0_0.enable_grid(True)
        self.qtgui_waterfall_sink_x_0_0.enable_axis_labels(True)

        if not True:
          self.qtgui_waterfall_sink_x_0_0.disable_legend()

        if "complex" == "float" or "complex" == "msg_float":
          self.qtgui_waterfall_sink_x_0_0.set_plot_pos_half(not True)

        labels = ['', '', '', '', '',
                  '', '', '', '', '']
        colors = [0, 0, 0, 0, 0,
                  0, 0, 0, 0, 0]
        alphas = [1.0, 1.0, 1.0, 1.0, 1.0,
                  1.0, 1.0, 1.0, 1.0, 1.0]
        for i in xrange(1):
            if len(labels[i]) == 0:
                self.qtgui_waterfall_sink_x_0_0.set_line_label(i, "Data {0}".format(i))
            else:
                self.qtgui_waterfall_sink_x_0_0.set_line_label(i, labels[i])
            self.qtgui_waterfall_sink_x_0_0.set_color_map(i, colors[i])
            self.qtgui_waterfall_sink_x_0_0.set_line_alpha(i, alphas[i])

        self.qtgui_waterfall_sink_x_0_0.set_intensity_range(-50, 50)

        self._qtgui_waterfall_sink_x_0_0_win = sip.wrapinstance(self.qtgui_waterfall_sink_x_0_0.pyqwidget(), Qt.QWidget)
        self.main_tab_grid_layout_1.addWidget(self._qtgui_waterfall_sink_x_0_0_win, 2, 0, 2, 4)
        for r in range(2, 4):
            self.main_tab_grid_layout_1.setRowStretch(r, 1)
        for c in range(0, 4):
            self.main_tab_grid_layout_1.setColumnStretch(c, 1)
        self.qtgui_waterfall_sink_x_0 = qtgui.waterfall_sink_c(
        	2048, #size
        	firdes.WIN_BLACKMAN_hARRIS, #wintype
        	rx_freq, #fc
        	samp_rate, #bw
        	"", #name
                1 #number of inputs
        )
        self.qtgui_waterfall_sink_x_0.set_update_time(0.010)
        self.qtgui_waterfall_sink_x_0.enable_grid(True)
        self.qtgui_waterfall_sink_x_0.enable_axis_labels(True)

        if not True:
          self.qtgui_waterfall_sink_x_0.disable_legend()

        if "complex" == "float" or "complex" == "msg_float":
          self.qtgui_waterfall_sink_x_0.set_plot_pos_half(not True)

        labels = ['', '', '', '', '',
                  '', '', '', '', '']
        colors = [0, 0, 0, 0, 0,
                  0, 0, 0, 0, 0]
        alphas = [1.0, 1.0, 1.0, 1.0, 1.0,
                  1.0, 1.0, 1.0, 1.0, 1.0]
        for i in xrange(1):
            if len(labels[i]) == 0:
                self.qtgui_waterfall_sink_x_0.set_line_label(i, "Data {0}".format(i))
            else:
                self.qtgui_waterfall_sink_x_0.set_line_label(i, labels[i])
            self.qtgui_waterfall_sink_x_0.set_color_map(i, colors[i])
            self.qtgui_waterfall_sink_x_0.set_line_alpha(i, alphas[i])

        self.qtgui_waterfall_sink_x_0.set_intensity_range(-140, 10)

        self._qtgui_waterfall_sink_x_0_win = sip.wrapinstance(self.qtgui_waterfall_sink_x_0.pyqwidget(), Qt.QWidget)
        self.main_tab_grid_layout_0.addWidget(self._qtgui_waterfall_sink_x_0_win, 1, 0, 1, 8)
        for r in range(1, 2):
            self.main_tab_grid_layout_0.setRowStretch(r, 1)
        for c in range(0, 8):
            self.main_tab_grid_layout_0.setColumnStretch(c, 1)
        self.qtgui_freq_sink_x_1_0_1 = qtgui.freq_sink_c(
        	2048, #size
        	firdes.WIN_BLACKMAN_hARRIS, #wintype
        	rx_freq, #fc
        	samp_rate, #bw
        	"VCC RX Spectrum", #name
        	1 #number of inputs
        )
        self.qtgui_freq_sink_x_1_0_1.set_update_time(0.0010)
        self.qtgui_freq_sink_x_1_0_1.set_y_axis(-150, -40)
        self.qtgui_freq_sink_x_1_0_1.set_y_label('Relative Gain', 'dB')
        self.qtgui_freq_sink_x_1_0_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "")
        self.qtgui_freq_sink_x_1_0_1.enable_autoscale(False)
        self.qtgui_freq_sink_x_1_0_1.enable_grid(True)
        self.qtgui_freq_sink_x_1_0_1.set_fft_average(0.2)
        self.qtgui_freq_sink_x_1_0_1.enable_axis_labels(True)
        self.qtgui_freq_sink_x_1_0_1.enable_control_panel(False)

        if not False:
          self.qtgui_freq_sink_x_1_0_1.disable_legend()

        if "complex" == "float" or "complex" == "msg_float":
          self.qtgui_freq_sink_x_1_0_1.set_plot_pos_half(not True)

        labels = ['pre-d', 'agc_filt', '', '', '',
                  '', '', '', '', '']
        widths = [1, 1, 1, 1, 1,
                  1, 1, 1, 1, 1]
        colors = ["blue", "red", "green", "black", "cyan",
                  "magenta", "yellow", "dark red", "dark green", "dark blue"]
        alphas = [1.0, 1.0, 1.0, 1.0, 1.0,
                  1.0, 1.0, 1.0, 1.0, 1.0]
        for i in xrange(1):
            if len(labels[i]) == 0:
                self.qtgui_freq_sink_x_1_0_1.set_line_label(i, "Data {0}".format(i))
            else:
                self.qtgui_freq_sink_x_1_0_1.set_line_label(i, labels[i])
            self.qtgui_freq_sink_x_1_0_1.set_line_width(i, widths[i])
            self.qtgui_freq_sink_x_1_0_1.set_line_color(i, colors[i])
            self.qtgui_freq_sink_x_1_0_1.set_line_alpha(i, alphas[i])

        self._qtgui_freq_sink_x_1_0_1_win = sip.wrapinstance(self.qtgui_freq_sink_x_1_0_1.pyqwidget(), Qt.QWidget)
        self.main_tab_grid_layout_0.addWidget(self._qtgui_freq_sink_x_1_0_1_win, 0, 0, 1, 8)
        for r in range(0, 1):
            self.main_tab_grid_layout_0.setRowStretch(r, 1)
        for c in range(0, 8):
            self.main_tab_grid_layout_0.setColumnStretch(c, 1)
        self.qtgui_freq_sink_x_1_0_0 = qtgui.freq_sink_c(
        	2048, #size
        	firdes.WIN_BLACKMAN_hARRIS, #wintype
        	0, #fc
        	samp_rate/decim*interp/2, #bw
        	"TX Spectrum", #name
        	1 #number of inputs
        )
        self.qtgui_freq_sink_x_1_0_0.set_update_time(0.010)
        self.qtgui_freq_sink_x_1_0_0.set_y_axis(-150, 0)
        self.qtgui_freq_sink_x_1_0_0.set_y_label('Relative Gain', 'dB')
        self.qtgui_freq_sink_x_1_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "")
        self.qtgui_freq_sink_x_1_0_0.enable_autoscale(False)
        self.qtgui_freq_sink_x_1_0_0.enable_grid(True)
        self.qtgui_freq_sink_x_1_0_0.set_fft_average(1.0)
        self.qtgui_freq_sink_x_1_0_0.enable_axis_labels(True)
        self.qtgui_freq_sink_x_1_0_0.enable_control_panel(False)

        if not False:
          self.qtgui_freq_sink_x_1_0_0.disable_legend()

        if "complex" == "float" or "complex" == "msg_float":
          self.qtgui_freq_sink_x_1_0_0.set_plot_pos_half(not True)

        labels = ['', '', '', '', '',
                  '', '', '', '', '']
        widths = [1, 1, 1, 1, 1,
                  1, 1, 1, 1, 1]
        colors = ["blue", "red", "green", "black", "cyan",
                  "magenta", "yellow", "dark red", "dark green", "dark blue"]
        alphas = [1.0, 1.0, 1.0, 1.0, 1.0,
                  1.0, 1.0, 1.0, 1.0, 1.0]
        for i in xrange(1):
            if len(labels[i]) == 0:
                self.qtgui_freq_sink_x_1_0_0.set_line_label(i, "Data {0}".format(i))
            else:
                self.qtgui_freq_sink_x_1_0_0.set_line_label(i, labels[i])
            self.qtgui_freq_sink_x_1_0_0.set_line_width(i, widths[i])
            self.qtgui_freq_sink_x_1_0_0.set_line_color(i, colors[i])
            self.qtgui_freq_sink_x_1_0_0.set_line_alpha(i, alphas[i])

        self._qtgui_freq_sink_x_1_0_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_1_0_0.pyqwidget(), Qt.QWidget)
        self.main_tab_grid_layout_2.addWidget(self._qtgui_freq_sink_x_1_0_0_win, 0, 2, 2, 2)
        for r in range(0, 2):
            self.main_tab_grid_layout_2.setRowStretch(r, 1)
        for c in range(2, 4):
            self.main_tab_grid_layout_2.setColumnStretch(c, 1)
        self.qtgui_freq_sink_x_1_0 = qtgui.freq_sink_c(
        	2048, #size
        	firdes.WIN_BLACKMAN_hARRIS, #wintype
        	0, #fc
        	samp_rate / decim*interp / decim_2 * interp_2, #bw
        	"Ceres Spectrum", #name
        	1 #number of inputs
        )
        self.qtgui_freq_sink_x_1_0.set_update_time(0.0010)
        self.qtgui_freq_sink_x_1_0.set_y_axis(-50, 50)
        self.qtgui_freq_sink_x_1_0.set_y_label('Relative Gain', 'dB')
        self.qtgui_freq_sink_x_1_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "")
        self.qtgui_freq_sink_x_1_0.enable_autoscale(False)
        self.qtgui_freq_sink_x_1_0.enable_grid(True)
        self.qtgui_freq_sink_x_1_0.set_fft_average(1.0)
        self.qtgui_freq_sink_x_1_0.enable_axis_labels(True)
        self.qtgui_freq_sink_x_1_0.enable_control_panel(False)

        if not False:
          self.qtgui_freq_sink_x_1_0.disable_legend()

        if "complex" == "float" or "complex" == "msg_float":
          self.qtgui_freq_sink_x_1_0.set_plot_pos_half(not True)

        labels = ['pre-d', 'agc_filt', '', '', '',
                  '', '', '', '', '']
        widths = [1, 1, 1, 1, 1,
                  1, 1, 1, 1, 1]
        colors = ["blue", "red", "green", "black", "cyan",
                  "magenta", "yellow", "dark red", "dark green", "dark blue"]
        alphas = [1.0, 1.0, 1.0, 1.0, 1.0,
                  1.0, 1.0, 1.0, 1.0, 1.0]
        for i in xrange(1):
            if len(labels[i]) == 0:
                self.qtgui_freq_sink_x_1_0.set_line_label(i, "Data {0}".format(i))
            else:
                self.qtgui_freq_sink_x_1_0.set_line_label(i, labels[i])
            self.qtgui_freq_sink_x_1_0.set_line_width(i, widths[i])
            self.qtgui_freq_sink_x_1_0.set_line_color(i, colors[i])
            self.qtgui_freq_sink_x_1_0.set_line_alpha(i, alphas[i])

        self._qtgui_freq_sink_x_1_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_1_0.pyqwidget(), Qt.QWidget)
        self.main_tab_grid_layout_1.addWidget(self._qtgui_freq_sink_x_1_0_win, 0, 0, 2, 4)
        for r in range(0, 2):
            self.main_tab_grid_layout_1.setRowStretch(r, 1)
        for c in range(0, 4):
            self.main_tab_grid_layout_1.setColumnStretch(c, 1)
        self.qtgui_freq_sink_x_1 = qtgui.freq_sink_c(
        	2048, #size
        	firdes.WIN_BLACKMAN_hARRIS, #wintype
        	0, #fc
        	samp_rate*interp/decim*interp_2/decim_2, #bw
        	"Burst RX Spectrum", #name
        	2 #number of inputs
        )
        self.qtgui_freq_sink_x_1.set_update_time(0.10)
        self.qtgui_freq_sink_x_1.set_y_axis(-140, 10)
        self.qtgui_freq_sink_x_1.set_y_label('Relative Gain', 'dB')
        self.qtgui_freq_sink_x_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "")
        self.qtgui_freq_sink_x_1.enable_autoscale(True)
        self.qtgui_freq_sink_x_1.enable_grid(True)
        self.qtgui_freq_sink_x_1.set_fft_average(1.0)
        self.qtgui_freq_sink_x_1.enable_axis_labels(True)
        self.qtgui_freq_sink_x_1.enable_control_panel(False)

        if not True:
          self.qtgui_freq_sink_x_1.disable_legend()

        if "complex" == "float" or "complex" == "msg_float":
          self.qtgui_freq_sink_x_1.set_plot_pos_half(not True)

        labels = ['orig', 'corr', '', '', '',
                  '', '', '', '', '']
        widths = [1, 1, 1, 1, 1,
                  1, 1, 1, 1, 1]
        colors = ["blue", "red", "green", "black", "cyan",
                  "magenta", "yellow", "dark red", "dark green", "dark blue"]
        alphas = [1.0, 1.0, 1.0, 1.0, 1.0,
                  1.0, 1.0, 1.0, 1.0, 1.0]
        for i in xrange(2):
            if len(labels[i]) == 0:
                self.qtgui_freq_sink_x_1.set_line_label(i, "Data {0}".format(i))
            else:
                self.qtgui_freq_sink_x_1.set_line_label(i, labels[i])
            self.qtgui_freq_sink_x_1.set_line_width(i, widths[i])
            self.qtgui_freq_sink_x_1.set_line_color(i, colors[i])
            self.qtgui_freq_sink_x_1.set_line_alpha(i, alphas[i])

        self._qtgui_freq_sink_x_1_win = sip.wrapinstance(self.qtgui_freq_sink_x_1.pyqwidget(), Qt.QWidget)
        self.main_tab_grid_layout_1.addWidget(self._qtgui_freq_sink_x_1_win, 0, 4, 2, 4)
        for r in range(0, 2):
            self.main_tab_grid_layout_1.setRowStretch(r, 1)
        for c in range(4, 8):
            self.main_tab_grid_layout_1.setColumnStretch(c, 1)
        self.pyqt_text_output_0 = pyqt.text_output()
        self._pyqt_text_output_0_win = self.pyqt_text_output_0;
        self.main_tab_grid_layout_2.addWidget(self._pyqt_text_output_0_win, 4, 0, 1, 4)
        for r in range(4, 5):
            self.main_tab_grid_layout_2.setRowStretch(r, 1)
        for c in range(0, 4):
            self.main_tab_grid_layout_2.setColumnStretch(c, 1)

        self.pyqt_meta_text_output_0 = pyqt.meta_text_output()
        self._pyqt_meta_text_output_0_win = self.pyqt_meta_text_output_0;
        self.main_tab_grid_layout_1.addWidget(self._pyqt_meta_text_output_0_win, 3, 6, 4, 2)
        for r in range(3, 7):
            self.main_tab_grid_layout_1.setRowStretch(r, 1)
        for c in range(6, 8):
            self.main_tab_grid_layout_1.setColumnStretch(c, 1)

        self.pyqt_ctime_plot_0 = pyqt.ctime_plot('')
        self._pyqt_ctime_plot_0_win = self.pyqt_ctime_plot_0;
        self.main_tab_grid_layout_1.addWidget(self._pyqt_ctime_plot_0_win, 2, 4, 1, 4)
        for r in range(2, 3):
            self.main_tab_grid_layout_1.setRowStretch(r, 1)
        for c in range(4, 8):
            self.main_tab_grid_layout_1.setColumnStretch(c, 1)

        self._man_tune_tool_bar = Qt.QToolBar(self)
        self._man_tune_tool_bar.addWidget(Qt.QLabel('TX Freq Offset'+": "))
        self._man_tune_line_edit = Qt.QLineEdit(str(self.man_tune))
        self._man_tune_tool_bar.addWidget(self._man_tune_line_edit)
        self._man_tune_line_edit.returnPressed.connect(
        	lambda: self.set_man_tune(eng_notation.str_to_num(str(self._man_tune_line_edit.text().toAscii()))))
        self.main_tab_grid_layout_2.addWidget(self._man_tune_tool_bar, 3, 0, 1, 1)
        for r in range(3, 4):
            self.main_tab_grid_layout_2.setRowStretch(r, 1)
        for c in range(0, 1):
            self.main_tab_grid_layout_2.setColumnStretch(c, 1)
        self.low_pass_filter_0 = filter.fir_filter_ccf(1, firdes.low_pass(
        	1, samp_rate / decim *interp, chan_filt_cutoff, chan_filt_trans, firdes.WIN_HAMMING, 6.76))
        self.gpredict_doppler_0 = gpredict.doppler("0.0.0.0", 7356, True)
        self.gpredict_MsgPairToVar_1 = gpredict.MsgPairToVar(self.set_uplink_freq)
        self.gmsk_tx_burst_hier2_0 = gmsk_tx_burst_hier2(
            bb_gain=bb_gain,
            bt=.5,
            delay_enable=1,
            pad_front=0,
            pad_tail=0,
            ptt_delay=.25,
            samp_rate=samp_rate,
        )
        self.gmsk_ax25_rx_hier_0 = gmsk_ax25_rx_hier(
            lpf_cutoff=7.2e3,
            lpf_trans=1e3,
            quad_demod_gain=(samp_rate/decim*interp/decim_2*interp_2)/(2*math.pi*fsk_dev/8.0),
            samp_rate=48000,
            samps_per_symb=5,
        )
        self.fsk_burst_detector_0 = fsk_burst_detector(
            avg_len=100.0,
            cons_offset=3,
            decim=decim,
            fsk_dev=fsk_dev,
            interp=interp,
            samp_rate=samp_rate,
        )
        self.burst_rx_es_hier_0 = burst_rx_es_hier(
            avg_len=100,
            baud=9600,
            samp_rate=samp_rate/decim*interp,
            samps_per_symb=10,
            trigger_thresh=trigger_thresh,
        )
        self.blocks_socket_pdu_0_2 = blocks.socket_pdu("TCP_SERVER", '10.42.0.21', '8000', 1024, False)
        self.blocks_socket_pdu_0 = blocks.socket_pdu("TCP_SERVER", '0.0.0.0', '8001', 1024, True)
        self.blocks_multiply_xx_0_0 = blocks.multiply_vcc(1)
        self.blocks_multiply_xx_0 = blocks.multiply_vcc(1)
        self.analog_sig_source_x_0_0 = analog.sig_source_c(samp_rate, analog.GR_COS_WAVE, -1 * ceres_offset, 1, 0)
        self.analog_sig_source_x_0 = analog.sig_source_c(samp_rate, analog.GR_COS_WAVE, -1 * tx_sel[tx_tune_sel], 1, 0)
        self.analog_agc2_xx_0 = analog.agc2_cc(10, 1e-1, 65536, 1)
        self.analog_agc2_xx_0.set_max_gain(65536)



        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.blocks_socket_pdu_0, 'pdus'), (self.pyqt_text_output_0, 'pdus'))
        self.msg_connect((self.blocks_socket_pdu_0_2, 'pdus'), (self.gmsk_tx_burst_hier2_0, 'kiss/ax25'))
        self.msg_connect((self.burst_rx_es_hier_0, 'brst_corr'), (self.pyqt_ctime_plot_0, 'cpdus'))
        self.msg_connect((self.burst_rx_es_hier_0, 'meta'), (self.pyqt_meta_text_output_0, 'pdus'))
        self.msg_connect((self.gmsk_ax25_rx_hier_0, 'kiss'), (self.blocks_socket_pdu_0_2, 'pdus'))
        self.msg_connect((self.gmsk_ax25_rx_hier_0, 'kiss'), (self.vcc_qt_hex_text_tx_0, 'pdus'))
        self.msg_connect((self.gmsk_tx_burst_hier2_0, 'ax25'), (self.vcc_qt_hex_text_tx, 'pdus'))
        self.msg_connect((self.gpredict_doppler_0, 'freq'), (self.gpredict_MsgPairToVar_1, 'inpair'))
        self.msg_connect((self.rffe_ctl_tag_ptt_pdu_0, 'ptt'), (self.blocks_socket_pdu_0, 'pdus'))
        self.connect((self.analog_agc2_xx_0, 0), (self.low_pass_filter_0, 0))
        self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_xx_0, 1))
        self.connect((self.analog_sig_source_x_0_0, 0), (self.blocks_multiply_xx_0_0, 1))
        self.connect((self.blocks_multiply_xx_0, 0), (self.rational_resampler_xxx_4, 0))
        self.connect((self.blocks_multiply_xx_0, 0), (self.uhd_usrp_sink_0, 0))
        self.connect((self.blocks_multiply_xx_0_0, 0), (self.rational_resampler_xxx_1, 0))
        self.connect((self.burst_rx_es_hier_0, 0), (self.rational_resampler_xxx_2, 0))
        self.connect((self.burst_rx_es_hier_0, 1), (self.rational_resampler_xxx_3, 0))
        self.connect((self.fsk_burst_detector_0, 0), (self.burst_rx_es_hier_0, 1))
        self.connect((self.gmsk_ax25_rx_hier_0, 0), (self.qtgui_freq_sink_x_1, 1))
        self.connect((self.gmsk_tx_burst_hier2_0, 0), (self.blocks_multiply_xx_0, 0))
        self.connect((self.gmsk_tx_burst_hier2_0, 0), (self.rffe_ctl_tag_ptt_pdu_0, 0))
        self.connect((self.low_pass_filter_0, 0), (self.burst_rx_es_hier_0, 0))
        self.connect((self.low_pass_filter_0, 0), (self.fsk_burst_detector_0, 0))
        self.connect((self.low_pass_filter_0, 0), (self.rational_resampler_xxx_1_0, 0))
        self.connect((self.rational_resampler_xxx_1, 0), (self.analog_agc2_xx_0, 0))
        self.connect((self.rational_resampler_xxx_1_0, 0), (self.qtgui_freq_sink_x_1_0, 0))
        self.connect((self.rational_resampler_xxx_1_0, 0), (self.qtgui_waterfall_sink_x_0_0, 0))
        self.connect((self.rational_resampler_xxx_2, 0), (self.qtgui_freq_sink_x_1, 0))
        self.connect((self.rational_resampler_xxx_3, 0), (self.gmsk_ax25_rx_hier_0, 0))
        self.connect((self.rational_resampler_xxx_4, 0), (self.qtgui_freq_sink_x_1_0_0, 0))
        self.connect((self.uhd_usrp_source_1, 0), (self.blocks_multiply_xx_0_0, 0))
        self.connect((self.uhd_usrp_source_1, 0), (self.qtgui_freq_sink_x_1_0_1, 0))
        self.connect((self.uhd_usrp_source_1, 0), (self.qtgui_waterfall_sink_x_0, 0))
        self.connect((self.uhd_usrp_source_1, 0), (self.sigmf_sink_0, 0))
예제 #38
0
 def set_keep_n(self, keep_n):
     self.keep_n = keep_n
     Qt.QMetaObject.invokeMethod(self._keep_n_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.keep_n)))
예제 #39
0
 def set_fft_max(self, fft_max):
     self.fft_max = fft_max
     Qt.QMetaObject.invokeMethod(self._fft_max_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.fft_max)))
     self.qtgui_waterfall_sink_x_0.set_intensity_range(self.fft_min, self.fft_max)
     self.qtgui_freq_sink_x_0.set_y_axis(self.fft_min, self.fft_max)
예제 #40
0
 def set_rx_freq(self, rx_freq):
     self.rx_freq = rx_freq
     Qt.QMetaObject.invokeMethod(self._rx_freq_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.rx_freq)))
예제 #41
0
 def set_throttle_factor(self, throttle_factor):
     self.throttle_factor = throttle_factor
     Qt.QMetaObject.invokeMethod(self._throttle_factor_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.throttle_factor)))
     self.blocks_throttle_0.set_sample_rate(self.samp_rate*self.throttle_factor)
예제 #42
0
 def set_Bandwidth(self, Bandwidth):
     self.Bandwidth = Bandwidth
     Qt.QMetaObject.invokeMethod(self._Bandwidth_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.Bandwidth)))
     self.rtlsdr_source_0.set_sample_rate(self.Bandwidth)
     self.rtlsdr_source_0.set_bandwidth(self.Bandwidth, 0)
     self.radio_astro_ra_event_sink_0.set_sample_rate( self.Bandwidth*1.E-6)
     self.radio_astro_ra_event_log_0.set_sample_rate( self.Bandwidth*1.e-6)
     self.radio_astro_detect_0.set_bw( self.Bandwidth)
     self.qtgui_time_sink_x_0_0.set_samp_rate(self.Bandwidth)
     self._Bandwidths_config = ConfigParser.ConfigParser()
     self._Bandwidths_config.read(self.ConfigFile)
     if not self._Bandwidths_config.has_section('main'):
     	self._Bandwidths_config.add_section('main')
     self._Bandwidths_config.set('main', 'bandwidth', str(self.Bandwidth))
     self._Bandwidths_config.write(open(self.ConfigFile, 'w'))
예제 #43
0
		frame_time = pss_peak_time - (160+144*6+2048*7)
		if frame_time < 0:
			frame_time += 30720*5
		debug_string = "Searching for SSS: N_id_2 {}, frame time {:5.0f}, corr peak {:7.0f}"
		logging.debug(debug_string.format(N_id_2, frame_time, pss_peak))
		
		return self.sss_corr.correlate(self.buffer, frame_time, N_id_2) 


if __name__ == '__main__':
	parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
	parser.add_option("", "--decim", dest="decim", type="intx", default=16,
		help="Set decim [default=%default]")
	parser.add_option("", "--avg-frames", dest="avg_frames", type="intx", default=-1,
		help="Set avg_frames [default=%default]")
	parser.add_option("", "--freq-corr", dest="freq_corr", type="eng_float", default=eng_notation.num_to_str(0),
		help="Set freq_corr [default=%default]")
	parser.add_option("", "--file-name", dest="file_name", type="string", default=None,
		help="Set file_name [default=%default]")
	parser.add_option("", "--file-decim", dest="file_decim", type="intx", default=1,
		help="Set decim of given file [default=%default]")
	parser.add_option("", "--sstart", dest="sstart", type="eng_float", default=1,
		help="Sample to start with [default=%default]")
	parser.add_option("", "--dump", dest="dump", type="string", default=None,
		help="dump intermediate results [default=%default]")
	(options, args) = parser.parse_args()
	#logging.basicConfig(format='%(asctime)s %(message)s', level=logging.DEBUG)
	logging.basicConfig(format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', level=logging.DEBUG)
	logging.getLogger('symbol_source').setLevel(logging.WARN)
	logging.getLogger('gen_sss_fd').setLevel(logging.WARN)
	logging.getLogger('sss_corr2').setLevel(logging.WARN)
 def set_tx_freq(self, tx_freq):
     self.tx_freq = tx_freq
     Qt.QMetaObject.invokeMethod(self._tx_freq_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.tx_freq)))
     self.set_uplink_freq(self.tx_freq)
     self.uhd_usrp_sink_0.set_center_freq(uhd.tune_request(self.tx_freq, self.tx_offset), 0)
     self.set_tx_tune(self.tx_freq - self.uplink_freq)
예제 #45
0
 def set_Gain1(self, Gain1):
     self.Gain1 = Gain1
     Qt.QMetaObject.invokeMethod(self._Gain1_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.Gain1)))
     self.rtlsdr_source_0.set_gain(float(self.Gain1), 0)
     self.radio_astro_ra_event_sink_0.set_gain1( float(self.Gain1))
     self._Gain1s_config = ConfigParser.ConfigParser()
     self._Gain1s_config.read(self.ConfigFile)
     if not self._Gain1s_config.has_section('main'):
     	self._Gain1s_config.add_section('main')
     self._Gain1s_config.set('main', 'gain1', str(self.Gain1))
     self._Gain1s_config.write(open(self.ConfigFile, 'w'))
 def set_man_tune(self, man_tune):
     self.man_tune = man_tune
     self.set_tx_sel([self.tx_tune, -1*self.man_tune])
     Qt.QMetaObject.invokeMethod(self._man_tune_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.man_tune)))
예제 #47
0
 def set_Gain2(self, Gain2):
     self.Gain2 = Gain2
     Qt.QMetaObject.invokeMethod(self._Gain2_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.Gain2)))
     self.rtlsdr_source_0.set_if_gain(float(self.Gain2), 0)
     self._Gain2s_config = ConfigParser.ConfigParser()
     self._Gain2s_config.read(self.ConfigFile)
     if not self._Gain2s_config.has_section('main'):
     	self._Gain2s_config.add_section('main')
     self._Gain2s_config.set('main', 'gain2', str(self.Gain2))
     self._Gain2s_config.write(open(self.ConfigFile, 'w'))
 def set_tx_gain(self, tx_gain):
     self.tx_gain = tx_gain
     Qt.QMetaObject.invokeMethod(self._tx_gain_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.tx_gain)))
     self.uhd_usrp_sink_0.set_gain(self.tx_gain, 0)
예제 #49
0
 def set_Bandwidth(self, Bandwidth):
     self.Bandwidth = Bandwidth
     Qt.QMetaObject.invokeMethod(self._Bandwidth_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.Bandwidth)))
     self.rtlsdr_source_0.set_sample_rate(self.Bandwidth)
     self.rtlsdr_source_0.set_bandwidth(self.Bandwidth, 0)
     self.radio_astro_detect_0.set_bw( self.Bandwidth*1.e-6)
     self.ra_event_sink_0.set_sample_rate( self.Bandwidth*1.E-6)
     self.ra_event_log_0.set_sample_rate( self.Bandwidth*1.E-6)
     self.qtgui_time_sink_x_0_0.set_samp_rate(self.Bandwidth)
 def set_trigger_thresh(self, trigger_thresh):
     self.trigger_thresh = trigger_thresh
     Qt.QMetaObject.invokeMethod(self._trigger_thresh_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.trigger_thresh)))
     self.burst_rx_es_hier_0.set_trigger_thresh(self.trigger_thresh)
예제 #51
0
 def set_Frequency(self, Frequency):
     self.Frequency = Frequency
     Qt.QMetaObject.invokeMethod(self._Frequency_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.Frequency)))
     self.rtlsdr_source_0.set_center_freq(self.Frequency, 0)
     self.radio_astro_detect_0.set_f_obs( self.Frequency*1.E-6)
 def set_rx_gain(self, rx_gain):
     self.rx_gain = rx_gain
     Qt.QMetaObject.invokeMethod(self._rx_gain_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.rx_gain)))
     self.uhd_usrp_source_1.set_gain(self.rx_gain, 0)
예제 #53
0
    def __init__(self, parent, ID, title):
        wxFrame.__init__(self, parent, ID, title,
                wxDefaultPosition)

        self.pga = 0
        self.pgaMin = -20
        self.pgaMax = 0
        self.pgaStep = 0.25

# Parsing options
        parser = OptionParser(option_class=eng_option,
                usage="usage: %prog [options] filename1" \
                " [-f frequency2 filename2 [...]]")
        parser.add_option("-a", "--agc", action="store_true",
                help="enable agc")
        parser.add_option("-c", "--clockrate", type="eng_float", default=128e6,
                help="set USRP clock rate (128e6)")
        parser.add_option("--copy", action="store_true",
                help="enable real to imag data copy when in real mode")
        parser.add_option("-e", "--encoding", type="choice", choices=["s", "f"],
                default="f", help="choose data encoding: [s]igned or [f]loat.")
        parser.add_option("-f", "--frequency", type="eng_float",
                action="callback", callback=appendFrequency,
                help="set output frequency (222.064e6)")
        parser.add_option("-g", "--gain", type="float",
                help="set output pga gain")
        parser.add_option("-l", "--list", action="callback", callback=listUsrp,
                help="list USRPs and daugtherboards")
        parser.add_option("-m", "--mode", type="eng_float", default=2,
                help="mode: 1: real, 2: complex (2)")
        parser.add_option("-o", "--osc", action="store_true",
                help="enable oscilloscope")
        parser.add_option("-r", "--samplingrate", type="eng_float",
                default=3.2e6,
                help="set input sampling rate (3200000)")
        parser.add_option("-s", "--spectrum", action="store_true",
                help="enable spectrum analyzer")
#        parser.add_option("-t", "--tx", type="choice", choices=["A", "B"],
#                default="A", help="choose USRP tx A|B output (A)")
        parser.add_option("-u", "--usrp", action="store_true",
                help="enable USRP output")

        (options, args) = parser.parse_args()
        if len(args) == 0 :
            options.filename = [ "/dev/stdin" ]
        else :
            options.filename = args
# Setting default frequency
        if options.frequency is None :
            options.frequency = [ 222.064e6 ]
        if len(options.filename) != len(options.frequency) :
            parser.error("Nb input file != nb frequency!")

# Status bar
#        self.CreateStatusBar(3, 0)
#        msg = "PGA: %.2f dB" % (self.pga * self.pgaStep)
#        self.SetStatusText(msg, 1)
#        msg = "Freq: %.3f mHz" % (options.frequency[0] / 1000000.0)
#        self.SetStatusText(msg, 2)

# Menu bar
        menu = wxMenu()
        menu.Append(ID_ABOUT, "&About",
                "More information about this program")
        menu.AppendSeparator()
        menu.Append(ID_EXIT, "E&xit", "Terminate the program")
        menuBar = wxMenuBar()
        menuBar.Append(menu, "&File")
        self.SetMenuBar(menuBar)
        

# Main windows
        mainSizer = wxFlexGridSizer(0, 1)
        sliderSizer = wxFlexGridSizer(0, 2)
        buttonSizer = wxBoxSizer(wxHORIZONTAL)

        if options.usrp :
            # TX d'board 0
            gainLabel = wxStaticText(self, -1, "PGA 0")
            gainSlider = wxSlider(self, ID_GAIN_SLIDER0, self.pga,
                    self.pgaMin / self.pgaStep, self.pgaMax / self.pgaStep,
                    style = wxSL_HORIZONTAL | wxSL_AUTOTICKS)
            gainSlider.SetSize((400, -1))
            sliderSizer.Add(gainLabel, 0,
                    wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE, 0)
            sliderSizer.Add(gainSlider, 0,
                    wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE, 0)

            freqLabel = wxStaticText(self, -1, "Frequency 0")
            freqSlider = wxSlider(self, ID_FREQ_SLIDER0,
                    options.frequency[0] / 16000, 0, 20e3,
                    style = wxSL_HORIZONTAL | wxSL_AUTOTICKS)
            freqSlider.SetSize((400, -1))
            sliderSizer.Add(freqLabel, 0,
                    wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE, 0)
            sliderSizer.Add(freqSlider, 0,
                    wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE, 0)

            if len(options.frequency) > 1 :
                # TX d'board 1
                gainLabel = wxStaticText(self, -1, "PGA 1")
                gainSlider = wxSlider(self, ID_GAIN_SLIDER1, self.pga,
                        self.pgaMin / self.pgaStep, self.pgaMax / self.pgaStep,
                        style = wxSL_HORIZONTAL | wxSL_AUTOTICKS)
                gainSlider.SetSize((400, -1))
                sliderSizer.Add(gainLabel, 0,
                        wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE, 0)
                sliderSizer.Add(gainSlider, 0,
                        wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE, 0)

                freqLabel = wxStaticText(self, -1, "Frequency 1")
                freqSlider = wxSlider(self, ID_FREQ_SLIDER1,
                        options.frequency[1] / 16000, 0, 20e3,
                        style = wxSL_HORIZONTAL | wxSL_AUTOTICKS)
                freqSlider.SetSize((400, -1))
                sliderSizer.Add(freqLabel, 0,
                        wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE, 0)
                sliderSizer.Add(freqSlider, 0,
                        wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE, 0)

            mainSizer.Add(sliderSizer, 1, wxEXPAND, 0)

        start = wxButton(self, ID_START, "Start")
        stop = wxButton(self, ID_STOP, "Stop")
        buttonSizer.Add(start, 1, wxALIGN_CENTER, 0)
        buttonSizer.Add(stop, 1, wxALIGN_CENTER, 0)
        mainSizer.Add(buttonSizer, 1, wxEXPAND, 0)
    
# GnuRadio
        self.fg = gr.flow_graph()
        if options.mode == 1 :
            print "Source: real"
            if (options.encoding == "s") :
                print "Source encoding: short"
                src = gr.file_source(gr.sizeof_short, options.filename[0], 1)
                if (options.copy) :
                    print "Imag: copy"
                    imag = src
                else :
                    print "Imag: null"
                    imag = gr.null_source(gr.sizeof_short)
                interleaver = gr.interleave(gr.sizeof_short)
                self.fg.connect(src, (interleaver, 0))
                self.fg.connect(imag, (interleaver, 1))
                tail = interleaver
            elif (options.encoding == "f") :
                print "Source encoding: float"
                src = gr.file_source(gr.sizeof_gr_complex,
                    options.filename[0], 1)
                tail = src
        elif (options.mode == 2) :
            print "Source: complex"
            if len(options.frequency) == 1 :
                if (options.encoding == "s") :
                    print "Source encoding: short"
                    src = gr.file_source(gr.sizeof_short,
                            options.filename[0], 1)
                elif (options.encoding == "f") :
                    print "Source encoding: float"
                    src = gr.file_source(gr.sizeof_gr_complex,
                            options.filename[0], 1)
                else :
                    parser.error("Invalid encoding type for complex data!")
                tail = src
                    
            elif (len(options.frequency) == 2) :
                src0 = gr.file_source(gr.sizeof_gr_complex,
                        options.filename[0], 1)
                src1 = gr.file_source(gr.sizeof_gr_complex,
                        options.filename[1], 1)
                interleaver = gr.interleave(gr.sizeof_gr_complex)
                self.fg.connect(src0, (interleaver, 0))
                self.fg.connect(src1, (interleaver, 1))
                tail = interleaver
            else :
                parser.error(
                        "Invalid number of source (> 2) with complex input!")
        else :
            parser.error("Invalid mode!")

# Interpolation
        dac_freq = options.clockrate
        interp = int(dac_freq / options.samplingrate)
        if interp == 0 :
            parser.error("Invalid sampling rate!")
        if options.mode == 2 :
            print "Input sampling rate: %s complex samples/s" % \
                num_to_str(options.samplingrate)
        else :
            print "Input sampling rate: %s samples/s" % \
                num_to_str(options.samplingrate)
        print "Interpolation rate: int(%s / %s) = %sx" % \
            (num_to_str(dac_freq), num_to_str(options.samplingrate), interp)
        if interp > 512 :
            factor = gcd(dac_freq / 512, options.samplingrate)
            num = int((dac_freq / 512) / factor)
            den = int(options.samplingrate / factor)
            print "Resampling by %i / %i" % (num, den)
            resampler = blks.rational_resampler_ccc(self.fg, num, den)
            self.fg.connect(tail, resampler)
            tail = resampler
            interp = 512
            options.samplingrate = dac_freq / 512

# AGC
        if options.agc :
            agc = gr.agc_cc()
            self.fg.connect(tail, agc)
            tail = agc
            
# USRP
        if options.usrp :
            nchan = len(options.frequency)
            if len(options.frequency) == 1 :
                if options.mode == 1 :
                    mux = 0x00000098
                elif options.mode == 2 :
                    mux = 0x00000098
                else :
                    parser.error("Unsupported mode for USRP mux!")
            elif len(options.frequency) == 2 :
                if options.mode == 1 :
                    mux = 0x0000ba98
                elif options.mode == 2 :
                    mux = 0x0000ba98
                else :
                    parser.error("Unsupported mode for USRP mux!")
            else :
                parser.error("Invalid number of frequency [0..2]!")
#            if options.tx == "A" :
#                mux = 0x00000098
#            else :
#                mux = 0x00009800
            print "Nb channels: ", nchan
            print "Mux: 0x%x" % mux
            if options.encoding == 's' :
                dst = usrp.sink_s(0, interp, nchan, mux)
            elif options.encoding == 'f' :
                dst = usrp.sink_c(0, interp, nchan, mux)
            else :
                parser.error("Unsupported data encoding for USRP!")
            
            dst.set_verbose(1)

            for i in range(len(options.frequency)) :
                if options.gain is None :
                    print "Setting gain to %f" % dst.pga_max()
                    dst.set_pga(i << 1, dst.pga_max())
                else :
                    print "Setting gain to %f" % options.gain
                    dst.set_pga(i << 1, options.gain)

                tune = false
                for dboard in dst.db:
                    if (dboard[0].dbid() != -1):
                        device = dboard[0]
                        print "Tuning TX d'board %s to %sHz" % \
                                (device.side_and_name(),
                                num_to_str(options.frequency[i]))
                        device.lo_offset = 38e6
                        (min, max, offset) = device.freq_range()
                        print " Frequency"
                        print "  Min:    %sHz" % num_to_str(min)
                        print "  Max:    %sHz" % num_to_str(max)
                        print "  Offset: %sHz" % num_to_str(offset)
#device.set_gain(device.gain_range()[1])
                        device.set_enable(True)
                        tune = \
                            dst.tune(device._which, device,
                                    options.frequency[i] * 128e6 / dac_freq)
                        if tune:
                            print "  Baseband frequency: %sHz" % \
                                num_to_str(tune.baseband_freq)
                            print "  DXC frequency: %sHz" % \
                                num_to_str(tune.dxc_freq)
                            print "  Residual Freqency: %sHz" % \
                                num_to_str(tune.residual_freq)
                            print "  Inverted: ", \
                                tune.inverted
                            mux = usrp.determine_tx_mux_value(dst,
                                    (device._which, 0))
                            dst.set_mux(mux)
                            break
                        else:
                            print "  Failed!"
                if not tune:
                    print "  Failed!"
                    raise SystemExit

# int nunderruns ()

            print "USRP"
            print " Rx halfband: ", dst.has_rx_halfband()
            print " Tx halfband: ", dst.has_tx_halfband()
            print " Nb DDC: ", dst.nddc()
            print " Nb DUC: ", dst.nduc()
#dst._write_9862(0, 14, 224)
            
            print " DAC frequency: %s samples/s" % num_to_str(dst.dac_freq())
            print " Fpga decimation rate: %s -> %s samples/s" % \
                (num_to_str(dst.interp_rate()),
                 num_to_str(dac_freq / dst.interp_rate()))
            print " Nb channels:",
            if hasattr(dst, "nchannels()") :
                print dst.nchannels()
            else:
                print "N/A"
            print " Mux:",
            if hasattr(dst, "mux()") :
                print "0x%x" % dst.mux()
            else :
                print "N/A"
            print " FPGA master clock frequency:",
            if hasattr(dst, "fpga_master_clock_freq()") :
                print "%sHz" % num_to_str(dst.fpga_master_clock_freq())
            else :
                print "N/A"
            print " Converter rate:",
            if hasattr(dst, "converter_rate()") :
                print "%s" % num_to_str(dst.converter_rate())
            else :
                print "N/A"
            print " DAC rate:",
            if hasattr(dst, "dac_rate()") :
                print "%s sample/s" % num_to_str(dst.dac_rate())
            else :
                print "N/A"
            print " Interp rate: %sx" % num_to_str(dst.interp_rate())
            print " DUC frequency 0: %sHz" % num_to_str(dst.tx_freq(0))
            print " DUC frequency 1: %sHz" % num_to_str(dst.tx_freq(1))
            print " Programmable Gain Amplifier 0: %s dB" % \
                num_to_str(dst.pga(0))
            print " Programmable Gain Amplifier 1: %s dB" % \
                num_to_str(dst.pga(2))

        else :
            dst = gr.null_sink(gr.sizeof_gr_complex)
            
# AGC
        if options.agc :
            agc = gr.agc_cc()
            self.fg.connect(tail, agc)
            tail = agc
            
        self.fg.connect(tail, dst)

# oscilloscope
        if options.osc :
            oscPanel = wxPanel(self, -1)
            if (options.encoding == "s") :
                converter = gr.interleaved_short_to_complex()
                self.fg.connect(tail, converter)
                signal = converter
            elif (options.encoding == "f") :
                signal = tail
            else :
                parser.error("Unsupported data encoding for oscilloscope!")

#block = scope_sink_f(fg, parent, title=label, sample_rate=input_rate)
#return (block, block.win)

            oscWin = scopesink.scope_sink_c(self.fg, oscPanel, "Signal",
                    options.samplingrate)
            self.fg.connect(signal, oscWin)
            mainSizer.Add(oscPanel, 1, wxEXPAND)

# spectrometer
        if options.spectrum :
            ymin = 0
            ymax = 160
            fftPanel = wxPanel(self, -1)
            if (options.encoding == "s") :
                converter = gr.interleaved_short_to_complex()
                self.fg.connect(tail, converter)
                signal = converter
            elif (options.encoding == "f") :
                signal = tail
            else :
                parser.error("Unsupported data encoding for oscilloscope!")

            fftWin = fftsink.fft_sink_c(self.fg, fftPanel,
                    title="Spectrum",
                    fft_size=2048,
                    sample_rate=options.samplingrate,
                    y_per_div=(ymax - ymin) / 8,
                    ref_level=ymax,
                    fft_rate=50,
                    average=True
                    )
            self.fg.connect(signal, fftWin)
            mainSizer.Add(fftPanel, 1, wxEXPAND)

# Events
        EVT_MENU(self, ID_ABOUT, self.OnAbout)
        EVT_MENU(self, ID_EXIT,  self.TimeToQuit)
        EVT_SLIDER(self, ID_GAIN_SLIDER0, self.slideEvent)
        EVT_SLIDER(self, ID_FREQ_SLIDER0, self.slideEvent)
        EVT_SLIDER(self, ID_GAIN_SLIDER1, self.slideEvent)
        EVT_SLIDER(self, ID_FREQ_SLIDER1, self.slideEvent)
        EVT_BUTTON(self, ID_START, self.onClick)
        EVT_BUTTON(self, ID_STOP, self.onClick)

#Layout sizers
        self.SetSizer(mainSizer)
        self.SetAutoLayout(1)
        mainSizer.Fit(self)

        self.fg.start()
 def set_rx_freq(self, rx_freq):
     self.rx_freq = rx_freq
     Qt.QMetaObject.invokeMethod(self._rx_freq_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.rx_freq)))
     self.uhd_usrp_source_1.set_center_freq(uhd.tune_request(self.rx_freq, self.rx_offset), 0)
     self.qtgui_waterfall_sink_x_0.set_frequency_range(self.rx_freq, self.samp_rate)
     self.qtgui_freq_sink_x_1_0_1.set_frequency_range(self.rx_freq, self.samp_rate)
예제 #55
0
    def __init__(self, freq, subdev_spec, which_USRP, gain, audio_output,
                 debug):
        gr.hier_block2.__init__(
            self,
            "analog_receive_path",
            gr.io_signature(0, 0, 0),  #input signature
            gr.io_signature(0, 0, 0))  #output signature

        self.DEBUG = debug
        self.freq = freq
        self.rx_gain = gain

        #Formerly From XML
        self.fusb_block_size = 2048
        self.fusb_nblocks = 8
        self.rx_usrp_pga_gain_scaling = 0.5
        self.rx_base_band_bw = 5e3
        self.rx_freq_deviation = 2.5e3

        # acquire USRP via USB 2.0
        #self.u = usrp.source_c(fusb_block_size=self.fusb_block_size,
        #                       fusb_nblocks=self.fusb_nblocks,
        #                       which=which_USRP)
        self.u = uhd.single_usrp_source(
            device_addr="",
            io_type=uhd.io_type_t.COMPLEX_FLOAT32,
            num_channels=1,
        )
        self.u.get_device
        # get A/D converter sampling rate
        #adc_rate = self.u.adc_rate()      # 64 MS/s
        adc_rate = 64e6  # 64 MS/s
        if self.DEBUG:
            print "    Rx Path ADC rate:      %d" % (adc_rate)

        # setting USRP and GNU Radio decimation rate
        self.audio_rate = 16e3
        self.max_gr_decim_rate = 40

        self._usrp_decim = 250
        self.gr_rate1 = adc_rate / self._usrp_decim
        gr_interp = 1
        gr_decim = 16
        self.gr_rate2 = self.gr_rate1 / gr_decim

        if self.DEBUG:
            print "    usrp decim: ", self._usrp_decim
            print "    gr rate 1:  ", self.gr_rate1
            print "    gr decim: ", gr_decim
            print "    gr rate 2: ", self.gr_rate2
            print "    gr interp: ", gr_interp
            print "    audio rate: ", self.audio_rate

        # ================  Set up flowgraph  =================================

        # set USRP decimation ratio
        #self.u.set_decim_rate(self._usrp_decim)
        self.u.set_samp_rate(self.gr_rate1)
        self.u.set_antenna("RX2")

        # set USRP daughterboard subdevice
        if subdev_spec is None:
            subdev_spec = usrp.pick_rx_subdevice(self.u)
        #self.u.set_mux(usrp.determine_rx_mux_value(self.u, subdev_spec))
        #self.subdev = usrp.selected_subdev(self.u, subdev_spec)
        #if self.DEBUG:
        #    print "    RX Path use daughterboard:  %s"    % (self.subdev.side_and_name())

        # set USRP RF frequency
        """
        Set the center frequency in Hz.
        Tuning is a two step process.  First we ask the front-end to
        tune as close to the desired frequency as it can.  Then we use
        the result of that operation and our target_frequency to
        determine the value for the digital up converter.
        """
        assert (self.freq != None)
        #r = self.u.tune(0, self.subdev, self.freq)
        r = self.u.set_center_freq(self.freq, 0)
        if self.DEBUG:
            if r:
                print "----Rx RF frequency set to %f Hz" % (self.freq)
            else:
                print "Failed to set Rx frequency to %f Hz" % (self.freq)
                raise ValueError, eng_notation.num_to_str(self.freq)

        # set USRP Rx PGA gain
        #r = self.subdev.gain_range()
        #_rx_usrp_gain_range = r[1] - r[0]
        #_rx_usrp_gain = r[0]+_rx_usrp_gain_range * self.rx_usrp_pga_gain_scaling
        #self.subdev.set_gain(_rx_usrp_gain)
#self.u.set_gain(3.25, 0)
#if self.DEBUG:
#    print "    USRP Rx PGA Gain Range: min = %g, max = %g, step size = %g" \
#            %(r[0], r[1], r[2])
#    print "    USRP Rx PGA gain set to: %g" %(_rx_usrp_gain)

# Do NOT Enable USRP Auto Tx/Rx switching for analog flow graph!
#self.subdev.set_enable(False)

# Baseband Channel Filter using FM Carson's Rule
        chan_bw = 2 * (self.rx_base_band_bw + self.rx_freq_deviation
                       )  #Carson's Rule
        chan_filt_coeffs_float = optfir.low_pass(
            1,  #gain
            self.gr_rate1,  #sampling rate
            chan_bw,  #passband cutoff
            chan_bw * 1.35,  #stopband cutoff
            0.1,  #passband ripple
            60)  #stopband attenuation
        chan_filt_coeffs_fixed = (
            0.000457763671875, 0.000946044921875, 0.00067138671875,
            0.001068115234375, 0.00091552734375, 0.0008544921875,
            0.000518798828125, 0.0001220703125, -0.000396728515625,
            -0.0008544921875, -0.00128173828125, -0.00146484375,
            -0.001434326171875, -0.0010986328125, -0.000518798828125,
            0.000274658203125, 0.001129150390625, 0.00189208984375,
            0.00238037109375, 0.00250244140625, 0.002166748046875,
            0.0013427734375, 0.000152587890625, -0.001220703125,
            -0.002532958984375, -0.0035400390625, -0.003997802734375,
            -0.003753662109375, -0.002777099609375, -0.0010986328125,
            0.000946044921875, 0.00311279296875, 0.00494384765625,
            0.00604248046875, 0.006103515625, 0.005035400390625,
            0.00286865234375, -0.0001220703125, -0.00347900390625,
            -0.006561279296875, -0.008758544921875, -0.00958251953125,
            -0.008636474609375, -0.005950927734375, -0.001739501953125,
            0.00335693359375, 0.00848388671875, 0.0126953125, 0.01507568359375,
            0.014862060546875, 0.01171875, 0.00579833984375,
            -0.002227783203125, -0.01123046875, -0.0196533203125,
            -0.02587890625, -0.028228759765625, -0.025421142578125,
            -0.016754150390625, -0.002166748046875, 0.017608642578125,
            0.041015625, 0.0660400390625, 0.090240478515625, 0.111083984375,
            0.12640380859375, 0.134490966796875, 0.134490966796875,
            0.12640380859375, 0.111083984375, 0.090240478515625,
            0.0660400390625, 0.041015625, 0.017608642578125,
            -0.002166748046875, -0.016754150390625, -0.025421142578125,
            -0.028228759765625, -0.02587890625, -0.0196533203125,
            -0.01123046875, -0.002227783203125, 0.00579833984375, 0.01171875,
            0.014862060546875, 0.01507568359375, 0.0126953125,
            0.00848388671875, 0.00335693359375, -0.001739501953125,
            -0.005950927734375, -0.008636474609375, -0.00958251953125,
            -0.008758544921875, -0.006561279296875, -0.00347900390625,
            -0.0001220703125, 0.00286865234375, 0.005035400390625,
            0.006103515625, 0.00604248046875, 0.00494384765625,
            0.00311279296875, 0.000946044921875, -0.0010986328125,
            -0.002777099609375, -0.003753662109375, -0.003997802734375,
            -0.0035400390625, -0.002532958984375, -0.001220703125,
            0.000152587890625, 0.0013427734375, 0.002166748046875,
            0.00250244140625, 0.00238037109375, 0.00189208984375,
            0.001129150390625, 0.000274658203125, -0.000518798828125,
            -0.0010986328125, -0.001434326171875, -0.00146484375,
            -0.00128173828125, -0.0008544921875, -0.000396728515625,
            0.0001220703125, 0.000518798828125, 0.0008544921875,
            0.00091552734375, 0.001068115234375, 0.00067138671875,
            0.000946044921875, 0.000457763671875)

        #r = gr.enable_realtime_scheduling ()
        self.chan_filt = dsp.fir_ccf_fm_demod_decim(chan_filt_coeffs_fixed, 14,
                                                    gr_decim, 0, 0, 0, 0)
        print "Tap length of chan FIR: ", len(chan_filt_coeffs_fixed)

        # Set the software LNA gain on the output of the USRP
        gain = self.rx_gain
        self.rx_gain = max(0.0, min(gain, 1e7))

        if self.DEBUG:
            print "    Rx Path initial software signal gain: %f (max 1e7)" % (
                gain)
            print "    Rx Path actual software signal gain : %f (max 1e7)" % (
                self.rx_gain)

        #FM Demodulator
        fm_demod_gain = self.audio_rate / (2 * math.pi *
                                           self.rx_freq_deviation)
        self.fm_demod = gr.quadrature_demod_cf(fm_demod_gain)

        #Compute FIR filter taps for audio filter
        width_of_transition_band = self.rx_base_band_bw * 0.35
        audio_coeffs = gr.firdes.low_pass(
            1.0,  #gain
            self.gr_rate2,  #sampling rate
            self.rx_base_band_bw,
            width_of_transition_band,
            gr.firdes.WIN_HAMMING)

        self.audio_filter = gr.fir_filter_fff(1, audio_coeffs)
        passband_cutoff = self.rx_base_band_bw
        stopband_cutoff = passband_cutoff * 1.35

        self.deemph = fm_deemph(self.audio_rate)

        if self.DEBUG:
            print "Length Audio FIR ", len(audio_coeffs)
        # Audio sink

        audio_sink = audio.sink(int(self.audio_rate), "default")
        #                         "",     #Audio output pcm device name.  E.g., hw:0,0 or surround51 or /dev/dsp
        #                         False)  # ok_to_block

        if self.DEBUG:
            print "Before Connecting Blocks"
        # Wiring Up
        #WITH CHANNEL FILTER
        #self.connect (self.u, self.chan_filt, self.lna, self.fm_demod, self.audio_filter, interpolator, self.deemph, self.volume_control, audio_sink)

        #self.connect (self.u, self.fm_demod, self.audio_filter, self.deemph, self.volume_control, howto_rx, audio_sink)
        self.connect(self.u, self.chan_filt, self.audio_filter, self.deemph,
                     audio_sink)
예제 #56
0
 def set_Elevation(self, Elevation):
     self.Elevation = Elevation
     Qt.QMetaObject.invokeMethod(self._Elevation_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.Elevation)))
     self.radio_astro_ra_event_sink_0.set_telel( self.Elevation)
     self._Elevation_save_config = ConfigParser.ConfigParser()
     self._Elevation_save_config.read(self.ConfigFile)
     if not self._Elevation_save_config.has_section('main'):
     	self._Elevation_save_config.add_section('main')
     self._Elevation_save_config.set('main', 'elevation', str(self.Elevation))
     self._Elevation_save_config.write(open(self.ConfigFile, 'w'))
예제 #57
0
 def set_subcarrier_freq(self, subcarrier_freq):
     self.subcarrier_freq = subcarrier_freq
     Qt.QMetaObject.invokeMethod(
         self._subcarrier_freq_line_edit, "setText",
         Qt.Q_ARG("QString", eng_notation.num_to_str(self.subcarrier_freq)))
     self.channel_filter.set_center_freq(5.8e9 + self.subcarrier_freq)
예제 #58
0
 def set_Frequency(self, Frequency):
     self.Frequency = Frequency
     Qt.QMetaObject.invokeMethod(self._Frequency_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.Frequency)))
     self.rtlsdr_source_0.set_center_freq(self.Frequency, 0)
     self.radio_astro_ra_event_sink_0.set_frequency( self.Frequency*1.E-6)
     self.radio_astro_detect_0.set_freq( self.Frequency)
     self._Frequencys_config = ConfigParser.ConfigParser()
     self._Frequencys_config.read(self.ConfigFile)
     if not self._Frequencys_config.has_section('main'):
     	self._Frequencys_config.add_section('main')
     self._Frequencys_config.set('main', 'frequency', str(self.Frequency))
     self._Frequencys_config.write(open(self.ConfigFile, 'w'))
예제 #59
0
 def set_samp_rate(self, samp_rate):
     self.samp_rate = samp_rate
     Qt.QMetaObject.invokeMethod(self._samp_rate_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.samp_rate)))
     self.qtgui_waterfall_sink_x_0.set_frequency_range(0, self.samp_rate)
     self.qtgui_freq_sink_x_0.set_frequency_range(0, self.samp_rate)
     self.set_keep_n(self.samp_rate/self.record_hz)
     self.blocks_throttle_0.set_sample_rate(self.samp_rate*self.throttle_factor)
     self.blocks_multiply_const_vxx_0_0.set_k((self.samp_rate/(2*math.pi), ))
     self.blocks_moving_average_xx_0_1.set_length_and_scale(int(self.samp_rate/self.record_hz), 1.0/(self.samp_rate/self.record_hz))
     self.blocks_keep_one_in_n_0_0.set_n(int(self.samp_rate/self.record_hz))
     self.analog_sig_source_x_0.set_sampling_freq(self.samp_rate)
     self.analog_sig_source_x_0.set_frequency(self.probe_offset_func+self.samp_rate/4)
     self.set_alpha(1.0/(self.samp_rate/self.record_hz))
예제 #60
0
 def set_Azimuth(self, Azimuth):
     self.Azimuth = Azimuth
     Qt.QMetaObject.invokeMethod(self._Azimuth_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.Azimuth)))
     self.radio_astro_ra_event_sink_0.set_telaz( self.Azimuth)
     self._Azimuth_save_config = ConfigParser.ConfigParser()
     self._Azimuth_save_config.read(self.ConfigFile)
     if not self._Azimuth_save_config.has_section('main'):
     	self._Azimuth_save_config.add_section('main')
     self._Azimuth_save_config.set('main', 'azimuth', str(self.Azimuth))
     self._Azimuth_save_config.write(open(self.ConfigFile, 'w'))