当前位置: 首页>>代码示例>>Python>>正文


Python analog.GR_COS_WAVE属性代码示例

本文整理汇总了Python中gnuradio.analog.GR_COS_WAVE属性的典型用法代码示例。如果您正苦于以下问题:Python analog.GR_COS_WAVE属性的具体用法?Python analog.GR_COS_WAVE怎么用?Python analog.GR_COS_WAVE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在gnuradio.analog的用法示例。


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

示例1: __init__

# 需要导入模块: from gnuradio import analog [as 别名]
# 或者: from gnuradio.analog import GR_COS_WAVE [as 别名]
def __init__(self,samp_rate,sensitivity):
        gr.sync_block.__init__(self,
            name="freq_selector",
            in_sig=[np.float32],
            out_sig=[np.float32]
            )
        self.freq = 6000
        self.samp_rate=samp_rate
        self.sensitivity=sensitivity
        self.num_samples=8192
        self.seed=[0,0,1]
        update=[0,0,0]
        self.freq_seed=[]
        self.freq_sel=0
        #self.src0= analog.sig_source_f(32000, analog.GR_COS_WAVE, freq, 1)
        for i in range((2**len(self.seed))-1):
            power0val=self.seed[2]^self.seed[1]
            update=np.roll(self.seed,1)
            update[0]=power0val
            self.seed=update
            self.freq_seed.append(self.seed)
            # 
开发者ID:Agrim9,项目名称:FHSS_GNUradio,代码行数:24,代码来源:freq_selector.py

示例2: __init__

# 需要导入模块: from gnuradio import analog [as 别名]
# 或者: from gnuradio.analog import GR_COS_WAVE [as 别名]
def __init__(self,samp_rate,sensitivity):
        gr.sync_block.__init__(self,
            name="freq_selector",
            in_sig=[np.float32],
            out_sig=[np.float32]
            )
        self.freq = 6000
        self.samp_rate=samp_rate
        self.sensitivity=sensitivity
        self.num_samples=8192
        self.seed=[1,0,1,1,1,1]
        update=[0,0,0,0,0,0]
        self.freq_seed=[]
        self.freq_sel=0
        #self.src0= analog.sig_source_f(32000, analog.GR_COS_WAVE, freq, 1)
        for i in range((2**len(self.seed))-1):
            power0val=self.seed[5]^self.seed[4]
            update=np.roll(self.seed,1)
            update[0]=power0val
            self.seed=update
            self.freq_seed.append(self.seed)
            # 
开发者ID:Agrim9,项目名称:FHSS_GNUradio,代码行数:24,代码来源:freq_selector.py

示例3: __init__

# 需要导入模块: from gnuradio import analog [as 别名]
# 或者: from gnuradio.analog import GR_COS_WAVE [as 别名]
def __init__(self):
        gr.top_block.__init__(self, "Secplus Tx")

        ##################################################
        # Variables
        ##################################################
        self.rolling = rolling = 1234567890
        self.fixed = fixed = 1234567890
        self.seq = seq = [0]*100 + secplus.ook(rolling, fixed, fast=False)*4 + [0]*100
        self.samp_rate = samp_rate = 2e6
        self.freq = freq = 315.15e6

        ##################################################
        # Blocks
        ##################################################
        self.single_pole_iir_filter_xx_0 = filter.single_pole_iir_filter_cc(0.1, 1)
        self.osmosdr_sink_0 = osmosdr.sink( args="numchan=" + str(1) + " " + '' )
        self.osmosdr_sink_0.set_sample_rate(samp_rate)
        self.osmosdr_sink_0.set_center_freq(freq - 300e3, 0)
        self.osmosdr_sink_0.set_freq_corr(0, 0)
        self.osmosdr_sink_0.set_gain(0, 0)
        self.osmosdr_sink_0.set_if_gain(47, 0)
        self.osmosdr_sink_0.set_bb_gain(0, 0)
        self.osmosdr_sink_0.set_antenna('', 0)
        self.osmosdr_sink_0.set_bandwidth(0, 0)

        self.blocks_vector_source_x_0 = blocks.vector_source_c(seq, False, 1, [])
        self.blocks_repeat_0 = blocks.repeat(gr.sizeof_gr_complex*1, 1000)
        self.blocks_multiply_xx_0 = blocks.multiply_vcc(1)
        self.analog_sig_source_x_0 = analog.sig_source_c(samp_rate, analog.GR_COS_WAVE, 300e3, 0.9, 0)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_xx_0, 0))
        self.connect((self.blocks_multiply_xx_0, 0), (self.osmosdr_sink_0, 0))
        self.connect((self.blocks_repeat_0, 0), (self.single_pole_iir_filter_xx_0, 0))
        self.connect((self.blocks_vector_source_x_0, 0), (self.blocks_repeat_0, 0))
        self.connect((self.single_pole_iir_filter_xx_0, 0), (self.blocks_multiply_xx_0, 1)) 
开发者ID:argilo,项目名称:secplus,代码行数:41,代码来源:secplus_tx.py

示例4: __init__

# 需要导入模块: from gnuradio import analog [as 别名]
# 或者: from gnuradio.analog import GR_COS_WAVE [as 别名]
def __init__(self, bb_gain=20, destination="localhost", freq=145e6, freq_corr=0, gpredict_port=4532, if_gain=20, offset=30e3, port=7355, rf_gain=40):
        gr.top_block.__init__(self, "SSB receiver for a FUNcube Dongle Pro+ device")

        ##################################################
        # Parameters
        ##################################################
        self.bb_gain = bb_gain
        self.destination = destination
        self.freq = freq
        self.freq_corr = freq_corr
        self.gpredict_port = gpredict_port
        self.if_gain = if_gain
        self.offset = offset
        self.port = port
        self.rf_gain = rf_gain

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 192e3
        self.doppler_freq = doppler_freq = freq

        ##################################################
        # Blocks
        ##################################################
        self.gpredict_doppler_0 = gpredict.doppler(self.set_doppler_freq, "localhost", 4532, False)
        self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(4, (firdes.low_pass(1, samp_rate, 1500, 500)), doppler_freq-freq+offset, samp_rate)
        self.fcdproplus_fcdproplus_0 = fcdproplus.fcdproplus("",1)
        self.fcdproplus_fcdproplus_0.set_lna(0)
        self.fcdproplus_fcdproplus_0.set_mixer_gain(0)
        self.fcdproplus_fcdproplus_0.set_if_gain(0)
        self.fcdproplus_fcdproplus_0.set_freq_corr(0)
        self.fcdproplus_fcdproplus_0.set_freq(freq-offset)
          
        self.blocks_udp_sink_0 = blocks.udp_sink(gr.sizeof_short*1, destination, port, 1472, True)
        self.blocks_multiply_xx_0 = blocks.multiply_vcc(1)
        self.blocks_float_to_short_0 = blocks.float_to_short(1, 32767)
        self.blocks_complex_to_real_0 = blocks.complex_to_real(1)
        self.analog_sig_source_x_0 = analog.sig_source_c(48000, analog.GR_COS_WAVE, 1500, 1, 0)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_xx_0, 0))    
        self.connect((self.blocks_complex_to_real_0, 0), (self.blocks_float_to_short_0, 0))    
        self.connect((self.blocks_float_to_short_0, 0), (self.blocks_udp_sink_0, 0))    
        self.connect((self.blocks_multiply_xx_0, 0), (self.blocks_complex_to_real_0, 0))    
        self.connect((self.fcdproplus_fcdproplus_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0))    
        self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.blocks_multiply_xx_0, 1)) 
开发者ID:daniestevez,项目名称:gr-frontends,代码行数:51,代码来源:fcdpp_usb.py

示例5: __init__

# 需要导入模块: from gnuradio import analog [as 别名]
# 或者: from gnuradio.analog import GR_COS_WAVE [as 别名]
def __init__(self, bb_gain=20, destination="localhost", freq=0, freq_corr=0, gpredict_port=4532, if_gain=20, offset=50e3, port=7355, rf_gain=40):
        gr.top_block.__init__(self, "Wide SSB receiver for an RTL-SDR device")

        ##################################################
        # Parameters
        ##################################################
        self.bb_gain = bb_gain
        self.destination = destination
        self.freq = freq
        self.freq_corr = freq_corr
        self.gpredict_port = gpredict_port
        self.if_gain = if_gain
        self.offset = offset
        self.port = port
        self.rf_gain = rf_gain

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 2.4e6
        self.doppler_freq = doppler_freq = freq

        ##################################################
        # Blocks
        ##################################################
        self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + "rtl" )
        self.osmosdr_source_0.set_sample_rate(samp_rate)
        self.osmosdr_source_0.set_center_freq(freq-offset, 0)
        self.osmosdr_source_0.set_freq_corr(freq_corr, 0)
        self.osmosdr_source_0.set_dc_offset_mode(0, 0)
        self.osmosdr_source_0.set_iq_balance_mode(0, 0)
        self.osmosdr_source_0.set_gain_mode(False, 0)
        self.osmosdr_source_0.set_gain(rf_gain, 0)
        self.osmosdr_source_0.set_if_gain(if_gain, 0)
        self.osmosdr_source_0.set_bb_gain(bb_gain, 0)
        self.osmosdr_source_0.set_antenna("", 0)
        self.osmosdr_source_0.set_bandwidth(0, 0)
          
        self.gpredict_doppler_0 = gpredict.doppler(self.set_doppler_freq, "localhost", 4532, False)
        self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(50, (firdes.low_pass(1, samp_rate, 12000, 500)), doppler_freq-freq+offset, samp_rate)
        self.blocks_udp_sink_0 = blocks.udp_sink(gr.sizeof_short*1, destination, port, 1472, True)
        self.blocks_multiply_xx_0 = blocks.multiply_vcc(1)
        self.blocks_float_to_short_0 = blocks.float_to_short(1, 32767)
        self.blocks_complex_to_real_0 = blocks.complex_to_real(1)
        self.analog_sig_source_x_0 = analog.sig_source_c(48000, analog.GR_COS_WAVE, 12000, 1, 0)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_xx_0, 0))    
        self.connect((self.blocks_complex_to_real_0, 0), (self.blocks_float_to_short_0, 0))    
        self.connect((self.blocks_float_to_short_0, 0), (self.blocks_udp_sink_0, 0))    
        self.connect((self.blocks_multiply_xx_0, 0), (self.blocks_complex_to_real_0, 0))    
        self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.blocks_multiply_xx_0, 1))    
        self.connect((self.osmosdr_source_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) 
开发者ID:daniestevez,项目名称:gr-frontends,代码行数:57,代码来源:rtlsdr_usb_wide.py

示例6: __init__

# 需要导入模块: from gnuradio import analog [as 别名]
# 或者: from gnuradio.analog import GR_COS_WAVE [as 别名]
def __init__(self, bb_gain=20, destination="localhost", freq=0, freq_corr=0, gpredict_port=4532, if_gain=20, offset=50e3, port=7355, rf_gain=40):
        gr.top_block.__init__(self, "SSB receiver for an RTL-SDR device")

        ##################################################
        # Parameters
        ##################################################
        self.bb_gain = bb_gain
        self.destination = destination
        self.freq = freq
        self.freq_corr = freq_corr
        self.gpredict_port = gpredict_port
        self.if_gain = if_gain
        self.offset = offset
        self.port = port
        self.rf_gain = rf_gain

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 2.4e6
        self.doppler_freq = doppler_freq = freq

        ##################################################
        # Blocks
        ##################################################
        self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + "rtl" )
        self.osmosdr_source_0.set_sample_rate(samp_rate)
        self.osmosdr_source_0.set_center_freq(freq-offset, 0)
        self.osmosdr_source_0.set_freq_corr(freq_corr, 0)
        self.osmosdr_source_0.set_dc_offset_mode(0, 0)
        self.osmosdr_source_0.set_iq_balance_mode(0, 0)
        self.osmosdr_source_0.set_gain_mode(False, 0)
        self.osmosdr_source_0.set_gain(rf_gain, 0)
        self.osmosdr_source_0.set_if_gain(if_gain, 0)
        self.osmosdr_source_0.set_bb_gain(bb_gain, 0)
        self.osmosdr_source_0.set_antenna("", 0)
        self.osmosdr_source_0.set_bandwidth(0, 0)
          
        self.gpredict_doppler_0 = gpredict.doppler(self.set_doppler_freq, "localhost", 4532, False)
        self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(50, (firdes.low_pass(1, samp_rate, 1500, 500)), doppler_freq-freq+offset, samp_rate)
        self.blocks_udp_sink_0 = blocks.udp_sink(gr.sizeof_short*1, destination, port, 1472, True)
        self.blocks_multiply_xx_0 = blocks.multiply_vcc(1)
        self.blocks_float_to_short_0 = blocks.float_to_short(1, 32767)
        self.blocks_complex_to_real_0 = blocks.complex_to_real(1)
        self.analog_sig_source_x_0 = analog.sig_source_c(48000, analog.GR_COS_WAVE, 1500, 1, 0)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_xx_0, 0))    
        self.connect((self.blocks_complex_to_real_0, 0), (self.blocks_float_to_short_0, 0))    
        self.connect((self.blocks_float_to_short_0, 0), (self.blocks_udp_sink_0, 0))    
        self.connect((self.blocks_multiply_xx_0, 0), (self.blocks_complex_to_real_0, 0))    
        self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.blocks_multiply_xx_0, 1))    
        self.connect((self.osmosdr_source_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) 
开发者ID:daniestevez,项目名称:gr-frontends,代码行数:57,代码来源:rtlsdr_usb.py

示例7: __init__

# 需要导入模块: from gnuradio import analog [as 别名]
# 或者: from gnuradio.analog import GR_COS_WAVE [as 别名]
def __init__(self, bb_gain=20, destination="localhost", freq=145e6, freq_corr=0, gpredict_port=4532, if_gain=20, offset=40e3, port=7355, rf_gain=40):
        gr.top_block.__init__(self, "Wide SSB receiver for a FUNcube Dongle Pro+ device")

        ##################################################
        # Parameters
        ##################################################
        self.bb_gain = bb_gain
        self.destination = destination
        self.freq = freq
        self.freq_corr = freq_corr
        self.gpredict_port = gpredict_port
        self.if_gain = if_gain
        self.offset = offset
        self.port = port
        self.rf_gain = rf_gain

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 192e3
        self.doppler_freq = doppler_freq = freq

        ##################################################
        # Blocks
        ##################################################
        self.gpredict_doppler_0 = gpredict.doppler(self.set_doppler_freq, "localhost", 4532, False)
        self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(4, (firdes.low_pass(1, samp_rate, 12000, 500)), doppler_freq-freq+offset, samp_rate)
        self.fcdproplus_fcdproplus_0 = fcdproplus.fcdproplus("",1)
        self.fcdproplus_fcdproplus_0.set_lna(0)
        self.fcdproplus_fcdproplus_0.set_mixer_gain(0)
        self.fcdproplus_fcdproplus_0.set_if_gain(0)
        self.fcdproplus_fcdproplus_0.set_freq_corr(0)
        self.fcdproplus_fcdproplus_0.set_freq(freq-offset)
          
        self.blocks_udp_sink_0 = blocks.udp_sink(gr.sizeof_short*1, destination, port, 1472, True)
        self.blocks_multiply_xx_0 = blocks.multiply_vcc(1)
        self.blocks_float_to_short_0 = blocks.float_to_short(1, 32767)
        self.blocks_complex_to_real_0 = blocks.complex_to_real(1)
        self.analog_sig_source_x_0 = analog.sig_source_c(48000, analog.GR_COS_WAVE, 12000, 1, 0)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_xx_0, 0))    
        self.connect((self.blocks_complex_to_real_0, 0), (self.blocks_float_to_short_0, 0))    
        self.connect((self.blocks_float_to_short_0, 0), (self.blocks_udp_sink_0, 0))    
        self.connect((self.blocks_multiply_xx_0, 0), (self.blocks_complex_to_real_0, 0))    
        self.connect((self.fcdproplus_fcdproplus_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0))    
        self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.blocks_multiply_xx_0, 1)) 
开发者ID:daniestevez,项目名称:gr-frontends,代码行数:51,代码来源:fcdpp_usb_wide.py

示例8: __init__

# 需要导入模块: from gnuradio import analog [as 别名]
# 或者: from gnuradio.analog import GR_COS_WAVE [as 别名]
def __init__(self, button_id=124, tone=1):
    gr.top_block.__init__(self, "Top Block")

    # RF Config
    samp_rate = 1e6
    gain = 50
    freq = 315e6

    # USRP
    self.usrp = uhd.usrp_sink("", uhd.stream_args("fc32"))
    self.usrp.set_samp_rate(samp_rate)
    self.usrp.set_center_freq(freq, 0)
    self.usrp.set_gain(gain, 0)
    self.usrp.set_antenna("TX/RX", 0)

    # Signal source
    self.tone = analog.sig_source_c(samp_rate, analog.GR_COS_WAVE, 1000, 1, 0)

    # Generate the bit 1 and bit 0 masks
    b0 = [0]*int(0.00028 * samp_rate) + [1]*int(0.00072 * samp_rate)
    b1 = [0]*int(0.00068 * samp_rate) + [1]*int(0.00032 * samp_rate)

    # Generate the packet mask
    id_bits = "{0:b}".format(button_id).zfill(8)[:8][::-1]
    tone_bits = "{0:b}".format(tone).zfill(4)[:4][::-1]
    packet_bits = '1' + id_bits + tone_bits
    mask = []
    for b in packet_bits:
      if b == '1':
        mask += b1
      else:
        mask += b0

    # Add some 0's to the end of the mask, because
    # the doorbell waits for a transmission to
    # finish before playing the tone
    mask += [0]*15000

    # Vector source w/ packet mask
    self.packet_mask = blocks.vector_source_c(mask, True, 1, [])

    # Multiply (mask * signal)
    self.multiply = blocks.multiply_vcc(1)

    # Connect the blocks
    self.connect((self.tone, 0), (self.multiply, 0))
    self.connect((self.packet_mask, 0), (self.multiply, 1))
    self.connect((self.multiply, 0), (self.usrp, 0)) 
开发者ID:BastilleResearch,项目名称:so-you-want-to-hack-radios,代码行数:50,代码来源:doorbell-transmitter.py

示例9: __init__

# 需要导入模块: from gnuradio import analog [as 别名]
# 或者: from gnuradio.analog import GR_COS_WAVE [as 别名]
def __init__(self):
        gr.top_block.__init__(self, "Top Block")

        ##################################################
        # Variables
        ##################################################
        self.sps = sps = 4
        self.samp_rate = samp_rate = 48000
        self.tx_freq = tx_freq = 2000
        self.interp = interp = int(samp_rate/31.25/sps)
        #mod
        self.message = str(sys.argv[1]) + "\n" #user message from command line parameter
        
        ##################################################
        # Blocks
        ##################################################
        self.rational_resampler_xxx_1_0 = filter.rational_resampler_fff(
                interpolation=48,
                decimation=1,
                taps=None,
                fractional_bw=None,
        )
        self.rational_resampler_xxx_1 = filter.rational_resampler_fff(
                interpolation=32,
                decimation=1,
                taps=([1]*32),
                fractional_bw=None,
        )
        self.psk31_varicode_enc_bb_0 = psk31.varicode_enc_bb()
        self.interp_fir_filter_xxx_0 = filter.interp_fir_filter_fff(1, ([math.sin(math.pi * t / 32) / 23.2 for t in xrange(32)]))
        self.interp_fir_filter_xxx_0.declare_sample_delay(0)
        self.digital_diff_encoder_bb_0 = digital.diff_encoder_bb(2)

        #mod
        self.blocks_vector_source_x_0 = blocks.vector_source_b(map(ord, self.message), True, 1, [])

        self.blocks_not_xx_0 = blocks.not_bb()
        self.blocks_multiply_xx_0_0 = blocks.multiply_vff(1)
        self.blocks_char_to_float_0 = blocks.char_to_float(1, 1.0/2)
        self.blocks_and_const_xx_0 = blocks.and_const_bb(1)
        self.blocks_add_const_vxx_0 = blocks.add_const_vff((-1, ))
        self.audio_sink_0_0 = audio.sink(samp_rate, "", True)
        self.analog_sig_source_x_0_0 = analog.sig_source_f(samp_rate, analog.GR_COS_WAVE, tx_freq, 1, 0)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.analog_sig_source_x_0_0, 0), (self.blocks_multiply_xx_0_0, 1))    
        self.connect((self.blocks_add_const_vxx_0, 0), (self.rational_resampler_xxx_1, 0))    
        self.connect((self.blocks_and_const_xx_0, 0), (self.digital_diff_encoder_bb_0, 0))    
        self.connect((self.blocks_char_to_float_0, 0), (self.blocks_add_const_vxx_0, 0))    
        self.connect((self.blocks_multiply_xx_0_0, 0), (self.audio_sink_0_0, 0))    
        self.connect((self.blocks_not_xx_0, 0), (self.blocks_and_const_xx_0, 0))    
        self.connect((self.blocks_vector_source_x_0, 0), (self.psk31_varicode_enc_bb_0, 0))    
        self.connect((self.digital_diff_encoder_bb_0, 0), (self.blocks_char_to_float_0, 0))    
        self.connect((self.interp_fir_filter_xxx_0, 0), (self.rational_resampler_xxx_1_0, 0))    
        self.connect((self.psk31_varicode_enc_bb_0, 0), (self.blocks_not_xx_0, 0))    
        self.connect((self.rational_resampler_xxx_1, 0), (self.interp_fir_filter_xxx_0, 0))    
        self.connect((self.rational_resampler_xxx_1_0, 0), (self.blocks_multiply_xx_0_0, 0)) 
开发者ID:0xsh,项目名称:Workshops,代码行数:61,代码来源:psk31_tx_no-gfx.py

示例10: __init__

# 需要导入模块: from gnuradio import analog [as 别名]
# 或者: from gnuradio.analog import GR_COS_WAVE [as 别名]
def __init__(self):
        gr.top_block.__init__(self, "Top Block")

        ##################################################
        # Variables
        ##################################################
        self.sps = sps = 4
        self.samp_rate = samp_rate = 48000
        self.tx_freq = tx_freq = 2000
        self.interp = interp = int(samp_rate/31.25/sps)

        ##################################################
        # Blocks
        ##################################################
        self.rational_resampler_xxx_1_0 = filter.rational_resampler_fff(
                interpolation=48,
                decimation=1,
                taps=None,
                fractional_bw=None,
        )
        self.rational_resampler_xxx_1 = filter.rational_resampler_fff(
                interpolation=32,
                decimation=1,
                taps=([1]*32),
                fractional_bw=None,
        )
        self.psk31_varicode_enc_bb_0 = psk31.varicode_enc_bb()
        self.interp_fir_filter_xxx_0 = filter.interp_fir_filter_fff(1, ([math.sin(math.pi * t / 32) / 23.2 for t in xrange(32)]))
        self.interp_fir_filter_xxx_0.declare_sample_delay(0)
        self.digital_diff_encoder_bb_0 = digital.diff_encoder_bb(2)
        self.blocks_vector_source_x_0 = blocks.vector_source_b(map(ord, 'Platypus\n'), True, 1, [])
        self.blocks_not_xx_0 = blocks.not_bb()
        self.blocks_multiply_xx_0_0 = blocks.multiply_vff(1)
        self.blocks_char_to_float_0 = blocks.char_to_float(1, 1.0/2)
        self.blocks_and_const_xx_0 = blocks.and_const_bb(1)
        self.blocks_add_const_vxx_0 = blocks.add_const_vff((-1, ))
        self.audio_sink_0_0 = audio.sink(samp_rate, "", True)
        self.analog_sig_source_x_0_0 = analog.sig_source_f(samp_rate, analog.GR_COS_WAVE, tx_freq, 1, 0)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.analog_sig_source_x_0_0, 0), (self.blocks_multiply_xx_0_0, 1))    
        self.connect((self.blocks_add_const_vxx_0, 0), (self.rational_resampler_xxx_1, 0))    
        self.connect((self.blocks_and_const_xx_0, 0), (self.digital_diff_encoder_bb_0, 0))    
        self.connect((self.blocks_char_to_float_0, 0), (self.blocks_add_const_vxx_0, 0))    
        self.connect((self.blocks_multiply_xx_0_0, 0), (self.audio_sink_0_0, 0))    
        self.connect((self.blocks_not_xx_0, 0), (self.blocks_and_const_xx_0, 0))    
        self.connect((self.blocks_vector_source_x_0, 0), (self.psk31_varicode_enc_bb_0, 0))    
        self.connect((self.digital_diff_encoder_bb_0, 0), (self.blocks_char_to_float_0, 0))    
        self.connect((self.interp_fir_filter_xxx_0, 0), (self.rational_resampler_xxx_1_0, 0))    
        self.connect((self.psk31_varicode_enc_bb_0, 0), (self.blocks_not_xx_0, 0))    
        self.connect((self.rational_resampler_xxx_1, 0), (self.interp_fir_filter_xxx_0, 0))    
        self.connect((self.rational_resampler_xxx_1_0, 0), (self.blocks_multiply_xx_0_0, 0)) 
开发者ID:0xsh,项目名称:Workshops,代码行数:56,代码来源:psk31_tx_no-gfx.py


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