def setup_scopes(self): #Input FFT if self.scopes.count("I"): self.input_fft_scope = fftsink2.fft_sink_c (self.panel, fft_size=1024, sample_rate=self.input_rate) self.connect(self.source, self.input_fft_scope) #Filter FFT if self.scopes.count("F"): self.filter_fft_scope = fftsink2.fft_sink_c (self.panel, fft_size=1024, sample_rate=self.input_rate) self.connect(self.filter, self.filter_fft_scope) #Burst Scope if self.scopes.count("b"): self.burst_scope = scopesink2.scope_sink_f(self.panel, sample_rate=self.gsm_symb_rate,v_scale=1) self.connect(self.v2s, self.burst_scope) #burst_f options if self.options.decoder.count("f"): if self.scopes.count("d"): self.demod_scope = scopesink2.scope_sink_f(self.panel, sample_rate=self.input_rate) self.connect(self.demod, self.demod_scope) if self.scopes.count("c"): #f_flowgraph self.clocked_scope = scopesink2.scope_sink_f(self.panel, sample_rate=self.gsm_symb_rate,v_scale=1) self.connect(self.clocker, self.clocked_scope)
def __init__(self, block, *args, **kwds): ui_frame.__init__(self, *args, **kwds) self.block = block self.freq_disp.SetRange(0, 30e6) f = self.block.src.freq self.freq_disp.SetValue(-f) self.volume.SetRange(0, 20) self.pga.SetRange(0, 20) self.rssi_range = 1 self.rssi.SetRange(self.rssi_range) self.agc_max.SetValue(str(self.rssi_range)) self.spin_e0.SetValue(50) self.spin_e1.SetValue(50) self.spin_e2.SetValue(50) self.spin_e3.SetValue(50) self.spin_e4.SetValue(50) self.spin_e5.SetValue(50) self.spin_e6.SetValue(50) bw = 3.3e3 self.bandwidth.SetValue(str(bw)) self.block.demod.set_bw(bw) self.bw_spin.SetValue(5) agc_gain = self.block.agc.gain.k() self.agc_gain_s.SetValue(5) self.agc_gain.SetValue(str(agc_gain)) agc_ref = self.block.agc.offs.k() self.agc_ref.SetValue(str(agc_ref)) self.agc_ref_s.SetValue(5) self.fespectrum = fftsink2.fft_sink_c( self.fe_panel, fft_size=512, sample_rate=block.fe_rate, ref_scale=1.0, ref_level=20.0, y_divs=12, avg_alpha=0.1, ) self.ifspectrum = fftsink2.fft_sink_c( self.if_panel, fft_size=512, sample_rate=block.audio_rate, ref_scale=1.0, ref_level=20.0, y_divs=12, avg_alpha=0.1, ) self.fespectrum.win.Bind(wx.EVT_MOTION, self.fe_mouse) self.fespectrum.win.Bind(wx.EVT_LEFT_DOWN, self.fe_click) block.connect(block.src.src, self.fespectrum) block.connect(block.demod.xlate, self.ifspectrum)
def __init__( self, block, *args, **kwds ): ui_frame.__init__( self, *args, **kwds ) self.block = block self.freq_disp.SetRange(0, 30e6) f = self.block.src.freq self.freq_disp.SetValue( -f ) self.volume.SetRange( 0, 20 ) self.pga.SetRange( 0, 20 ) self.rssi_range = 1 self.rssi.SetRange( self.rssi_range ) self.agc_max.SetValue( str( self.rssi_range ) ) self.spin_e0.SetValue( 50 ) self.spin_e1.SetValue( 50 ) self.spin_e2.SetValue( 50 ) self.spin_e3.SetValue( 50 ) self.spin_e4.SetValue( 50 ) self.spin_e5.SetValue( 50 ) self.spin_e6.SetValue( 50 ) bw = 3.3e3 self.bandwidth.SetValue( str( bw ) ) self.block.demod.set_bw( bw ) self.bw_spin.SetValue( 5 ) agc_gain = self.block.agc.gain.k() self.agc_gain_s.SetValue( 5 ) self.agc_gain.SetValue( str( agc_gain ) ) agc_ref = self.block.agc.offs.k() self.agc_ref.SetValue( str( agc_ref ) ) self.agc_ref_s.SetValue( 5 ) self.fespectrum = fftsink2.fft_sink_c( self.fe_panel, fft_size=512, sample_rate = block.fe_rate, ref_scale = 1.0, ref_level = 20.0, y_divs = 12, avg_alpha = 0.1) self.ifspectrum = fftsink2.fft_sink_c( self.if_panel, fft_size=512, sample_rate = block.audio_rate, ref_scale = 1.0, ref_level = 20.0, y_divs = 12, avg_alpha = 0.1) self.fespectrum.win.Bind( wx.EVT_MOTION, self.fe_mouse) self.fespectrum.win.Bind( wx.EVT_LEFT_DOWN, self.fe_click) block.connect( block.src.src, self.fespectrum ) block.connect( block.demod.xlate, self.ifspectrum )
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 1e6 self.freq = freq = 2e9 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=freq, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title='FFT Plot', peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.uhd_usrp_source_0 = uhd.usrp_source( ",".join(("", "")), uhd.stream_args( cpu_format="fc32", channels=range(1), ), ) self.uhd_usrp_source_0.set_samp_rate(samp_rate) self.uhd_usrp_source_0.set_center_freq(freq, 0) self.uhd_usrp_source_0.set_gain(10, 0) self.uhd_usrp_source_0.set_antenna('RX2', 0) self.fft_vxx_0 = fft.fft_vcc(1024, True, (window.blackmanharris(1024)), True, 1) self.blocks_stream_to_vector_0 = blocks.stream_to_vector( gr.sizeof_gr_complex * 1, 1024) self.blocks_file_sink_0 = blocks.file_sink(gr.sizeof_float * 1024, '/home/prabhat/a', False) self.blocks_file_sink_0.set_unbuffered(False) self.blocks_complex_to_mag_squared_0 = blocks.complex_to_mag_squared( 1024) ################################################## # Connections ################################################## self.connect((self.blocks_complex_to_mag_squared_0, 0), (self.blocks_file_sink_0, 0)) self.connect((self.blocks_stream_to_vector_0, 0), (self.fft_vxx_0, 0)) self.connect((self.fft_vxx_0, 0), (self.blocks_complex_to_mag_squared_0, 0)) self.connect((self.uhd_usrp_source_0, 0), (self.blocks_stream_to_vector_0, 0)) self.connect((self.uhd_usrp_source_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Vv034 Dtg016") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 8000000 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=429000000, y_per_div=20, y_divs=10, ref_level=10, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, size=(600,600), ) self.Add(self.wxgui_fftsink2_0.win) self.dvbt2_pilotgenerator_cc_0 = dvbt2.pilotgenerator_cc(dvbt2.CARRIERS_NORMAL, dvbt2.FFTSIZE_4K, dvbt2.PILOT_PP5, dvbt2.GI_1_16, 500, dvbt2.PAPR_OFF, dvbt2.VERSION_111, dvbt2.PREAMBLE_T2_SISO, dvbt2.MISO_TX1, dvbt2.EQUALIZATION_OFF, dvbt2.BANDWIDTH_1_7_MHZ, 4096) self.dvbt2_p1insertion_cc_0 = dvbt2.p1insertion_cc(dvbt2.CARRIERS_NORMAL, dvbt2.FFTSIZE_4K, dvbt2.GI_1_16, 500, dvbt2.PREAMBLE_T2_SISO, dvbt2.SHOWLEVELS_OFF, 3.3) self.dvbt2_modulator_bc_0 = dvbt2.modulator_bc(dvbt2.FECFRAME_SHORT, dvbt2.MOD_QPSK, dvbt2.ROTATION_ON) self.dvbt2_ldpc_bb_0 = dvbt2.ldpc_bb(dvbt2.FECFRAME_SHORT, dvbt2.C4_5) self.dvbt2_interleaver_bb_0 = dvbt2.interleaver_bb(dvbt2.FECFRAME_SHORT, dvbt2.C4_5, dvbt2.MOD_QPSK) self.dvbt2_freqinterleaver_cc_0 = dvbt2.freqinterleaver_cc(dvbt2.CARRIERS_NORMAL, dvbt2.FFTSIZE_4K, dvbt2.PILOT_PP5, dvbt2.GI_1_16, 500, dvbt2.PAPR_OFF, dvbt2.VERSION_111, dvbt2.PREAMBLE_T2_SISO, ) self.dvbt2_framemapper_cc_0 = dvbt2.framemapper_cc(dvbt2.FECFRAME_SHORT, dvbt2.C4_5, dvbt2.MOD_QPSK, dvbt2.ROTATION_ON, 204, 0, dvbt2.CARRIERS_NORMAL, dvbt2.FFTSIZE_4K, dvbt2.GI_1_16, dvbt2.L1_MOD_QPSK, dvbt2.PILOT_PP5, 2, 500, dvbt2.PAPR_OFF, dvbt2.VERSION_111, dvbt2.PREAMBLE_T2_SISO, dvbt2.INPUTMODE_NORMAL, dvbt2.RESERVED_OFF, dvbt2.L1_SCRAMBLED_OFF, dvbt2.INBAND_OFF) self.dvbt2_cellinterleaver_cc_0 = dvbt2.cellinterleaver_cc(dvbt2.FECFRAME_SHORT, dvbt2.MOD_QPSK, 204, 0) self.dvbt2_bch_bb_0 = dvbt2.bch_bb(dvbt2.FECFRAME_SHORT, dvbt2.C4_5) self.dvbt2_bbscrambler_bb_0 = dvbt2.bbscrambler_bb(dvbt2.FECFRAME_SHORT, dvbt2.C4_5) self.dvbt2_bbheader_bb_0 = dvbt2.bbheader_bb(dvbt2.FECFRAME_SHORT, dvbt2.C4_5, dvbt2.INPUTMODE_HIEFF, dvbt2.INBAND_OFF, 168, 4000000) self.digital_ofdm_cyclic_prefixer_0 = digital.ofdm_cyclic_prefixer(4096, 4096+4096/16, 0, "") self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True) self.blocks_file_source_0 = blocks.file_source(gr.sizeof_char*1, "/home/re/xfer/vv034.ts", True) ################################################## # Connections ################################################## self.connect((self.blocks_file_source_0, 0), (self.dvbt2_bbheader_bb_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.digital_ofdm_cyclic_prefixer_0, 0), (self.dvbt2_p1insertion_cc_0, 0)) self.connect((self.dvbt2_bbheader_bb_0, 0), (self.dvbt2_bbscrambler_bb_0, 0)) self.connect((self.dvbt2_bbscrambler_bb_0, 0), (self.dvbt2_bch_bb_0, 0)) self.connect((self.dvbt2_bch_bb_0, 0), (self.dvbt2_ldpc_bb_0, 0)) self.connect((self.dvbt2_cellinterleaver_cc_0, 0), (self.dvbt2_framemapper_cc_0, 0)) self.connect((self.dvbt2_framemapper_cc_0, 0), (self.dvbt2_freqinterleaver_cc_0, 0)) self.connect((self.dvbt2_freqinterleaver_cc_0, 0), (self.dvbt2_pilotgenerator_cc_0, 0)) self.connect((self.dvbt2_interleaver_bb_0, 0), (self.dvbt2_modulator_bc_0, 0)) self.connect((self.dvbt2_ldpc_bb_0, 0), (self.dvbt2_interleaver_bb_0, 0)) self.connect((self.dvbt2_modulator_bc_0, 0), (self.dvbt2_cellinterleaver_cc_0, 0)) self.connect((self.dvbt2_p1insertion_cc_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.dvbt2_pilotgenerator_cc_0, 0), (self.digital_ofdm_cyclic_prefixer_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Vv019 Norot") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 8000000 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=429000000, y_per_div=20, y_divs=10, ref_level=10, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, size=(600,600), ) self.Add(self.wxgui_fftsink2_0.win) self.dvbt2_pilotgenerator_cc_0 = dvbt2.pilotgenerator_cc(dvbt2.CARRIERS_EXTENDED, dvbt2.FFTSIZE_32K_T2GI, dvbt2.PILOT_PP7, dvbt2.GI_1_128, 59, dvbt2.PAPR_OFF, dvbt2.VERSION_111, dvbt2.PREAMBLE_T2_SISO, dvbt2.MISO_TX1, dvbt2.EQUALIZATION_OFF, dvbt2.BANDWIDTH_1_7_MHZ, 32768) self.dvbt2_p1insertion_cc_0 = dvbt2.p1insertion_cc(dvbt2.CARRIERS_EXTENDED, dvbt2.FFTSIZE_32K_T2GI, dvbt2.GI_1_128, 59, dvbt2.PREAMBLE_T2_SISO, dvbt2.SHOWLEVELS_OFF, 3.3) self.dvbt2_modulator_bc_0 = dvbt2.modulator_bc(dvbt2.FECFRAME_NORMAL, dvbt2.MOD_256QAM, dvbt2.ROTATION_OFF) self.dvbt2_ldpc_bb_0 = dvbt2.ldpc_bb(dvbt2.FECFRAME_NORMAL, dvbt2.C3_5) self.dvbt2_interleaver_bb_0 = dvbt2.interleaver_bb(dvbt2.FECFRAME_NORMAL, dvbt2.C3_5, dvbt2.MOD_256QAM) self.dvbt2_freqinterleaver_cc_0 = dvbt2.freqinterleaver_cc(dvbt2.CARRIERS_EXTENDED, dvbt2.FFTSIZE_32K_T2GI, dvbt2.PILOT_PP7, dvbt2.GI_1_128, 59, dvbt2.PAPR_OFF, dvbt2.VERSION_111, dvbt2.PREAMBLE_T2_SISO, ) self.dvbt2_framemapper_cc_0 = dvbt2.framemapper_cc(dvbt2.FECFRAME_NORMAL, dvbt2.C3_5, dvbt2.MOD_256QAM, dvbt2.ROTATION_OFF, 202, 3, dvbt2.CARRIERS_EXTENDED, dvbt2.FFTSIZE_32K_T2GI, dvbt2.GI_1_128, dvbt2.L1_MOD_64QAM, dvbt2.PILOT_PP7, 2, 59, dvbt2.PAPR_OFF, dvbt2.VERSION_111, dvbt2.PREAMBLE_T2_SISO, dvbt2.INPUTMODE_NORMAL, dvbt2.RESERVED_OFF, dvbt2.L1_SCRAMBLED_OFF, dvbt2.INBAND_OFF) self.dvbt2_cellinterleaver_cc_0 = dvbt2.cellinterleaver_cc(dvbt2.FECFRAME_NORMAL, dvbt2.MOD_256QAM, 202, 3) self.dvbt2_bch_bb_0 = dvbt2.bch_bb(dvbt2.FECFRAME_NORMAL, dvbt2.C3_5) self.dvbt2_bbscrambler_bb_0 = dvbt2.bbscrambler_bb(dvbt2.FECFRAME_NORMAL, dvbt2.C3_5) self.dvbt2_bbheader_bb_0 = dvbt2.bbheader_bb(dvbt2.FECFRAME_NORMAL, dvbt2.C3_5, dvbt2.INPUTMODE_HIEFF, dvbt2.INBAND_OFF, 168, 4000000) self.digital_ofdm_cyclic_prefixer_0 = digital.ofdm_cyclic_prefixer(32768, 32768+32768/128, 0, "") self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True) self.blocks_file_source_0 = blocks.file_source(gr.sizeof_char*1, "/home/re/xfer/vv019.ts", True) ################################################## # Connections ################################################## self.connect((self.blocks_file_source_0, 0), (self.dvbt2_bbheader_bb_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.digital_ofdm_cyclic_prefixer_0, 0), (self.dvbt2_p1insertion_cc_0, 0)) self.connect((self.dvbt2_bbheader_bb_0, 0), (self.dvbt2_bbscrambler_bb_0, 0)) self.connect((self.dvbt2_bbscrambler_bb_0, 0), (self.dvbt2_bch_bb_0, 0)) self.connect((self.dvbt2_bch_bb_0, 0), (self.dvbt2_ldpc_bb_0, 0)) self.connect((self.dvbt2_cellinterleaver_cc_0, 0), (self.dvbt2_framemapper_cc_0, 0)) self.connect((self.dvbt2_framemapper_cc_0, 0), (self.dvbt2_freqinterleaver_cc_0, 0)) self.connect((self.dvbt2_freqinterleaver_cc_0, 0), (self.dvbt2_pilotgenerator_cc_0, 0)) self.connect((self.dvbt2_interleaver_bb_0, 0), (self.dvbt2_modulator_bc_0, 0)) self.connect((self.dvbt2_ldpc_bb_0, 0), (self.dvbt2_interleaver_bb_0, 0)) self.connect((self.dvbt2_modulator_bc_0, 0), (self.dvbt2_cellinterleaver_cc_0, 0)) self.connect((self.dvbt2_p1insertion_cc_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.dvbt2_pilotgenerator_cc_0, 0), (self.digital_ofdm_cyclic_prefixer_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Gmsk Record") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.target_freq = target_freq = 871.75e6 self.channel_wigth = channel_wigth = 2e6 self.samp_rate = samp_rate = 10e6 self.center_freq = center_freq = target_freq-channel_wigth ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=center_freq, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate/2, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + "" ) self.osmosdr_source_0.set_sample_rate(samp_rate) self.osmosdr_source_0.set_center_freq(center_freq, 0) self.osmosdr_source_0.set_freq_corr(0, 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(10, 0) self.osmosdr_source_0.set_if_gain(20, 0) self.osmosdr_source_0.set_bb_gain(20, 0) self.osmosdr_source_0.set_antenna("", 0) self.osmosdr_source_0.set_bandwidth(0, 0) self.low_pass_filter_0 = filter.fir_filter_ccf(2, firdes.low_pass( 1, samp_rate, 1e6, 1.5e6, firdes.WIN_HAMMING, 6.76)) self.blocks_multiply_xx_0 = blocks.multiply_vcc(1) self.blocks_file_sink_0 = blocks.file_sink(gr.sizeof_gr_complex*1, "/home/twilight/GMSK_test/GMSK_data_record.raw", False) self.blocks_file_sink_0.set_unbuffered(False) self.analog_sig_source_x_0 = analog.sig_source_c(samp_rate, analog.GR_COS_WAVE, -channel_wigth, 1, 0) ################################################## # Connections ################################################## self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_xx_0, 1)) self.connect((self.blocks_multiply_xx_0, 0), (self.low_pass_filter_0, 0)) self.connect((self.low_pass_filter_0, 0), (self.blocks_file_sink_0, 0)) self.connect((self.low_pass_filter_0, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.osmosdr_source_0, 0), (self.blocks_multiply_xx_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Read File Source") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 256000 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title='FFT Plot', peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True) self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, '/Users/ampoulog/Documents/gnuradio/Wireless-communication-systems-Lab/Lab2/example7/ssb_lsb_256k_complex2.dat', True) ################################################## # Connections ################################################## self.connect((self.blocks_file_source_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__( self, title="CPFSK High rate", ) self.samp_rate = samp_rate = 32000 self.gr_cpfsk_bc_0 = gr.cpfsk_bc(1, 1, 2) self.random_source_x_0 = gr.vector_source_b( numpy.random.randint(0, 2, 1000), True) self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, ref_level=50, sample_rate=samp_rate, fft_size=1024, fft_rate=30, average=False, avg_alpha=None, title="CPFSK high rate FFT", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.connect((self.gr_cpfsk_bc_0, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.random_source_x_0, 0), (self.gr_cpfsk_bc_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 20e6 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=580.5 * 10e6, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex * 1, "/home/furonics/GNURadio/test", False) ################################################## # Connections ################################################## self.connect((self.blocks_file_source_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self,options): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) #CHANGE ME self.cog_phy_0=phy.cog_phy(options.args) # dest_addt,source_addr,max_attempts,time_out #self.probe_0=probe.probe(0,1) self.probe_0=gr.probe_avg_mag_sqrd_c(-30) #self.ss_chain_0=spectrum_sense.pwrfft_c(200e3,1024,25,) self.mac_0=csma.csma_mac(options.dest_addr,options.source_addr,options.max_attempts,options.time_out,0.05,0.0001,10000,self.probe_0,1e-6) self.wake_up=heart_beat.heart_beat("check","wake_up",0.001) #CHANGE ME print options.input_file self.gr_file_source_0 = gr.file_source(gr.sizeof_char*1,options.input_file, True) #CHANGE ME self.gr_file_sink_0 = gr.file_sink(gr.sizeof_char*1, options.output_file) self.gr_file_sink_0.set_unbuffered(True) self.extras_stream_to_datagram_0 = grextras.Stream2Datagram(1, options.pkt_size) self.extras_datagram_to_stream_0 = grextras.Datagram2Stream(1) self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=990e6, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=1e6, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot of source usrp", peak_hold=True, ) #self.Add(self.wxgui_fftsink2_0.win) #self.tags_d_0=tags_demo.tags_demo() #self.extras_stream_to_datagram_1 = grextras.Stream2Datagram(1, 256) #self.extras_datagram_to_stream_1 = grextras.Datagram2Stream(1) ################################################## # Connections ################################################## self.connect((self.gr_file_source_0, 0), (self.extras_stream_to_datagram_0, 0)) self.connect((self.extras_stream_to_datagram_0,0),(self.mac_0,1)) self.connect((self.cog_phy_0,0),(self.mac_0,0)) self.connect((self.mac_0,0),(self.cog_phy_0,0)) self.connect((self.mac_0,1),(self.extras_datagram_to_stream_0,0)) self.connect((self.extras_datagram_to_stream_0,0),(self.gr_file_sink_0,0)) #self.connect((self.cog_phy_0,1),(self.wxgui_fftsink2_0,0)) self.connect((self.wake_up,0),(self.mac_0,2)) #self.connect((self.cog_phy_0,1),(self.mac_0,3)) self.connect((self.cog_phy_0,1),(self.probe_0,0)) """self.connect((self.gr_file_source_1, 0), (self.extras_stream_to_datagram_1, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 1E6 ################################################## # Blocks ################################################## self.wxgui_scopesink2_0 = scopesink2.scope_sink_c( self.GetWin(), title="Scope Plot", sample_rate=samp_rate, v_scale=0, v_offset=0, t_scale=0, ac_couple=False, xy_mode=False, num_inputs=1, trig_mode=wxgui.TRIG_MODE_AUTO, y_axis_label="Counts", ) self.Add(self.wxgui_scopesink2_0.win) self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.uhd_usrp_source_0 = uhd.usrp_source( ",".join(("", "")), uhd.stream_args( cpu_format="fc32", channels=range(1), ), ) self.uhd_usrp_source_0.set_samp_rate(samp_rate) self.uhd_usrp_source_0.set_center_freq(1360.25E6, 0) self.uhd_usrp_source_0.set_gain(10, 0) self.uhd_usrp_source_0.set_antenna("TX/RX", 0) ################################################## # Connections ################################################## self.connect((self.uhd_usrp_source_0, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.uhd_usrp_source_0, 0), (self.wxgui_scopesink2_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Irec2018 Gr") ################################################## # Variables ################################################## self.spread = spread = 7 self.samp_rate = samp_rate = 1e6 self.offset = offset = 0 self.capture_freq = capture_freq = 915e6 self.bandwidth = bandwidth = 125000 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=capture_freq, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=30, average=False, avg_alpha=None, title='FFT Plot', peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.rtlsdr_source_0 = osmosdr.source(args="numchan=" + str(1) + " " + '') self.rtlsdr_source_0.set_sample_rate(samp_rate) self.rtlsdr_source_0.set_center_freq(capture_freq, 0) self.rtlsdr_source_0.set_freq_corr(0, 0) self.rtlsdr_source_0.set_dc_offset_mode(0, 0) self.rtlsdr_source_0.set_iq_balance_mode(0, 0) self.rtlsdr_source_0.set_gain_mode(False, 0) self.rtlsdr_source_0.set_gain(10, 0) self.rtlsdr_source_0.set_if_gain(20, 0) self.rtlsdr_source_0.set_bb_gain(20, 0) self.rtlsdr_source_0.set_antenna('', 0) self.rtlsdr_source_0.set_bandwidth(0, 0) self.lora_message_socket_sink_0 = lora.message_socket_sink( '127.0.0.1', 40868, 0) self.lora_lora_receiver_0 = lora.lora_receiver( samp_rate, capture_freq, (capture_freq + offset, ), bandwidth, spread, False, 4, True, False, False, 1, False, False) ################################################## # Connections ################################################## self.msg_connect((self.lora_lora_receiver_0, 'frames'), (self.lora_message_socket_sink_0, 'in')) self.connect((self.rtlsdr_source_0, 0), (self.lora_lora_receiver_0, 0)) self.connect((self.rtlsdr_source_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Lora Receive Realtime") ################################################## # Variables ################################################## self.sf = sf = 11 self.samp_rate = samp_rate = 1e6 self.bw = bw = 125000 self.target_freq = target_freq = 916.8e6 self.symbols_per_sec = symbols_per_sec = float(bw) / (2**sf) self.firdes_tap = firdes_tap = firdes.low_pass(1, samp_rate, bw, 10000, firdes.WIN_HAMMING, 6.67) self.downlink = downlink = False self.decimation = decimation = 1 self.capture_freq = capture_freq = 916e6 self.bitrate = bitrate = sf * (1 / (2**sf / float(bw))) ################################################## # Blocks ################################################## self.wxgui_fftsink2_1 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=capture_freq, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title='FFT Plot', peak_hold=False, ) self.Add(self.wxgui_fftsink2_1.win) self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + '' ) self.osmosdr_source_0.set_sample_rate(samp_rate) self.osmosdr_source_0.set_center_freq(capture_freq, 0) self.osmosdr_source_0.set_freq_corr(0, 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(10, 0) self.osmosdr_source_0.set_if_gain(20, 0) self.osmosdr_source_0.set_bb_gain(20, 0) self.osmosdr_source_0.set_antenna('', 0) self.osmosdr_source_0.set_bandwidth(0, 0) self.lora_message_socket_sink_0 = lora.message_socket_sink('127.0.0.1', 40868, 0) self.lora_lora_receiver_0 = lora.lora_receiver(1e6, capture_freq, ([target_freq]), bw, sf, False, 4, True, False, downlink, decimation, False, False) ################################################## # Connections ################################################## self.msg_connect((self.lora_lora_receiver_0, 'frames'), (self.lora_message_socket_sink_0, 'in')) self.connect((self.osmosdr_source_0, 0), (self.lora_lora_receiver_0, 0)) self.connect((self.osmosdr_source_0, 0), (self.wxgui_fftsink2_1, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Lora Receive Realtime") ################################################## # Variables ################################################## self.sf = sf = 11 self.samp_rate = samp_rate = 1e6 self.bw = bw = 125000 self.target_freq = target_freq = 868.1e6 self.symbols_per_sec = symbols_per_sec = float(bw) / (2**sf) self.firdes_tap = firdes_tap = firdes.low_pass(1, samp_rate, bw, 10000, firdes.WIN_HAMMING, 6.67) self.downlink = downlink = False self.decimation = decimation = 1 self.capture_freq = capture_freq = 868e6 self.bitrate = bitrate = sf * (1 / (2**sf / float(bw))) ################################################## # Blocks ################################################## self.wxgui_fftsink2_1 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=capture_freq, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title='FFT Plot', peak_hold=False, ) self.Add(self.wxgui_fftsink2_1.win) self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + '' ) self.osmosdr_source_0.set_sample_rate(samp_rate) self.osmosdr_source_0.set_center_freq(capture_freq, 0) self.osmosdr_source_0.set_freq_corr(0, 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(10, 0) self.osmosdr_source_0.set_if_gain(20, 0) self.osmosdr_source_0.set_bb_gain(20, 0) self.osmosdr_source_0.set_antenna('', 0) self.osmosdr_source_0.set_bandwidth(0, 0) self.lora_message_socket_sink_0 = lora.message_socket_sink('127.0.0.1', 40868, 0) self.lora_lora_receiver_0 = lora.lora_receiver(1e6, capture_freq, ([target_freq]), bw, sf, False, 4, True, False, downlink, decimation, False, False) ################################################## # Connections ################################################## self.msg_connect((self.lora_lora_receiver_0, 'frames'), (self.lora_message_socket_sink_0, 'in')) self.connect((self.osmosdr_source_0, 0), (self.lora_lora_receiver_0, 0)) self.connect((self.osmosdr_source_0, 0), (self.wxgui_fftsink2_1, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 100000 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate * 10, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.uhd_usrp_source_0 = uhd.usrp_source( device_addr="addr0=192.168.10.2,addr1=192.168.10.3", stream_args=uhd.stream_args( cpu_format="fc32", channels=range(2), ), ) self.uhd_usrp_source_0.set_clock_source("mimo", 1) self.uhd_usrp_source_0.set_time_source("mimo", 1) self.uhd_usrp_source_0.set_samp_rate(samp_rate) self.uhd_usrp_source_0.set_center_freq(4.9e9 + 20000, 0) self.uhd_usrp_source_0.set_gain(15, 0) self.uhd_usrp_source_0.set_center_freq(4.9e9 + 20000, 1) self.uhd_usrp_source_0.set_gain(15, 1) self.gr_file_sink_0_0 = gr.file_sink( gr.sizeof_gr_complex * 1, "/home/sdruser/COLLINS/Pre/UChannel2_S.txt") self.gr_file_sink_0_0.set_unbuffered(False) self.gr_file_sink_0 = gr.file_sink( gr.sizeof_gr_complex * 1, "/home/sdruser/COLLINS/Pre/UChannel1_S.txt") self.gr_file_sink_0.set_unbuffered(False) ################################################## # Connections ################################################## self.connect((self.uhd_usrp_source_0, 0), (self.gr_file_sink_0, 0)) self.connect((self.uhd_usrp_source_0, 1), (self.gr_file_sink_0_0, 0)) self.connect((self.uhd_usrp_source_0, 1), (self.wxgui_fftsink2_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Exploit Pack - RF Hacking") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 2e6 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title='Exploit Pack - Repeat RF', peak_hold=False, win=window.blackmanharris, ) self.Add(self.wxgui_fftsink2_0.win) 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(27e6, 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(20, 0) self.osmosdr_sink_0.set_antenna('', 0) self.osmosdr_sink_0.set_bandwidth(0, 0) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1, samp_rate, True) self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vcc((6, )) self.blocks_file_source_0 = blocks.file_source( gr.sizeof_gr_complex * 1, '/tmp/saveRF', True) ################################################## # Connections ################################################## self.connect((self.blocks_file_source_0, 0), (self.blocks_multiply_const_vxx_0, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.osmosdr_sink_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Gr Lora Receive") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 1e6 self.offset = offset = -26e3 self.lora_sf = lora_sf = 7 self.freq = freq = 868.1e6 self.ch_freq = ch_freq = 868e6 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=freq, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=True, avg_alpha=None, title="FFT Plot", peak_hold=True, ) self.Add(self.wxgui_fftsink2_0.win) def wxgui_fftsink2_0_callback(x, y): self.set_freq(x) self.wxgui_fftsink2_0.set_callback(wxgui_fftsink2_0_callback) self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + "" ) self.osmosdr_source_0.set_sample_rate(samp_rate) self.osmosdr_source_0.set_center_freq(ch_freq, 0) self.osmosdr_source_0.set_freq_corr(0, 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(0, 0) self.osmosdr_source_0.set_if_gain(20, 0) self.osmosdr_source_0.set_bb_gain(20, 0) self.osmosdr_source_0.set_antenna("", 0) self.osmosdr_source_0.set_bandwidth(0, 0) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True) ################################################## # Connections ################################################## self.connect((self.blocks_throttle_0, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.osmosdr_source_0, 0), (self.blocks_throttle_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.tx_signal_dat = tx_signal_dat = "/home/uone/gnuradio/gnuradioworkspace/BackChannel/dataSet/sending/waveform_fsk" self.tx_ip_rx = tx_ip_rx = "192.168.10.2" self.samp_rate = samp_rate = 20e6 self.rx_signal_dat = rx_signal_dat = "/home/uone/gnuradio/gnuradioworkspace/BackChannel/dataSet/receiving/waveform_rec_fsk" self.payloadSize = payloadSize = 100 self.extra_notation = extra_notation = "_85db_" self.CarrierFreq = CarrierFreq = 1.5e9 self.BandWidth = BandWidth = 40e6 ################################################## # Blocks ################################################## self.wxgui_fftsink2_1 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title='FFT Plot', peak_hold=False, ) self.Add(self.wxgui_fftsink2_1.win) self.uhd_usrp_source_0 = uhd.usrp_source( ",".join(("", "")), uhd.stream_args( cpu_format="fc32", channels=range(1), ), ) self.uhd_usrp_source_0.set_samp_rate(samp_rate) self.uhd_usrp_source_0.set_center_freq(CarrierFreq, 0) self.uhd_usrp_source_0.set_gain(30, 0) self.uhd_usrp_source_0.set_antenna('RX2', 0) self.uhd_usrp_source_0.set_bandwidth(BandWidth, 0) self.file_sink = blocks.file_sink(gr.sizeof_gr_complex*1, rx_signal_dat+"_"+str(payloadSize)+extra_notation+".dat", False) self.file_sink.set_unbuffered(False) ################################################## # Connections ################################################## self.connect((self.uhd_usrp_source_0, 0), (self.file_sink, 0)) self.connect((self.uhd_usrp_source_0, 0), (self.wxgui_fftsink2_1, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="FHSS transmit") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_sym = samp_sym = 64 self.samp_rate = samp_rate = 400e3 self.registers = registers = 3 self.init = init = 1, 1, 1, 1 self.generator = generator = 1, 1, 0, 0, 1 self.code_rate = code_rate = int(samp_sym * 500) ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.uhd_usrp_sink_0 = uhd.usrp_sink( ",".join(("dev_addr=192.168.10.2", "")), uhd.stream_args( cpu_format="fc32", channels=range(1), ), ) self.uhd_usrp_sink_0.set_samp_rate(samp_rate) self.uhd_usrp_sink_0.set_center_freq(2.45e9, 0) self.uhd_usrp_sink_0.set_gain(30, 0) self.uhd_usrp_sink_0.set_antenna("TX/RX", 0) self.blocks_vector_source_x_0 = blocks.vector_source_b((0, 1, 0, 1), True, 1, []) self.Spread_synthesizer_0 = Spread.synthesizer(code_rate, 9000, samp_rate, (generator), (init)) self.Spread_cpfsk_mod_0 = Spread.cpfsk_mod(samp_sym) ################################################## # Connections ################################################## self.connect((self.Spread_cpfsk_mod_0, 0), (self.Spread_synthesizer_0, 0)) self.connect((self.Spread_synthesizer_0, 0), (self.uhd_usrp_sink_0, 0)) self.connect((self.Spread_synthesizer_0, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.blocks_vector_source_x_0, 0), (self.Spread_cpfsk_mod_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 25000000 self.dec_rate = dec_rate = 25 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate/dec_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.gr_unpacked_to_packed_xx_0 = gr.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST) self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex*1, samp_rate) self.gr_freq_xlating_fir_filter_xxx_0 = gr.freq_xlating_fir_filter_ccc(dec_rate, (firdes.low_pass(1,samp_rate,1000000,100000)), -1000000, samp_rate) self.gr_file_source_0 = gr.file_source(gr.sizeof_gr_complex*1, "/shampoo/sdr/capture/j9Pro-capture/2400000000-25M-1.cap", False) self.gr_file_sink_0_0 = gr.file_sink(gr.sizeof_char*1, "/shampoo/sdr/projects/gr-nineeagles/gmsk-packed.out") self.gr_file_sink_0_0.set_unbuffered(False) self.gr_file_sink_0 = gr.file_sink(gr.sizeof_char*1, "/shampoo/sdr/projects/gr-nineeagles/gmsk-unpacked.out") self.gr_file_sink_0.set_unbuffered(False) self.digital_gmsk_demod_0 = digital.gmsk_demod( samples_per_symbol=2, gain_mu=0.175, mu=0.5, omega_relative_limit=0.005, freq_error=0.0, verbose=False, log=False, ) ################################################## # Connections ################################################## self.connect((self.gr_file_source_0, 0), (self.gr_throttle_0, 0)) self.connect((self.gr_unpacked_to_packed_xx_0, 0), (self.gr_file_sink_0_0, 0)) self.connect((self.digital_gmsk_demod_0, 0), (self.gr_file_sink_0, 0)) self.connect((self.digital_gmsk_demod_0, 0), (self.gr_unpacked_to_packed_xx_0, 0)) self.connect((self.gr_freq_xlating_fir_filter_xxx_0, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.gr_throttle_0, 0), (self.gr_freq_xlating_fir_filter_xxx_0, 0)) self.connect((self.gr_freq_xlating_fir_filter_xxx_0, 0), (self.digital_gmsk_demod_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Simple test for funcube") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 192000 ################################################## # Blocks ################################################## self.wxgui_waterfallsink2_0 = waterfallsink2.waterfall_sink_c( self.GetWin(), baseband_freq=0, dynamic_range=100, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=512, fft_rate=15, average=False, avg_alpha=None, title="Waterfall Plot", ) self.Add(self.wxgui_waterfallsink2_0.win) self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.fcd_source_c_0 = fcd.source_c("hw:1") self.fcd_source_c_0.set_freq(145500000) self.audio_sink_0 = audio.sink(48000, "", True) self.analog_wfm_rcv_0 = analog.wfm_rcv(quad_rate=192000, audio_decimation=4) ################################################## # Connections ################################################## self.connect((self.fcd_source_c_0, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.fcd_source_c_0, 0), (self.wxgui_waterfallsink2_0, 0)) self.connect((self.fcd_source_c_0, 0), (self.analog_wfm_rcv_0, 0)) self.connect((self.analog_wfm_rcv_0, 0), (self.audio_sink_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Lime Auto Fast") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 50e3 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title='FFT Plot', peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.limesdr_source_0 = limesdr.source('', 0, '') self.limesdr_source_0.set_sample_rate(samp_rate) self.limesdr_source_0.set_center_freq(393.5e6, 0) self.limesdr_source_0.set_bandwidth(5e6, 0) self.limesdr_source_0.set_gain(39, 0) self.limesdr_source_0.set_antenna(3, 0) self.limesdr_source_0.calibrate(5e6, 0) self.facsink_0 = facsink.fac_sink_c( self.GetWin(), title='Fast AutoCorrelation', sample_rate=samp_rate, baseband_freq=0, y_per_div=5, ref_level=-40, fac_size=65536, fac_rate=facsink.default_fac_rate, average=True, avg_alpha=0.3, peak_hold=True, ) self.Add(self.facsink_0.win) ################################################## # Connections ################################################## self.connect((self.limesdr_source_0, 0), (self.facsink_0, 0)) self.connect((self.limesdr_source_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Grlora Rtlsdr") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 1e6 self.offset = offset = -26e3 self.capture_freq = capture_freq = 868e6 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=capture_freq, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title='FFT Plot', peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.rtlsdr_source_0 = osmosdr.source(args="numchan=" + str(1) + " " + '') self.rtlsdr_source_0.set_sample_rate(samp_rate) self.rtlsdr_source_0.set_center_freq(capture_freq, 0) self.rtlsdr_source_0.set_freq_corr(0, 0) self.rtlsdr_source_0.set_dc_offset_mode(0, 0) self.rtlsdr_source_0.set_iq_balance_mode(0, 0) self.rtlsdr_source_0.set_gain_mode(False, 0) self.rtlsdr_source_0.set_gain(10, 0) self.rtlsdr_source_0.set_if_gain(20, 0) self.rtlsdr_source_0.set_bb_gain(20, 0) self.rtlsdr_source_0.set_antenna('', 0) self.rtlsdr_source_0.set_bandwidth(0, 0) self.lora_message_socket_sink_0 = lora.message_socket_sink() self.lora_lora_receiver_0 = lora.lora_receiver(1e6, capture_freq, ([868.1e6 + offset]), 7, 1000000, 0.002) ################################################## # Connections ################################################## self.msg_connect((self.lora_lora_receiver_0, 'frames'), (self.lora_message_socket_sink_0, 'in')) self.connect((self.rtlsdr_source_0, 0), (self.lora_lora_receiver_0, 0)) self.connect((self.rtlsdr_source_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="My Second Msg Block") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 25e6 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.usrp_source = uhd.usrp_source( device_addr="", stream_args=uhd.stream_args( cpu_format="fc32", channels=range(1), ), ) self.usrp_source.set_samp_rate(samp_rate) self.usrp_source.set_center_freq(105e6, 0) self.usrp_source.set_gain(15, 0) self.usrp_source.set_antenna("RX2", 0) self.my_second_msg_block_0 = dt.my_second_msg_block( "95e6,605e6,915e6,880e6,1986e6") self.heart_beat_0_0 = precog.heart_beat(5, "hello", "world") self.heart_beat_0 = precog.heart_beat(1, "hello", "world") self.gr_null_sink_0 = gr.null_sink(gr.sizeof_char * 1) self.extras_pmt_rpc_0 = gr_extras.pmt_rpc(obj=self, result_msg=False) ################################################## # Connections ################################################## self.connect((self.heart_beat_0, 0), (self.my_second_msg_block_0, 0)) self.connect((self.heart_beat_0_0, 0), (self.my_second_msg_block_0, 1)) self.connect((self.my_second_msg_block_0, 1), (self.extras_pmt_rpc_0, 0)) self.connect((self.usrp_source, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.my_second_msg_block_0, 0), (self.gr_null_sink_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 5e6 self.center_freq2 = center_freq2 = 10e6 self.center_freq = center_freq = 1.57542e09 self.Gain3 = Gain3 = 26 self.Gain2 = Gain2 = 60 self.Gain1 = Gain1 = 60 self.BW = BW = 1.023e6 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.uhd_usrp_source_0 = uhd.usrp_source( "addr0=192.168.10.2", uhd.stream_args( cpu_format="fc32", channels=range(1), ), ) self.uhd_usrp_source_0.set_clock_source("gpsdo", 0) self.uhd_usrp_source_0.set_time_source("gpsdo", 0) self.uhd_usrp_source_0.set_samp_rate(samp_rate) self.uhd_usrp_source_0.set_center_freq(center_freq, 0) self.uhd_usrp_source_0.set_gain(60, 0) self.uhd_usrp_source_0.set_antenna("RX2", 0) self.uhd_usrp_source_0.set_bandwidth(BW, 0) ################################################## # Connections ################################################## self.connect((self.uhd_usrp_source_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self, win, sat_name, mode_name, sample_rate, frequency_offset, filename_raw, frequency, line1, line2, lat, lon, alt, when): gr.hier_block2.__init__(self, "Channel "+str(sat_name), gr.io_signature(1, 1, gr.sizeof_gr_complex), gr.io_signature(1, 1, gr.sizeof_gr_complex)) self.sample_rate = sample_rate self.freq_offset = frequency_offset self.fine_freq_offset = 0.0 self.fname = filename_raw self.decim = 8 if isinstance(when, dict): when = datetime.datetime(when['year'], when['month'], when['day'], when['hour'], when['minute'], when['second'], when['microsecond']) self.dop = doppler.doppler_c(line1, line2, frequency, self.sample_rate / self.decim, lat, lon, alt/1000.0, when.year, when.month, when.day, when.hour, when.minute, when.second, when.microsecond) self.mult2 = blocks.multiply_vcc(1) self.wxgui_fftsink0 = fftsink2.fft_sink_c( win, baseband_freq=0, y_per_div=5, y_divs=10, ref_level=-35, ref_scale=2.0, sample_rate=self.sample_rate/(self.decim), fft_size=1024, fft_rate=15, average=True, avg_alpha=None, title="FFT Plot (Downsampled - "+sat_name+" "+str(mode_name)+")", peak_hold=True, ) self.low_pass_filter = filter.fir_filter_ccf(self.decim, filter.firdes.low_pass(1, sample_rate, 120000, 5000, filter.firdes.WIN_HAMMING, 6.76)) self.sig_source = analog.sig_source_c(sample_rate, analog.GR_COS_WAVE, -(self.freq_offset + self.fine_freq_offset), 1, 0) self.mult1 = blocks.multiply_vcc(1) self.file_sink_raw = blocks.file_sink(gr.sizeof_gr_complex*1, str(filename_raw)) self.file_sink_raw.set_unbuffered(False) self.connect(self, (self.mult1, 0)) self.connect((self.sig_source, 0), (self.mult1, 1)) self.connect((self.mult1, 0), (self.low_pass_filter, 0)) self.connect((self.low_pass_filter, 0), (self.mult2, 0)) self.connect((self.dop, 0), (self.mult2, 1)) self.connect((self.mult2, 0), (self.file_sink_raw, 0)) self.connect((self.mult2, 0), (self.wxgui_fftsink0, 0)) self.connect((self.mult2, 0), self)
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Lora Receive File") ################################################## # Variables ################################################## self.sf = sf = 7 self.samp_rate = samp_rate = 10e6 self.bw = bw = 200e3 self.target_freq = target_freq = 902499999.999999 self.symbols_per_sec = symbols_per_sec = bw / (2**sf) self.firdes_tap = firdes_tap = firdes.low_pass(1, samp_rate, bw, 10000, firdes.WIN_HAMMING, 6.67) self.capture_freq = capture_freq = 902499999.999999 self.bitrate = bitrate = sf * (1 / (2**sf / bw)) ################################################## # Blocks ################################################## self.wxgui_fftsink2_1 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=capture_freq, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title='FFT Plot', peak_hold=False, ) self.Add(self.wxgui_fftsink2_1.win) self.lora_lora_receiver_0 = lora.lora_receiver(10e6, capture_freq, ([target_freq]), 7, 1000000, 0.01) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1, samp_rate, True) self.blocks_file_source_0 = blocks.file_source( gr.sizeof_gr_complex * 1, '/home/dell/Downloads/lora-04-100.dat', False) self.blocks_file_source_0.set_begin_tag(pmt.PMT_NIL) ################################################## # Connections ################################################## self.connect((self.blocks_file_source_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.lora_lora_receiver_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.wxgui_fftsink2_1, 0))
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) self.frame = frame self.panel = panel options = get_options() sample_rate = int(options.sample_rate) self.asrc = audio.source(sample_rate, options.audio_device, True) self.f2c = blocks.float_to_complex(1) self.connect((self.asrc, 1), (self.f2c, 1)) self.connect((self.asrc, 0), (self.f2c, 0)) symbol_rate = 18000 sps = 2 # output rate will be 36,000 ntaps = 11 * sps new_sample_rate = symbol_rate * sps channel_taps = filter.firdes.low_pass(1.0, sample_rate, options.low_pass, options.low_pass * 0.1, filter.firdes.WIN_HANN) FILTER = filter.freq_xlating_fir_filter_ccf(1, channel_taps, options.calibration, sample_rate) sys.stderr.write("sample rate: %d\n" %(sample_rate)) DEMOD = cqpsk.cqpsk_demod( samples_per_symbol = sps, excess_bw=0.35, costas_alpha=0.03, gain_mu=0.05, mu=0.05, omega_relative_limit=0.05, log=options.log, verbose=options.verbose) OUT = blocks.file_sink(gr.sizeof_float, options.output_file) r = float(sample_rate) / float(new_sample_rate) INTERPOLATOR = filter.fractional_interpolator_cc(0, r) self.connect(self.f2c, FILTER, INTERPOLATOR, DEMOD, OUT) self.scope = fftsink2.fft_sink_c(panel, fft_size=512, sample_rate=sample_rate, ref_scale=2.0, ref_level=-30, y_divs=10, fft_rate=10, average=True, avg_alpha=0.2) self.connect(self.f2c, self.scope)
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 100000 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate*10, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.uhd_usrp_source_0 = uhd.usrp_source( device_addr="addr0=192.168.10.2,addr1=192.168.10.3", stream_args=uhd.stream_args( cpu_format="fc32", channels=range(2), ), ) self.uhd_usrp_source_0.set_clock_source("mimo", 1) self.uhd_usrp_source_0.set_time_source("mimo", 1) self.uhd_usrp_source_0.set_samp_rate(samp_rate) self.uhd_usrp_source_0.set_center_freq(4.9e9+20000, 0) self.uhd_usrp_source_0.set_gain(15, 0) self.uhd_usrp_source_0.set_center_freq(4.9e9+20000, 1) self.uhd_usrp_source_0.set_gain(15, 1) self.gr_file_sink_0_0 = gr.file_sink(gr.sizeof_gr_complex*1, "/home/sdruser/COLLINS/Pre/UChannel2_S.txt") self.gr_file_sink_0_0.set_unbuffered(False) self.gr_file_sink_0 = gr.file_sink(gr.sizeof_gr_complex*1, "/home/sdruser/COLLINS/Pre/UChannel1_S.txt") self.gr_file_sink_0.set_unbuffered(False) ################################################## # Connections ################################################## self.connect((self.uhd_usrp_source_0, 0), (self.gr_file_sink_0, 0)) self.connect((self.uhd_usrp_source_0, 1), (self.gr_file_sink_0_0, 0)) self.connect((self.uhd_usrp_source_0, 1), (self.wxgui_fftsink2_0, 0))
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) self.frame = frame self.panel = panel options = get_options() sample_rate = int(options.sample_rate) self.asrc = audio.source(sample_rate, options.audio_device, True) self.f2c = gr.float_to_complex(1) self.connect((self.asrc, 1), (self.f2c, 1)) self.connect((self.asrc, 0), (self.f2c, 0)) symbol_rate = 18000 sps = 2 # output rate will be 36,000 ntaps = 11 * sps new_sample_rate = symbol_rate * sps channel_taps = gr.firdes.low_pass(1.0, sample_rate, options.low_pass, options.low_pass * 0.1, gr.firdes.WIN_HANN) FILTER = gr.freq_xlating_fir_filter_ccf(1, channel_taps, options.calibration, sample_rate) sys.stderr.write("sample rate: %d\n" %(sample_rate)) DEMOD = cqpsk.cqpsk_demod( samples_per_symbol = sps, excess_bw=0.35, costas_alpha=0.03, gain_mu=0.05, mu=0.05, omega_relative_limit=0.05, log=options.log, verbose=options.verbose) OUT = gr.file_sink(gr.sizeof_float, options.output_file) r = float(sample_rate) / float(new_sample_rate) INTERPOLATOR = gr.fractional_interpolator_cc(0, r) self.connect(self.f2c, FILTER, INTERPOLATOR, DEMOD, OUT) self.scope = fftsink2.fft_sink_c(panel, fft_size=512, sample_rate=sample_rate, ref_scale=2.0, ref_level=-30, y_divs=10, fft_rate=10, average=True, avg_alpha=0.2) self.connect(self.f2c, self.scope)
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Dvbs2 Tx") ################################################## # Variables ################################################## self.symbol_rate = symbol_rate = 5000000 self.taps = taps = 100 self.samp_rate = samp_rate = symbol_rate * 2 self.rolloff = rolloff = 0.2 self.frequency = frequency = 1280e6 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=frequency, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=True, avg_alpha=0.13333, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.fft_filter_xxx_0 = filter.fft_filter_ccc(1, (firdes.root_raised_cosine(1.0, samp_rate, samp_rate/2, rolloff, taps)), 1) self.fft_filter_xxx_0.declare_sample_delay(0) self.dtv_dvbs2_physical_cc_0 = dtv.dvbs2_physical_cc(dtv.FECFRAME_NORMAL, dtv.C9_10, dtv.MOD_16APSK, dtv.PILOTS_ON, 0) self.dtv_dvbs2_modulator_bc_0 = dtv.dvbs2_modulator_bc(dtv.FECFRAME_NORMAL, dtv.C9_10, dtv.MOD_16APSK, dtv.INTERPOLATION_OFF) self.dtv_dvbs2_interleaver_bb_0 = dtv.dvbs2_interleaver_bb(dtv.FECFRAME_NORMAL, dtv.C_OTHER, dtv.MOD_16APSK) self.dtv_dvb_ldpc_bb_0 = dtv.dvb_ldpc_bb(dtv.STANDARD_DVBS2, dtv.FECFRAME_NORMAL, dtv.C9_10, dtv.MOD_OTHER) self.dtv_dvb_bch_bb_0 = dtv.dvb_bch_bb(dtv.STANDARD_DVBS2, dtv.FECFRAME_NORMAL, dtv.C9_10, ) self.dtv_dvb_bbscrambler_bb_0 = dtv.dvb_bbscrambler_bb(dtv.STANDARD_DVBS2, dtv.FECFRAME_NORMAL, dtv.C9_10, ) self.dtv_dvb_bbheader_bb_0 = dtv.dvb_bbheader_bb(dtv.STANDARD_DVBS2, dtv.FECFRAME_NORMAL, dtv.C9_10, dtv.RO_0_20, dtv.INPUTMODE_NORMAL, dtv.INBAND_OFF, 168, 4000000) self.blocks_file_source_0 = blocks.file_source(gr.sizeof_char*1, "/Volumes/work/run/shm/adv16apsk910.ts", True) ################################################## # Connections ################################################## self.connect((self.blocks_file_source_0, 0), (self.dtv_dvb_bbheader_bb_0, 0)) self.connect((self.dtv_dvb_bbheader_bb_0, 0), (self.dtv_dvb_bbscrambler_bb_0, 0)) self.connect((self.dtv_dvb_bbscrambler_bb_0, 0), (self.dtv_dvb_bch_bb_0, 0)) self.connect((self.dtv_dvb_bch_bb_0, 0), (self.dtv_dvb_ldpc_bb_0, 0)) self.connect((self.dtv_dvb_ldpc_bb_0, 0), (self.dtv_dvbs2_interleaver_bb_0, 0)) self.connect((self.dtv_dvbs2_interleaver_bb_0, 0), (self.dtv_dvbs2_modulator_bc_0, 0)) self.connect((self.dtv_dvbs2_modulator_bc_0, 0), (self.dtv_dvbs2_physical_cc_0, 0)) self.connect((self.dtv_dvbs2_physical_cc_0, 0), (self.fft_filter_xxx_0, 0)) self.connect((self.fft_filter_xxx_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 1000 ################################################## # Blocks ################################################## self.blks2_ofdm_mod_0 = grc_blks2.packet_mod_b(blks2.ofdm_mod( options=grc_blks2.options( modulation="bpsk", fft_length=1024, occupied_tones=256, cp_length=512, pad_for_usrp=True, log=None, verbose=None, ), ), payload_length=0, ) self.gr_float_to_char_0 = gr.float_to_char() self.gr_sig_source_x_0 = gr.sig_source_f(samp_rate, gr.GR_SIN_WAVE, 100, 127, 0) self.gr_throttle_0 = gr.throttle(gr.sizeof_char*1, samp_rate) self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=50, ref_scale=2.0, sample_rate=samp_rate*1000, fft_size=1024, fft_rate=30, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) ################################################## # Connections ################################################## self.connect((self.gr_throttle_0, 0), (self.blks2_ofdm_mod_0, 0)) self.connect((self.gr_sig_source_x_0, 0), (self.gr_float_to_char_0, 0)) self.connect((self.gr_float_to_char_0, 0), (self.gr_throttle_0, 0)) self.connect((self.blks2_ofdm_mod_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Lora Receive File") ################################################## # Variables ################################################## self.sf = sf = 7 self.samp_rate = samp_rate = 10e6 self.bw = bw = 125000 self.target_freq = target_freq = 868.1e6 self.symbols_per_sec = symbols_per_sec = float(bw) / (2**sf) self.firdes_tap = firdes_tap = firdes.low_pass(1, samp_rate, bw, 10000, firdes.WIN_HAMMING, 6.67) self.capture_freq = capture_freq = 866.0e6 self.bitrate = bitrate = sf * (1 / (2**sf / float(bw))) ################################################## # Blocks ################################################## self.wxgui_fftsink2_1 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=capture_freq, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title='FFT Plot', peak_hold=False, ) self.Add(self.wxgui_fftsink2_1.win) self.lora_lora_receiver_0 = lora.lora_receiver(samp_rate, capture_freq, ([target_freq]), bw, sf, False, 4, True, False, False, 10, False, False) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1, samp_rate, True) self.blocks_file_source_0 = blocks.file_source( gr.sizeof_gr_complex * 1, 'counting_cr4_sf7.cfile', True) ################################################## # Connections ################################################## self.connect((self.blocks_file_source_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.lora_lora_receiver_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.wxgui_fftsink2_1, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Exploit Pack - RF Hacking") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 2e6 * 4 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title='Exploit Pack - Saving RF', peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.osmosdr_source_0 = osmosdr.source(args="numchan=" + str(1) + " " + '') self.osmosdr_source_0.set_sample_rate(samp_rate) self.osmosdr_source_0.set_center_freq(27e6, 0) self.osmosdr_source_0.set_freq_corr(0, 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(0, 0) self.osmosdr_source_0.set_if_gain(47, 0) self.osmosdr_source_0.set_bb_gain(16, 0) self.osmosdr_source_0.set_antenna('', 0) self.osmosdr_source_0.set_bandwidth(0, 0) self.blocks_file_sink_0 = blocks.file_sink(gr.sizeof_gr_complex * 1, '/tmp/saveRF', False) self.blocks_file_sink_0.set_unbuffered(False) ################################################## # Connections ################################################## self.connect((self.osmosdr_source_0, 0), (self.blocks_file_sink_0, 0)) self.connect((self.osmosdr_source_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="My Second Msg Block") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 25e6 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.usrp_source = uhd.usrp_source( device_addr="", stream_args=uhd.stream_args( cpu_format="fc32", channels=range(1), ), ) self.usrp_source.set_samp_rate(samp_rate) self.usrp_source.set_center_freq(105e6, 0) self.usrp_source.set_gain(15, 0) self.usrp_source.set_antenna("RX2", 0) self.my_second_msg_block_0 = dt.my_second_msg_block("95e6,605e6,915e6,880e6,1986e6") self.heart_beat_0_0 = precog.heart_beat(5,"hello","world") self.heart_beat_0 = precog.heart_beat(1,"hello","world") self.gr_null_sink_0 = gr.null_sink(gr.sizeof_char*1) self.extras_pmt_rpc_0 = gr_extras.pmt_rpc(obj=self, result_msg=False) ################################################## # Connections ################################################## self.connect((self.heart_beat_0, 0), (self.my_second_msg_block_0, 0)) self.connect((self.heart_beat_0_0, 0), (self.my_second_msg_block_0, 1)) self.connect((self.my_second_msg_block_0, 1), (self.extras_pmt_rpc_0, 0)) self.connect((self.usrp_source, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.my_second_msg_block_0, 0), (self.gr_null_sink_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 2000000 ################################################## # Blocks ################################################## self.wxgui_waterfallsink2_0 = waterfallsink2.waterfall_sink_c( self.GetWin(), baseband_freq=930000000, dynamic_range=100, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=512, fft_rate=15, average=False, avg_alpha=None, title='Waterfall Plot', ) self.Add(self.wxgui_waterfallsink2_0.win) self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=930000000, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title='FFT Plot', peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True) self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, '/home/bill/signal_hunter/out.iq', True) ################################################## # Connections ################################################## self.connect((self.blocks_file_source_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.wxgui_waterfallsink2_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 32000 ################################################## # Blocks ################################################## self.wxgui_scopesink2_0 = scopesink2.scope_sink_c( self.GetWin(), title="Scope Plot", sample_rate=samp_rate, v_scale=0, v_offset=0, t_scale=0, ac_couple=False, xy_mode=False, num_inputs=1, trig_mode=wxgui.TRIG_MODE_AUTO, y_axis_label="Counts", ) self.Add(self.wxgui_scopesink2_0.win) self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.hilbert_fc_0 = filter.hilbert_fc(65, firdes.WIN_HAMMING, 6.76) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True) self.analog_sig_source_x_0 = analog.sig_source_f(samp_rate, analog.GR_SQR_WAVE, 1000, 12, -6) ################################################## # Connections ################################################## self.connect((self.analog_sig_source_x_0, 0), (self.hilbert_fc_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.wxgui_scopesink2_0, 0)) self.connect((self.hilbert_fc_0, 0), (self.blocks_throttle_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 20e6 self.default_freq = default_freq = 1750e6 self.channel_width = channel_width = 200e3 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=default_freq, y_per_div=20, y_divs=10, ref_level=40, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=60, average=True, avg_alpha=None, title="Telefonica 4G", peak_hold=False, win=window.flattop, size=(1280, 768), ) self.Add(self.wxgui_fftsink2_0.win) self.rtlsdr_source_0 = osmosdr.source(args="numchan=" + str(1) + " " + "") self.rtlsdr_source_0.set_sample_rate(samp_rate) self.rtlsdr_source_0.set_center_freq(default_freq, 0) self.rtlsdr_source_0.set_freq_corr(0, 0) self.rtlsdr_source_0.set_dc_offset_mode(0, 0) self.rtlsdr_source_0.set_iq_balance_mode(0, 0) self.rtlsdr_source_0.set_gain_mode(False, 0) self.rtlsdr_source_0.set_gain(10, 0) self.rtlsdr_source_0.set_if_gain(20, 0) self.rtlsdr_source_0.set_bb_gain(20, 0) self.rtlsdr_source_0.set_antenna("", 0) self.rtlsdr_source_0.set_bandwidth(0, 0) ################################################## # Connections ################################################## self.connect((self.rtlsdr_source_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) parser = OptionParser (option_class=eng_option) (options, args) = parser.parse_args () sample_rate = 16e3 mpoints = 4 ampl = 1000 freq = 0 lo_freq = 1e6 lo_ampl = 1 vbox.Add(slider.slider(panel, -sample_rate/2, sample_rate/2, self.set_lo_freq), 0, wx.ALIGN_CENTER) src = gr.sig_source_c(sample_rate, gr.GR_CONST_WAVE, freq, ampl, 0) self.lo = gr.sig_source_c(sample_rate, gr.GR_SIN_WAVE, lo_freq, lo_ampl, 0) mixer = gr.multiply_cc() self.connect(src, (mixer, 0)) self.connect(self.lo, (mixer, 1)) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. thr = gr.throttle(gr.sizeof_gr_complex, sample_rate) taps = gr.firdes.low_pass(1, # gain 1, # rate 1.0/mpoints * 0.4, # cutoff 1.0/mpoints * 0.1, # trans width gr.firdes.WIN_HANN) print len(taps) analysis = blks2.analysis_filterbank(mpoints, taps) self.connect(mixer, thr) self.connect(thr, analysis) for i in range(mpoints): fft = fftsink2.fft_sink_c(frame, fft_size=128, sample_rate=sample_rate/mpoints, fft_rate=5, title="Ch %d" % (i,)) self.connect((analysis, i), fft) vbox.Add(fft.win, 1, wx.EXPAND)
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 5000000 self.freq = freq = 880000000 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=freq, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.uhd_usrp_sink_0 = uhd.usrp_sink( ",".join(("", "")), uhd.stream_args( cpu_format="fc32", channels=range(1), ), ) self.uhd_usrp_sink_0.set_samp_rate(samp_rate) self.uhd_usrp_sink_0.set_center_freq(freq, 0) self.uhd_usrp_sink_0.set_gain(0, 0) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1, samp_rate, True) self.analog_sig_source_x_0 = analog.sig_source_c( samp_rate, analog.GR_SIN_WAVE, freq, 1, 0) ################################################## # Connections ################################################## self.connect((self.analog_sig_source_x_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.uhd_usrp_sink_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self, droneServer=None): self.droneServer = droneServer grc_wxgui.top_block_gui.__init__(self, title="Usrp Block") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 1e6 self.freq = freq = 105.3e6 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=freq, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", functionCallbackWhenHandleMessageSink=self. callBackWhenHandleMessage, peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.uhd_usrp_source_0 = uhd.usrp_source( ",".join(("", "")), uhd.stream_args( cpu_format="fc32", channels=range(1), ), ) self.uhd_usrp_source_0.set_samp_rate(samp_rate) self.uhd_usrp_source_0.set_center_freq(freq, 0) self.uhd_usrp_source_0.set_gain(15, 0) self.uhd_usrp_source_0.set_antenna("RX2", 0) nois_global_variable.setuhd_usrp_source_0(self.uhd_usrp_source_0) nois_global_variable.setWxgui_fftsink(self.wxgui_fftsink2_0) ################################################## # Connections ################################################## self.connect((self.uhd_usrp_source_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) self.frame = frame self.panel = panel parser = OptionParser(option_class=eng_option) parser.add_option("-d", "--decim", type="int", default=16, help="set fgpa decimation rate to DECIM [default=%default]") parser.add_option("-f", "--freq", type="eng_float", default=None, help="set frequency to FREQ", metavar="FREQ") parser.add_option("-W", "--waterfall", action="store_true", default=False, help="Enable waterfall display") parser.add_option("-S", "--oscilloscope", action="store_true", default=False, help="Enable oscilloscope display") (options, args) = parser.parse_args() if len(args) != 0: parser.print_help() sys.exit(1) self.options = options self.options.gain = 1.0 self.show_debug_info = True input_rate = 100e6 / options.decim self.src = gr.file_descriptor_source(gr.sizeof_short, 0, False); self.s2c = gr.interleaved_short_to_complex() if options.waterfall: self.scope = \ waterfallsink2.waterfall_sink_c (panel, fft_size=1024, sample_rate=input_rate) elif options.oscilloscope: self.scope = scopesink2.scope_sink_c(panel, sample_rate=input_rate) else: self.scope = fftsink2.fft_sink_c (panel, fft_size=1024, y_divs=12, sample_rate=input_rate,ref_level=110,fft_rate=20) self.connect(self.src, self.s2c, self.scope) self._build_gui(vbox) self._setup_events() # set initial values if options.freq is None: # if no freq was specified, use the mid-point options.freq = 0.0 if self.show_debug_info: self.myform['decim'].set_value(self.options.decim)
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 256000 self.resamp_factor = resamp_factor = 4 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate / resamp_factor, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title='FFT Plot', peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.rational_resampler_xxx_0 = filter.rational_resampler_ccc( interpolation=1, decimation=resamp_factor, taps=None, fractional_bw=None, ) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1, samp_rate / resamp_factor, True) self.blocks_file_source_0 = blocks.file_source( gr.sizeof_gr_complex * 1, '/Users/ampoulog/Documents/gnuradio/Wireless-communication-systems-Lab/Lab2/example6/am_usrp710.dat', True) ################################################## # Connections ################################################## self.connect((self.blocks_file_source_0, 0), (self.rational_resampler_xxx_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.rational_resampler_xxx_0, 0), (self.blocks_throttle_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Complex multiplication") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 32000 self.offset = offset = 0 self.f2 = f2 = 1000 self.f1 = f1 = 10000 self.amp = amp = 1 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title='FFT Plot', peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1, samp_rate, True) 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, f2, amp, offset) self.analog_sig_source_x_0 = analog.sig_source_c( samp_rate, analog.GR_COS_WAVE, f1, amp, offset) ################################################## # Connections ################################################## self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_xx_0, 0)) self.connect((self.analog_sig_source_x_0_0, 0), (self.blocks_multiply_xx_0, 1)) self.connect((self.blocks_multiply_xx_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 5e6 self.center_freq2 = center_freq2 = 10e6 self.center_freq = center_freq = 1.57542e09 self.Gain = Gain = 60 self.BW = BW = 1.023e6 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=center_freq, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot of .11 USRP", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0_0.win) self.uhd_usrp_source_0_0 = uhd.usrp_source( ",".join(("addr0=192.168.10.2", "")), uhd.stream_args( cpu_format="fc32", channels=range(1), ), ) self.uhd_usrp_source_0_0.set_time_source("gpsdo", 0) self.uhd_usrp_source_0_0.set_samp_rate(samp_rate) self.uhd_usrp_source_0_0.set_center_freq(center_freq, 0) self.uhd_usrp_source_0_0.set_gain(Gain, 0) self.uhd_usrp_source_0_0.set_antenna("RX2", 0) self.uhd_usrp_source_0_0.set_bandwidth(BW, 0) ################################################## # Connections ################################################## self.connect((self.uhd_usrp_source_0_0, 0), (self.wxgui_fftsink2_0_0, 0))
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) self.frame = frame self.panel = panel parser = OptionParser(option_class=eng_option) parser.add_option("", "--excess-bw", type="float", default=_def_excess_bw, help="set RRC excess bandwith factor [default=%default] (PSK)") parser.add_option("", "--no-gray-code", dest="gray_code", action="store_false", default=_def_gray_code, help="disable gray coding on modulated bits (PSK)") parser.add_option("", "--costas-alpha", type="float", default=_def_costas_alpha, help="set Costas loop alpha value [default=%default] (PSK)") parser.add_option("", "--gain-mu", type="float", default=_def_gain_mu, help="set M&M symbol sync loop gain mu value [default=%default] (PSK)") parser.add_option("", "--mu", type="float", default=_def_mu, help="set M&M symbol sync loop mu value [default=%default] (PSK)") (options, args) = parser.parse_args() random_source_x_0 = gr.vector_source_b(numpy.random.randint(0, 2, 3), True) my_fft = fftsink2.fft_sink_c( panel, baseband_freq=0, y_per_div=10, ref_level=50, sample_rate=32000, fft_size=1024, fft_rate=30, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) vbox.Add(my_fft.win, 1, wx.EXPAND) dqpsk_mod = blks2.dqpsk_mod( samples_per_symbol=2, excess_bw=0.35, gray_code=True, ) self.connect(random_source_x_0, dqpsk_mod) self.connect(dqpsk_mod, my_fft)
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) parser = OptionParser (option_class=eng_option) (options, args) = parser.parse_args () sample_rate = 16e6 mpoints = 16 ampl = 1000 enable = mpoints/2 * [1, 0] enable[0] = 1 taps = gr.firdes.low_pass(1, # gain 1, # rate 1.0/mpoints * 0.4, # cutoff 1.0/mpoints * 0.1, # trans width gr.firdes.WIN_HANN) synth = blks2.synthesis_filterbank(mpoints, taps) null_source = gr.null_source(gr.sizeof_gr_complex) if 1: for i in range(mpoints): s = gr.sig_source_c(sample_rate/mpoints, gr.GR_SIN_WAVE, 300e3, ampl * enable[i], 0) self.connect(s, (synth, i)) else: for i in range(mpoints): if i == 1: #s = gr.sig_source_c(sample_rate/mpoints, gr.GR_SIN_WAVE, # 300e3, ampl * enable[i], 0) s = random_noise_c(ampl) self.connect(s, (synth, i)) else: self.connect(null_source, (synth, i)) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. thr = gr.throttle(gr.sizeof_gr_complex, sample_rate) fft = fftsink2.fft_sink_c(frame, fft_size=1024,sample_rate=sample_rate) vbox.Add(fft.win, 1, wx.EXPAND) self.connect(synth, thr, fft)
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 32000 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=20, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=1e6, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.rtlsdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + "" ) self.rtlsdr_source_0.set_sample_rate(1e6) self.rtlsdr_source_0.set_center_freq(1575.269e6, 0) self.rtlsdr_source_0.set_freq_corr(0, 0) self.rtlsdr_source_0.set_dc_offset_mode(2, 0) self.rtlsdr_source_0.set_iq_balance_mode(1, 0) self.rtlsdr_source_0.set_gain_mode(False, 0) self.rtlsdr_source_0.set_gain(10, 0) self.rtlsdr_source_0.set_if_gain(20, 0) self.rtlsdr_source_0.set_bb_gain(20, 0) self.rtlsdr_source_0.set_antenna("", 0) self.rtlsdr_source_0.set_bandwidth(1e5, 0) ################################################## # Connections ################################################## self.connect((self.rtlsdr_source_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 32000 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.dbfcttc_raw_array_0 = dbfcttc.raw_array("en4", 8, 70, 10, 5000000) self.blocks_null_sink_1_5 = blocks.null_sink(gr.sizeof_gr_complex*1) self.blocks_null_sink_1_4 = blocks.null_sink(gr.sizeof_gr_complex*1) self.blocks_null_sink_1_2 = blocks.null_sink(gr.sizeof_gr_complex*1) self.blocks_null_sink_1_1 = blocks.null_sink(gr.sizeof_gr_complex*1) self.blocks_null_sink_1_0 = blocks.null_sink(gr.sizeof_gr_complex*1) self.blocks_null_sink_1 = blocks.null_sink(gr.sizeof_gr_complex*1) self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_gr_complex*1) ################################################## # Connections ################################################## self.connect((self.dbfcttc_raw_array_0, 1), (self.blocks_null_sink_0, 0)) self.connect((self.dbfcttc_raw_array_0, 2), (self.blocks_null_sink_1_0, 0)) self.connect((self.dbfcttc_raw_array_0, 3), (self.blocks_null_sink_1, 0)) self.connect((self.dbfcttc_raw_array_0, 4), (self.blocks_null_sink_1_1, 0)) self.connect((self.dbfcttc_raw_array_0, 5), (self.blocks_null_sink_1_2, 0)) self.connect((self.dbfcttc_raw_array_0, 6), (self.blocks_null_sink_1_4, 0)) self.connect((self.dbfcttc_raw_array_0, 7), (self.blocks_null_sink_1_5, 0)) self.connect((self.dbfcttc_raw_array_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 100e3 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=990e6, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.uhd_usrp_source_0 = uhd.usrp_source( device_addr="addr=10.32.19.159", stream_args=uhd.stream_args( cpu_format="fc32", channels=range(1), ), ) self.uhd_usrp_source_0.set_samp_rate(samp_rate) self.uhd_usrp_source_0.set_center_freq(990e6, 0) self.uhd_usrp_source_0.set_gain(10, 0) self.uhd_usrp_source_0.set_antenna("RX2", 0) #self.analog_probe_avg_mag_sqrd_x_1 = analog.probe_avg_mag_sqrd_c(0, 0.5) self.probe_0=probe.probe(0,0.9) ################################################## # Connections ################################################## #self.connect((self.uhd_usrp_source_0, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.uhd_usrp_source_0, 0), (self.probe_0, 0))
def raw_fftsink(self, caller, title, baseband, y_div, y_divs, reflv, refscl, smpr, size, rate, avg, avg_alpha, peak_hold): return fftsink2.fft_sink_c( caller.GetWin(), baseband_freq=baseband, y_per_div=y_div, y_divs=y_divs, ref_level=reflv, ref_scale=refscl, sample_rate=smpr, fft_size=size, fft_rate=rate, average=avg, avg_alpha=avg_alpha, title=title, peak_hold=peak_hold, )
def __init__(self, win, filename_raw, sample_rate): gr.hier_block2.__init__(self, "Receiver Stage 1", gr.io_signature(0, 0, 0), gr.io_signature(1, 1, gr.sizeof_gr_complex)) self.sample_rate = sample_rate self.fname = filename_raw self.decim = 8 self.wxgui_fftsink = fftsink2.fft_sink_c( win, baseband_freq=0, y_per_div=5, y_divs=10, ref_level=-35, ref_scale=2.0, sample_rate=self.sample_rate, fft_size=1024, fft_rate=15, average=True, avg_alpha=None, title="FFT Plot (input)", peak_hold=True, ) self.tcp_source = grc_blks2.tcp_source( itemsize=gr.sizeof_gr_complex*1, addr="127.0.0.1", port=7890, server=False, ) self.throttle = blocks.throttle(gr.sizeof_gr_complex*1, sample_rate) if filename_raw is not None: self.file_sink_raw = blocks.file_sink(gr.sizeof_gr_complex*1, str(filename_raw)) self.file_sink_raw.set_unbuffered(False) ################################################## # Connections ################################################## self.connect((self.tcp_source, 0), (self.throttle, 0)) self.connect((self.throttle, 0), (self.wxgui_fftsink, 0)) if filename_raw is not None: self.connect((self.throttle, 0), (self.file_sink_raw, 0)) self.connect((self.throttle, 0), self)
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) self.frame = frame self.panel = panel parser = OptionParser(option_class=eng_option) parser.add_option("", "--fft-size", type="int", default=512, help="[default=%default]"); parser.add_option("", "--fft-rate", type="int", default=30, help="[default=%default]"); parser.add_option("", "--ref-scale", type="eng_float", default=1.0, help="[default=%default]"); parser.add_option("", "--ref-level", type="int", default=20, help="[default=%default]"); parser.add_option("", "--y-divs", type="int", default=12, help="[default=%default]"); parser.add_option("", "--y-per-div", type="int", default=10, help="[default=%default]"); parser.add_option("", "--baseband-freq", type="eng_float", default=0, help="[default=%default]") parser.add_option("", "--input-file", type="string", default=None, help="[default=%default]") (options, args) = parser.parse_args() if len(args) != 0: parser.print_help() raise SystemExit, 1 using_wav=False if options.input_file and os.path.exists(options.input_file): self.wav = gr.wavfile_source( options.input_file, True ) using_wav=True else: self.wav = audio.source(sample_rate, "", True) self.f2c = gr.float_to_complex() self.scope = fftsink2.fft_sink_c(panel, fft_size=options.fft_size, sample_rate=sample_rate, fft_rate=options.fft_rate, ref_scale=options.ref_scale, ref_level=options.ref_level, y_divs=options.y_divs, average=True, baseband_freq=options.baseband_freq, y_per_div=options.y_per_div) self.connect((self.wav, 0), (self.f2c, 0)) self.connect((self.wav, 1), (self.f2c, 1)) if using_wav: self.throttle = gr.throttle(gr.sizeof_gr_complex, sample_rate) self.connect(self.f2c, self.throttle, self.scope) else: self.connect((self.f2c, 0), (self.scope, 0)) vbox.Add(self.scope.win, 10, wx.EXPAND)
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Lora Receive File") ################################################## # Variables ################################################## self.sf = sf = 7 self.samp_rate = samp_rate = 10e6 self.bw = bw = 125000 self.target_freq = target_freq = 868.1e6 self.symbols_per_sec = symbols_per_sec = float(bw) / (2**sf) self.firdes_tap = firdes_tap = firdes.low_pass(1, samp_rate, bw, 10000, firdes.WIN_HAMMING, 6.67) self.capture_freq = capture_freq = 866.0e6 self.bitrate = bitrate = sf * (1 / (2**sf / float(bw))) ################################################## # Blocks ################################################## self.wxgui_fftsink2_1 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=capture_freq, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title='FFT Plot', peak_hold=False, ) self.Add(self.wxgui_fftsink2_1.win) self.lora_lora_receiver_0 = lora.lora_receiver(samp_rate, capture_freq, ([target_freq]), bw, sf, False, 4, True, False, False, 10, False, False) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True) self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, 'counting_cr4_sf7.cfile', True) ################################################## # Connections ################################################## self.connect((self.blocks_file_source_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.lora_lora_receiver_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.wxgui_fftsink2_1, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Cheetara Rx") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 125e3 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.uhd_usrp_source_0 = uhd.usrp_source( device_addr="serial=E8R10Z2B1", stream_args=uhd.stream_args( cpu_format="fc32", channels=range(1), ), ) self.uhd_usrp_source_0.set_samp_rate(samp_rate) self.uhd_usrp_source_0.set_center_freq(520e6, 0) self.uhd_usrp_source_0.set_gain(5, 0) self.uhd_usrp_source_0.set_antenna("RX2", 0) self.uhd_usrp_source_0.set_bandwidth(100e3, 0) ################################################## # Connections ################################################## self.connect((self.uhd_usrp_source_0, 0), (self.wxgui_fftsink2_0, 0))