• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python uhd_interface.uhd_receiver函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中uhd_interface.uhd_receiver函数的典型用法代码示例。如果您正苦于以下问题:Python uhd_receiver函数的具体用法?Python uhd_receiver怎么用?Python uhd_receiver使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了uhd_receiver函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, callback, options):
        gr.top_block.__init__(self)

        self.source = uhd_receiver(
            options.args,
            options.bandwidth,
            options.rx_freq,
            options.rx_gain,
            options.spec,
            options.antenna,
            options.verbose,
        )

        self.sink = uhd_transmitter(
            options.args,
            options.bandwidth,
            options.tx_freq,
            options.tx_gain,
            options.spec,
            options.antenna,
            options.verbose,
        )

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

        self.connect(self.txpath, self.sink)
        self.connect(self.source, self.rxpath)
开发者ID:Wysaat,项目名称:gnuradio,代码行数:28,代码来源:tunnel.py


示例2: __init__

    def __init__(self, options):
        gr.top_block.__init__(self)

        if(options.rx_freq is not None):
            if options.rx_ant == 1:
                self.source = uhd_receiver(options.args,
                                       options.bandwidth, options.rx_freq,
                                       options.lo_offset, options.rx_gain,
                                       options.spec, options.antenna,
                                       options.clock_source, options.time_source,options.verbose)
            else:
                self.source = uhd_mimo_receiver(options.args,
                                       options.bandwidth, options.rx_freq,
                                       options.lo_offset, options.rx_gain,
                                       options.spec, options.antenna,
                                       options.clock_source, options.time_source, options.verbose)
        elif(options.from_file is not None):
            self.source = blocks.file_source(gr.sizeof_gr_complex, options.from_file)
        else:
            self.source = blocks.null_source(gr.sizeof_gr_complex)
        if (options.rx_ant == 1):
            self._setup_rx_path(options)
            self._setup_rpc_manager()
            self.dst    = (self.rxpath,0)
            self.connect((self.source,0), self.dst)
        else:
            self._setup_rx_path(options)
            self._setup_rpc_manager()
            self.dst    = (self.rxpath,0)
            self.dst2     = (self.rxpath,1)
            self.connect((self.source,0), self.dst)
            self.connect((self.source,1), self.dst2)
开发者ID:WindyCitySDR,项目名称:gr-ofdm,代码行数:32,代码来源:rx_mimo.py


示例3: __init__

    def __init__(self, demod_class, rx_callback, options):
        gr.top_block.__init__(self)
        self.rxpath = receive_path(demod_class, rx_callback, options)
        self.audio_tx = audio_tx(options.audio_output)

        if(options.rx_freq is not None):
            self.source = uhd_receiver(options.args, options.bitrate,
                                       options.samples_per_symbol,
                                       options.rx_freq, options.rx_gain,
                                       options.antenna, options.verbose)
            options.samples_per_symbol = self.source._sps

            audio_rate = self.audio_tx.sample_rate
            usrp_rate = self.source.get_sample_rate()
            rrate = audio_rate / usrp_rate
            self.resampler = blks2.pfb_arb_resampler_ccf(rrate)
            
            self.connect(self.source, self.resampler, self.rxpath)

        elif(options.from_file is not None):
            self.thr = gr.throttle(gr.sizeof_gr_complex, options.bitrate)
            self.source = gr.file_source(gr.sizeof_gr_complex, options.from_file)
            self.connect(self.source, self.thr, self.rxpath)

        else:
            self.thr = gr.throttle(gr.sizeof_gr_complex, 1e6)
            self.source = gr.null_source(gr.sizeof_gr_complex)
            self.connect(self.source, self.thr, self.rxpath)

	self.connect(self.audio_tx)        
开发者ID:manuts,项目名称:stop-and-wait-arq,代码行数:30,代码来源:rx_voice.py


示例4: __init__

    def __init__(self, demodulator, rx_callback, options):
        gr.top_block.__init__(self)

        if(options.rx_freq is not None):
            # Work-around to get the modulation's bits_per_symbol
            args = demodulator.extract_kwargs_from_options(options)
            symbol_rate = options.bitrate / demodulator(**args).bits_per_symbol()

            self.source = uhd_receiver(options.args, symbol_rate,
                                       options.samples_per_symbol, options.rx_freq, 
                                       options.lo_offset, options.rx_gain,
                                       options.spec, options.antenna,
                                       options.clock_source, options.verbose)
            options.samples_per_symbol = self.source._sps

        elif(options.from_file is not None):
            sys.stderr.write(("Reading samples from '%s'.\n\n" % (options.from_file)))
            self.source = blocks.file_source(gr.sizeof_gr_complex, options.from_file)
        else:
            sys.stderr.write("No source defined, pulling samples from null source.\n\n")
            self.source = blocks.null_source(gr.sizeof_gr_complex)

        # Set up receive path
        # do this after for any adjustments to the options that may
        # occur in the sinks (specifically the UHD sink)
        self.rxpath = receive_path(demodulator, rx_callback, options) 

        self.connect(self.source, self.rxpath)
开发者ID:0x7678,项目名称:gnuradio-wg-grc,代码行数:28,代码来源:benchmark_rx.py


示例5: __init__

    def __init__(self,demodulator, rx_callback, options):

        gr.top_block.__init__(self)
        '''
        Constructor for top block of Power Estimator
        Creates the graph for calculating mean and variance
        '''

        if(options.rx_freq is not None):
            # Work-around to get the modulation's bits_per_symbol
            args = demodulator.extract_kwargs_from_options(options)
            symbol_rate = options.bitrate / demodulator(**args).bits_per_symbol()
        ########## Node 1 - USRP Source ##########
            self.u= uhd_receiver(options.args, symbol_rate,
                                       options.samples_per_symbol, options.rx_freq,
                                       options.lo_offset, options.rx_gain,
                                       options.spec, options.antenna,
                                       options.clock_source, options.verbose)
            #options.samples_per_symbol = self.source._sps


            self.rxpath = receive_path(demodulator, rx_callback, options)
        if options.type == 'Rx' or options.type=='Rx/S':
            self.connect(self.u, self.rxpath)

        ########## Node 2 - Data Statistic Generator ##########

        self.d = periodogram(options)

        ########## Connect - USRP to DS Generator ##########
        if options.type=='Rx/S' or options.type=='S':
            self.connect(self.u,self.d)
开发者ID:prog-RAM-zing,项目名称:GNU-Radio-USRP,代码行数:32,代码来源:rssi_measure.py


示例6: __init__

    def __init__(self, mod_class, demod_class,
                 rx_callback, options):

        gr.top_block.__init__(self)

        # Get the modulation's bits_per_symbol
        args = mod_class.extract_kwargs_from_options(options)
        symbol_rate = options.bitrate / mod_class(**args).bits_per_symbol()

        self.source = uhd_receiver(options.args, symbol_rate,
                                   options.samples_per_symbol,
                                   options.rx_freq, options.rx_gain,
                                   options.spec, options.antenna,
                                   options.verbose)
        
        self.sink = uhd_transmitter(options.args, symbol_rate,
                                    options.samples_per_symbol,
                                    options.tx_freq, options.tx_gain,
                                    options.spec, options.antenna,
                                    options.verbose)
        
        options.samples_per_symbol = self.source._sps

        self.txpath = transmit_path(mod_class, options)
        self.rxpath = receive_path(demod_class, rx_callback, options)
        self.connect(self.txpath, self.sink)
        self.connect(self.source, self.rxpath)
开发者ID:manuts,项目名称:stop-and-wait-arq,代码行数:27,代码来源:tunnel.py


示例7: _setup_source

	def _setup_source(self, options):
	        self.symbol_rate=2; #for bpsk will edit the code later to set this automaticly based on the selected modulation scheme
	        self.u=uhd_receiver(options.args, self.symbol_rate,
                                        options.samples_per_symbol,
                                        options.rx_freq, options.rx_gain,
                                        options.spec, options.antenna,
                                        options.verbose)
开发者ID:nagsrk,项目名称:ofdm_uhd,代码行数:7,代码来源:usrp_receive_path_edited.py


示例8: __init__

    def __init__(self, modulator, demodulator, rx_callback, options):
        gr.top_block.__init__(self)
		#parameters to sense channe
        #options.symbol_rate=2500000
        #options.samples_per_symbol=2
        #options.rx_freq=2500000000
        #options.rx_gain=20
        #options.chbw_factor=1
        sense_symbol_rate=2500000
        sense_samples_per_symbol=2
        sense_rx_freq=2500000000
        sense_rx_gain=20
        options.chbw_factor=1
	#options.samples_per_symbol,

 
        #args = demodulator.extract_kwargs_from_options(options)
        self.sensesource=uhd_receiver(options.args, sense_symbol_rate,
                                       sense_samples_per_symbol,
                                       sense_rx_freq, sense_rx_gain,
                                       options.spec, options.antenna,
                                       options.verbose)

        if(options.tx_freq is not None):
            # Work-around to get the modulation's bits_per_symbol
            args = modulator.extract_kwargs_from_options(options)
            symbol_rate = options.bitrate / modulator(**args).bits_per_symbol()

            self.sink = uhd_transmitter(options.args, symbol_rate,
                                        options.samples_per_symbol,
                                        options.tx_freq, options.tx_gain,
                                        options.spec, options.antenna,
                                        options.verbose)
            options.samples_per_symbol = self.sink._sps
            
        elif(options.to_file is not None):
            sys.stderr.write(("Saving samples to '%s'.\n\n" % (options.to_file)))
            self.sink = gr.file_sink(gr.sizeof_gr_complex, options.to_file)
        else:
            sys.stderr.write("No sink defined, dumping samples to null sink.\n\n")
            self.sink = gr.null_sink(gr.sizeof_gr_complex)


        self.txgate = gr.copy(gr.sizeof_gr_complex)
        self.sensegate = gr.copy(gr.sizeof_gr_complex)
        #self.msgq             = gr.msg_queue()

        # do this after for any adjustments to the options that may
        # occur in the sinks (specifically the UHD sink)
        self.txpath = transmit_path(modulator, options)

        self.connect(self.txpath, self.txgate, self.sink)

	# do sense
        self.sensepath = sensing_path(options)

        self.tx_enabled = True
	self.sense_flag=False
	self.connect(self.sensesource, self.sensepath)
开发者ID:tyc85,项目名称:nwsdr-3.6.3-dsc,代码行数:59,代码来源:benchmarksenseFinal_tx.py


示例9: __init__

    def __init__(self, callback, options):
        gr.top_block.__init__(self)

	### Rx Side ###

        if(options.rx_freq is not None):
            self.source = uhd_receiver(options.args_rx,
                                       options.bandwidth,
                                       options.rx_freq, options.rx_gain,
                                       options.spec, options.antenna,
                                       options.verbose)
        elif(options.from_file is not None):
            self.source = gr.file_source(gr.sizeof_gr_complex, options.from_file)
        else:
            self.source = gr.null_source(gr.sizeof_gr_complex)


        # Set up receive path
        # do this after for any adjustments to the options that may
        # occur in the sinks (specifically the UHD sink)
        self.rxpath = receive_path(callback, options)

        
	## Tx Side ###
	if(options.tx_freq is not None):
            self.sink = uhd_transmitter(options.args_tx,
                                        options.bandwidth,
                                        options.tx_freq, options.tx_gain,
                                        options.spec, options.antenna,
                                        options.verbose)
        elif(options.to_file is not None):
            self.sink = gr.file_sink(gr.sizeof_gr_complex, options.to_file)
        else:
            self.sink = gr.null_sink(gr.sizeof_gr_complex)


        # do this after for any adjustments to the options that may
        # occur in the sinks (specifically the UHD sink)
        self.txpath = transmit_path(options)
        self.connect(self.txpath, self.sink)

#        self.txpath = gr.message_source(gr.sizeof_gr_complex, 3)
#        nco_sensitivity = 2.0/options.fft_length   # correct for fine frequency
#        self.nco = ftw.pnc_frequency_modulator_fc(nco_sensitivity)
#        self.connect(self.txpath, self.sink) # self.nco, 

	# if you use two USRPs and want to synchonized
	# need to change uhd_interface.py
#	self.source.config_mimo()
#	time.sleep(1)	# to make sync stable

	if options.debug:
	    self.connect(self.source, gr.file_sink(gr.sizeof_gr_complex, 'rx.dat'))	# Save reception signal 
	else:
	    self.connect(self.source, self.rxpath)
            #self.connect(self.source, gr.file_sink(gr.sizeof_gr_complex, 'rx.dat'))

	if(options.verbose):
            self._print_verbage()
开发者ID:UpYou,项目名称:ofdm,代码行数:59,代码来源:benchmark_txrx.py


示例10: __init__

 def __init__(self, callback, options):
     gr.top_block.__init__(self)
     self.source = uhd_receiver(options.args,
                                options.bandwidth, options.rx_freq,
                                options.lo_offset, options.rx_gain,
                                options.spec, options.antenna,
                                options.clock_source, options.verbose)
     self.rxpath = receive_path(callback, options)
     self.connect(self.source, self.rxpath)
开发者ID:teoyenmao,项目名称:usrp_project,代码行数:9,代码来源:test_uci.py


示例11: __init__

    def __init__(self, options):
        gr.top_block.__init__(self)

        if(options.rx_freq is not None):
            if options.rx_ant == 1:
                self.source = uhd_receiver(options.args,
                                       options.bandwidth, options.rx_freq,
                                       options.lo_offset, options.rx_gain,
                                       options.spec, options.antenna,
                                       options.clock_source, options.time_source,options.verbose)
            else:
                self.source = uhd_mimo_receiver(options.args,
                                       options.bandwidth, options.rx_freq,
                                       options.lo_offset, options.rx_gain,
                                       options.spec, options.antenna,
                                       options.clock_source, options.time_source, options.verbose)
        elif(options.from_file is not None):
            self.file = blocks.file_source(gr.sizeof_gr_complex, options.from_file)
            self.source = blocks.throttle(gr.sizeof_gr_complex,1e7)
            self.connect( self.file, self.source )
        else:
            self.source = blocks.null_source(gr.sizeof_gr_complex)
        '''
        if options.tx_ant == 1:
            if options.rx_ant == 1:
                self.rxpath = receive_path(options)
                self._setup_rpc_manager()
                self.connect(self.source, self.rxpath)
            else:
                self.rxpath = receive_path_12(options)
                self._setup_rpc_manager()
                self.connect(self.source, self.rxpath)
                self.connect((self.source,1), (self.rxpath,1))
                '''
        if (options.rx_ant == 1):
            self._setup_rx_path(options)
            self.setup_rpc_manager()
            self.dst    = (self.rxpath,0)
            self.connect((self.source,0), self.dst)
        else:
            self._setup_rx_path(options)
            self.setup_rpc_manager()
            self.dst    = (self.rxpath,0)
            self.dst2     = (self.rxpath,1)
            self.connect((self.source,0), self.dst)
            self.connect((self.source,1), self.dst2)

        if options.scatterplot:
          print "Scatterplot enabled"
开发者ID:WindyCitySDR,项目名称:gr-ofdm,代码行数:49,代码来源:rx.py


示例12: __init__

    def __init__(self, rx_callback, options):
        gr.top_block.__init__(self)

        # Setting up 'Transmit Path'
        self.txpath = transmit_path(options, self)

        # Setting up 'Receive Path'
        packet = cnPacket()
        self.rxpath = receive_path(rx_callback, packet, options) 

        # Channel
        samples_per_packet = options.samples_per_symbol * 8 * 36
 
        if options.mode == 'default':
            print 'Operating mode : Default'
            
            mods = digital.modulation_utils.type_1_mods()
            modulator = mods[options.modulation]
            
            args = modulator.extract_kwargs_from_options(options)
            symbol_rate = options.bitrate / modulator(**args).bits_per_symbol()

            self.usrp_sink = uhd_transmitter(options.args, symbol_rate,
                                        options.samples_per_symbol,
                                        options.tx_freq, options.tx_gain,
                                        options.spec, options.antenna,
                                        options.verbose)

            self.usrp_source = uhd_receiver(options.args, symbol_rate,
                                       options.samples_per_symbol,
                                       options.rx_freq, options.rx_gain,
                                       options.spec, options.antenna,
                                       options.verbose)

            options.samples_per_symbol = self.usrp_sink._sps
            
            
            #self.usrp_sink = usrp_sink(options)
            #self.usrp_source = usrp_source(options)
            self.connect(self.txpath, self.usrp_sink)
            self.connect(self.usrp_source, self.rxpath)

            
        elif options.mode == 'loopback':
            print 'Operating mode : Loopback'
      
            self.channel = channel_emulator(options,samples_per_packet)
            self.connect(self.txpath, self.channel, self.rxpath)
开发者ID:ychang,项目名称:gr-gtlib,代码行数:48,代码来源:cnPHY.py


示例13: __init__

    def __init__(self, callback, options):
        gr.top_block.__init__(self)

        self.source = uhd_receiver(options.args,
                                   options.bandwidth,
                                   options.rx_freq, options.rx_gain,
                                   options.spec, options.antenna,
                                   options.verbose)


        # Set up receive path
        # do this after for any adjustments to the options that may
        # occur in the sinks (specifically the UHD sink)
        self.rxpath = receive_path(callback, options)

        self.connect(self.source, self.rxpath)
开发者ID:xiaov58,项目名称:Coolest_Path,代码行数:16,代码来源:benchmark_rx.py


示例14: _setup_usrp_sink2

    def _setup_usrp_sink2(self,options,callback):
      print "setup_usrp_sink2",self._tx_freq
      if(options.rx_freq is not None):
		self.u_src = uhd_receiver(options.args,
                         options.bandwidth,
                         options.rx_freq, options.rx_gain,
                         options.spec, options.antenna,
                         options.verbose)
		# Set up receive path
		# do this after for any adjustments to the options that may
		# occur in the sinks (specifically the UHD sink)

      # Set up receive path
      # do this after for any adjustments to the options that may
      # occur in the sinks (specifically the UHD sink)
      self.rxpath = receive_path(callback, options)

      self.connect(self.u_src, self.rxpath)
开发者ID:jbruno,项目名称:gr_papyrus,代码行数:18,代码来源:ssma.py


示例15: __init__

    def __init__(self, options):
        gr.top_block.__init__(self)

        data_capsule = ( (+0+0j), (+0+0j), (+0+0j), (+0+0j), (+0+0j),
                         (+1+1j), (+1+1j), (+1+1j), (+1+1j), (+1+1j) )

        symbol_rate = 500000

        self.source = uhd_receiver(options.args, symbol_rate,
                                   2,
                                   options.rx_freq, 30,
                                   options.spec, "RX2",
                                   options.verbose)

        self.tx = uhd_transmitter(options.args, symbol_rate,
                                    2,
                                    options.tx_freq, 30,
                                    options.spec, "TX/RX", 
                                    options.verbose)

        options.samples_per_symbol = self.source._sps

        # Set up receive path
        # do this after for any adjustments to the options that may
        # occur in the sinks (specifically the UHD sink)
 
        self.serve = gr.vector_source_c(data_capsule)
        
        #self.correlator = correlator_cc.correlator_cc()

        #self.sink = gr.vector_sink_c()
        #self.file_sink = gr.file_sink(gr.sizeof_gr_complex, "out")

        self.server = correlator_cc.go_start_cc()
        self.inserter = correlator_cc.preamble_insert_cc()
        self.correlator = correlator_cc.correlator_cc()
      
        self.connect(self.source, self.correlator)
        self.connect(self.serve, (self.server,0))
        self.connect(self.correlator, (self.server,1))
       
        self.connect(self.server, self.inserter)
        self.connect(self.inserter, self.tx)
开发者ID:randyp1248,项目名称:darpa,代码行数:43,代码来源:rx_pingpong.py


示例16: rx_callback

    def rx_callback(ok, payload):
        global n_rcvd, n_right, flag

        (pktno,) = struct.unpack('!H', payload[0:2])
	data = payload[2:]
	#Check if packet is not a sensing packet and if so, send it to sock
	#Also check if the packet has already been delivered
	if pktno <= 1000:
        	
        	n_rcvd += 1
		if ok:
            		n_right += 1
			for i in range(0, len(packets_delivered)):
				if packets_delivered[i] == pktno:
					not_delivered = False
            		if options.server and not_delivered:
				packets_delivered.append(pktno)
                		sock.sendall(data)
			not_delivered = True
	#Check if pakcet is a sensing packet and jump freq accordingly
        if pktno > 1000 and flag == 0:
		if ok :
            		flag = 1
	    		new_freq =int(float(data))
	    		new = new_freq/1.0
	    		print "About to change freq"
	    		#Sleep to keep sync
	    		time.sleep(0.5)            

            		options.rx_freq = new
            		source = uhd_receiver(options.args, symbol_rate2,
                                       options.samples_per_symbol, options.rx_freq, 
                                       options.lo_offset, options.rx_gain,
                                       options.spec, options.antenna,
                                       options.clock_source, options.verbose)
            		rxpath = receive_path(demodulator2, rx_callback, options)
        #Reset flag if sensing packet burst is over
	if pktno <1000 and flag == 1:
		flag = 0
        
        print "ok = %5s  pktno = %4d  n_rcvd = %4d  n_right = %4d frequency = %s" % (
            ok, pktno, n_rcvd, n_right, options.rx_freq)
开发者ID:georgSquared,项目名称:QamazingTeam,代码行数:42,代码来源:benchmark_rx.py


示例17: __init__

    def __init__(self, demodulator, options, q_rx):
        '''Constructor.
        
        @param demodulator:
        @param options:
        @param q_rx:
        '''
        gr.top_block.__init__(self)

        if(options.rx_freq is not None):
            # Work-around to get the modulation's bits_per_symbol
            args = demodulator.extract_kwargs_from_options(options)
            symbol_rate = options.bitrate / \
                demodulator(**args).bits_per_symbol()

            self.source = uhd_receiver(options.args, symbol_rate,
                options.samples_per_symbol,
                options.rx_freq, options.rx_gain,
                options.spec, options.antenna,
                options.verbose)
            options.samples_per_symbol = self.source._sps

        elif(options.from_file is not None):
            sys.stderr.write(("Reading samples from '%s'.\n\n" % \
                (options.from_file)))
            self.source = gr.file_source(gr.sizeof_gr_complex, \
                options.from_file)
        else:
            sys.stderr.write( \
                "No source defined, pulling samples from null source.\n\n")
            self.source = gr.null_source(gr.sizeof_gr_complex)
        self.q_rx =q_rx
        # Set up receive path
        # do this after for any adjustments to the options that may
        # occur in the sinks (specifically the UHD sink)
        if options.version == '6':
            self.rxpath = rp36(demodulator, self.rx_callback, options) 
        if options.version == '7':
            self.rxpath = rp37(demodulator, self.rx_callback, options) 
            
        self.connect(self.source, self.rxpath)
开发者ID:vagonbar,项目名称:GNUnetwork,代码行数:41,代码来源:TxRxLayer1.py


示例18: __init__

    def __init__(self, callback, fwd_callback, options):
    #def __init__(self, options):
        gr.top_block.__init__(self)

        if(options.tx_freq is not None):
            self.sink = uhd_transmitter(options.args,
                                        options.bandwidth,
                                        options.tx_freq, options.tx_gain,
                                        options.spec, options.antenna,
                                        options.verbose)

	if(options.rx_freq is not None):
            self.source = uhd_receiver(options.args,
                                       options.bandwidth,
                                       options.rx_freq, options.rx_gain,
                                       options.spec, options.antenna,
                                       options.verbose)

        elif(options.to_file is not None):
            self.sink = gr.file_sink(gr.sizeof_gr_complex, options.to_file)
        else:
            self.sink = gr.null_sink(gr.sizeof_gr_complex)

        # do this after for any adjustments to the options that may
        # occur in the sinks (specifically the UHD sink)
        print "flow:: ", options.flow

        # only for bidirectional flows: source in the reverse direction needs to 
        # start the ofdm_sink first to allow the socket connections working fine.. 
        if (options.flow == 1):
            self.rxpath = receive_path(callback, fwd_callback, options)
            self.connect(self.source, self.rxpath)

            self.txpath = transmit_path(options)
            self.connect(self.txpath, self.sink)
        else:
            self.txpath = transmit_path(options)
            self.connect(self.txpath, self.sink)

            self.rxpath = receive_path(callback, fwd_callback, options)
            self.connect(self.source, self.rxpath)
开发者ID:gnychis,项目名称:gnuradio-3.5.0-dmr,代码行数:41,代码来源:benchmark.py


示例19: __init__

    def __init__(self, demod, options):

	gr.top_block.__init__(self, "rx_mpsk")

        self._demodulator_class = demod

        # Get demod_kwargs
        demod_kwargs = self._demodulator_class.extract_kwargs_from_options(options)
        
        # demodulator
	self._demodulator = self._demodulator_class(**demod_kwargs)

        if(options.rx_freq is not None):
            symbol_rate = options.bitrate / self._demodulator.bits_per_symbol()
            self._source = uhd_receiver(options.args, symbol_rate,
                                        options.samples_per_symbol,
                                        options.rx_freq, options.rx_gain,
                                        options.spec,
                                        options.antenna, options.verbose)
            options.samples_per_symbol = self._source._sps

        elif(options.from_file is not None):
            self._source = blocks.file_source(gr.sizeof_gr_complex, options.from_file)
        else:
            self._source = blocks.null_source(gr.sizeof_gr_complex)

        # Create the BERT receiver
        self._receiver = bert_receiver(options.bitrate,
                                       self._demodulator._constellation, 
                                       options.samples_per_symbol,
                                       options.differential, 
                                       options.excess_bw, 
                                       gray_coded=True,
                                       freq_bw=options.freq_bw,
                                       timing_bw=options.timing_bw,
                                       phase_bw=options.phase_bw,
                                       verbose=options.verbose,
                                       log=options.log)
        
        self.connect(self._source, self._receiver)
开发者ID:0x7678,项目名称:gnuradio-wg-grc,代码行数:40,代码来源:digital_bert_rx.py


示例20: __init__

    def __init__(self, options):
        gr.top_block.__init__(self)

        # some arbitrary data
        data_capsule = ( (+1+1j), (+1+1j), (-1-1j), (-1-1j), (+1+1j),
                         (-1+1j), (-1+1j), (+1-1j), (+1-1j), (-1-1j) )


        # Work-around to get the modulation's bits_per_symbol
        symbol_rate = 500000

        self.sink = uhd_transmitter(options.args, symbol_rate,
                                    2,
                                    options.tx_freq, 30,
                                    options.spec, "TX/RX",
                                    options.verbose)

        self.rx = uhd_receiver(options.args, symbol_rate,
                               2, 
                               options.rx_freq, 30, 
                               options.spec, "RX2",
                               options.verbose)

        options.samples_per_symbol = self.sink._sps

        self.serve = gr.vector_source_c(data_capsule)
        #self.inserter = correlator_cc.preamble_insert_cc()
        #self.connect(self.source, self.inserter)
        #self.connect(self.inserter, self.sink)

        self.server = correlator_cc.go_start_cc()
        self.inserter = correlator_cc.preamble_insert_cc()
        self.correlator = correlator_cc.correlator_cc()

        self.connect(self.rx, self.correlator)
        self.connect(self.serve, (self.server,0))
        self.connect(self.correlator, (self.server,1))
        self.connect(self.server, self.inserter)
        self.connect(self.inserter, self.sink)
开发者ID:randyp1248,项目名称:darpa,代码行数:39,代码来源:tx_pingpong.py



注:本文中的uhd_interface.uhd_receiver函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python uhd_interface.uhd_transmitter函数代码示例发布时间:2022-05-27
下一篇:
Python ugfx.set_default_font函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap