def __init__(self, snr_db=0): channel.__init__(self, snr_db=snr_db) self.chan = \ channels.dynamic_channel_model( 200e3, # sample_rate 0.01, # sro_stdev 50, # sro_maxdev 0.01, # cfo_stdev .5e3, # cfo_maxdev 8, # n sinusoids in jakes model 0.0, # max fDoppler False, # LOS(True)/NLOS(False) 4.0, # K-value in Rician fading (1,), # PDP delays (1,), # PDP Magnitudes 1, # ntaps in channel impulse response 0, # Noise amp (is added later) 0 # seed ) self.connect(self, self.chan, self.add)
def generate_waveform(modulation_type_requested, SNR_requested): # validate SNR parameter snr = int(SNR_requested) if (((snr % 2) != 0) or (abs(snr) > 20)): print "SNR value not in range. Must be even and between -20 and 20" raise IOError # define mappings for a given mod type all_keys = { "bpsk": 0, "8psk": 0, "qpsk": 0, "pam4": 0, "qam16": 0, "qam64": 0, "gfsk": 0, "cpfsk": 0, "fm": 1, "am": 1, "amssb": 1 } discrete_keys = { "bpsk": 0, "8psk": 1, "qpsk": 2, "pam4": 3, "qam16": 4, "qam64": 5, "gfsk": 6, "cpfsk": 7 } continuous_keys = {"fm": 0, "am": 1, "amssb": 2} mod_type_key = 0 mod_alphabet = 0 # validate the mod type try: mod_alphabet = all_keys[modulation_type_requested] except: print "Couldn't register the modulation type. Try again" raise IOError try: if (mod_alphabet == 0): mod_type_key = discrete_keys[modulation_type_requested] else: mod_type_key = continuous_keys[modulation_type_requested] except: print "Error registering the modulation type. Try again" ''' Generate dataset with dynamic channel model across range of SNRs ''' write_to_file = True write_to_net = False apply_channel = True dataset = {} # The output format looks like this # {('mod type', SNR): np.array(nvecs_per_key, 2, vec_length), etc} # CIFAR-10 has 6000 samples/class. CIFAR-100 has 600. Somewhere in there seems like right order of magnitude nvecs_per_key = 1000 vec_length = 128 snr_vals = range(-20, 20, 2) transmitter_keys = transmitters.keys() # list:['discrete', 'continuous'] alphabet_type = transmitter_keys[mod_alphabet] mod_type = transmitters[ alphabet_type] # [<class 'transmitters_WIN.transmitter_bpsk'>, <class 'transmitters_WIN.transmitter_qpsk'>, <class 'transmitters_WIN.transmitter_pam4'>, <class 'transmitters_WIN.transmitter_qam16'>, <class 'transmitters_WIN.transmitter_qam64'>, <class 'transmitters_WIN.transmitter_gfsk'>, <class 'transmitters_WIN.transmitter_cpfsk'>] print "Mod type: " + str(mod_type[mod_type_key].modname) print "SNR: " + str(snr) dataset[(mod_type[mod_type_key].modname, snr)] = np.zeros([nvecs_per_key, 2, vec_length], dtype=np.float32) modvec_indx = 0 tx_len = int(10e3) if mod_type[mod_type_key].modname == "QAM16": tx_len = int(20e3) if mod_type[mod_type_key].modname == "QAM64": tx_len = int(30e3) src = source_alphabet(alphabet_type, tx_len, True) # works okay with FIFO file mod = mod_type[mod_type_key]() sample_rate = 200e3 # Input sample rate in Hz sro_std_dev = 0.01 # sample rate drift process standard deviation per sample in Hz sro_max_dev = 50 # maximum sample rate offset in Hz cfo_std_dev = 0.01 # carrier frequnecy drift process standard deviation per sample in Hz cfo_max_dev = 500 # maximum carrier frequency offset in Hz N_sinusoids = 8 # number of sinusoids used in frequency selective fading simulation fD = 1 # doppler frequency LOS_model = True # defines whether the fading model should include a line of site component. LOS->Rician, NLOS->Rayleigh K_factor = 4 # Rician K-factor, the ratio of specular to diffuse power in the model delays = [ 0.0, 0.9, 1.7 ] # A list of fractional sample delays making up the power delay profile mags = [ 1, 0.8, 0.3 ] # A list of magnitudes corresponding to each delay time in the power delay profile ntaps = 8 # The length of the filter to interpolate the power delay profile over. Delays in the PDP must lie between 0 and ntaps_mpath, fractional delays will be sinc-interpolated only to the width of this filter. noise_amp = 10**(-snr / 10.0 ) # Specifies the standard deviation of the AWGN process chan = channels.dynamic_channel_model(sample_rate, sro_std_dev, sro_max_dev, cfo_std_dev, cfo_max_dev, N_sinusoids, fD, LOS_model, K_factor, delays, mags, ntaps, noise_amp, 0x1337) tb = gr.top_block() print "starting source: " + str(src) + "and mod: " + str(mod) # add an optional eth sink if write_to_net: snk_udp = blocks.udp_sink(gr.sizeof_float * 1, '192.168.1.187', 45000, 1472, True) if apply_channel: tb.connect(src, mod, chan, snk_udp) else: tb.connect(src, mod, snk_udp) tb.start() else: snk = blocks.vector_sink_c() if apply_channel: tb.connect(src, mod, chan, snk) else: tb.connect(src, mod, snk) tb.run() # sampler_indx: some in [50, 500] #len(raw_output_vector) = 79993 if write_to_file: insufficient_modsnr_vectors = True raw_output_vector = np.array(snk.data(), dtype=np.complex64) # start the sampler some random time after channel model transients (arbitrary values here) sampler_indx = random.randint(50, 500) while (insufficient_modsnr_vectors): while modvec_indx < nvecs_per_key: # sampler_indx + vec_length < len(raw_output_vector) and sampled_vector = raw_output_vector[sampler_indx:sampler_indx + vec_length] # Normalize the energy in this vector to be 1 energy = np.sum((np.abs(sampled_vector))) sampled_vector = sampled_vector / energy dataset[(mod_type[mod_type_key].modname, snr)][modvec_indx, 0, :] = np.real(sampled_vector) dataset[(mod_type[mod_type_key].modname, snr)][modvec_indx, 1, :] = np.imag(sampled_vector) # bound the upper end very high so it's likely we get multiple passes through # independent channels #sampler_indx += random.randint(vec_length, round(len(raw_output_vector)*.05)) sampler_indx += random.randint( vec_length, round(len(raw_output_vector) * .05)) sampler_indx = sampler_indx % (len(raw_output_vector) - vec_length) modvec_indx += 1 if modvec_indx == nvecs_per_key: # we're all done insufficient_modsnr_vectors = False if write_to_file: print "all done. writing to disk" filename = "" + mod_type[mod_type_key].modname + "_" + str( snr) + "out.dat" cPickle.dump(dataset, file(filename, "wb")) print( "percentage non-zero: " + str(100 * np.count_nonzero(dataset[(mod_type[mod_type_key].modname, snr)]) / (2 * vec_length * nvecs_per_key))) return src, mod, chan
def gen_corpus(out_path, nvecs_per_key=1000, snr_min=-10, snr_max=20, vec_length=1024): apply_channel = True dataset = {} # The output format looks like this # {('mod type', SNR): np.array(nvecs_per_key, 2, vec_length), etc} # CIFAR-10 has 6000 samples/class. CIFAR-100 has 600. Somewhere in there seems like right order of magnitude snr_vals = range(snr_min, snr_max, 2) for snr in snr_vals: #print "snr is ", snr for alphabet_type in transmitters.keys(): for i, mod_type in enumerate(transmitters[alphabet_type]): dataset[(mod_type.modname, snr)] = np.zeros([nvecs_per_key, 2, vec_length], dtype=np.float32) # moar vectors! insufficient_modsnr_vectors = True modvec_indx = 0 while insufficient_modsnr_vectors: tx_len = int(10e3) if mod_type.modname == "QAM16": tx_len = int(20e3) if mod_type.modname == "QAM64": tx_len = int(30e3) src = source_alphabet(alphabet_type, tx_len, True) mod = mod_type() fD = 1 delays = [0.0, 0.9, 1.7] mags = [1, 0.8, 0.3] ntaps = 8 noise_amp = 10**(-snr / 10.0) chan = channels.dynamic_channel_model( 200e3, 0.01, 50, .01, 0.5e3, 8, fD, True, 4, delays, mags, ntaps, noise_amp, 0x1337) snk = blocks.vector_sink_c() tb = gr.top_block() # connect blocks if apply_channel: tb.connect(src, mod, chan, snk) else: tb.connect(src, mod, snk) tb.run() raw_output_vector = np.array(snk.data(), dtype=np.complex64) # start the sampler some random time after channel model transients (arbitrary values here) sampler_indx = random.randint(50, 500) while sampler_indx + vec_length < len( raw_output_vector) and modvec_indx < nvecs_per_key: sampled_vector = raw_output_vector[ sampler_indx:sampler_indx + vec_length] # Normalize the energy in this vector to be 1 energy = np.sum((np.abs(sampled_vector))) sampled_vector = sampled_vector / energy dataset[(mod_type.modname, snr)][modvec_indx, 0, :] = np.real(sampled_vector) dataset[(mod_type.modname, snr)][modvec_indx, 1, :] = np.imag(sampled_vector) # bound the upper end very high so it's likely we get multiple passes through # independent channels sampler_indx += random.randint( vec_length, round(len(raw_output_vector) * .05)) modvec_indx += 1 if modvec_indx == nvecs_per_key: # we're all done insufficient_modsnr_vectors = False print "all done. writing to disk" cPickle.dump(dataset, file(out_path, "wb"))
tx_len = int(10e3) if mod_type.modname == "QAM64": tx_len = int(30e3) if mod_type.modname == "QAM16": tx_len = int(20e3) src = source_alphabet(alphabet_type, tx_len, True) mod = mod_type() fD = 1 # doppler delays = [0.0, 0.9, 1.7] # PDP delays mags = [1, 0.8, 0.3] # PDP magnitudes ntaps = 8 # multipath FIR filter taps noise_amp = 10**(-snr / 10.0) # linear noise value print noise_amp #noise_amp = 0.1 chan = channels.dynamic_channel_model(200e3, 0.01, 1e2, 0.01, 1e3, 8, fD, True, 4, delays, mags, ntaps, noise_amp, 0x1337) snk = blocks.vector_sink_c() tb = gr.top_block() # connect blocks and run if apply_channel: tb.connect( src, mod, chan, snk ) # connect SRC (source_alphabet) - MOD (mod_type) - CHAN (dyn_chan_model) - SNK (vector_sink) else: tb.connect(src, mod, snk) tb.run()
tx_len = int(10e3) if mod_type.modname == "QAM16": tx_len = int(20e3) if mod_type.modname == "QAM64": tx_len = int(30e3) src = source_alphabet(alphabet_type, tx_len, True) # decide modulation type mod = mod_type() # specify channel parameters fD = 1 delays = [0.0, 0.9, 1.7] mags = [1, 0.8, 0.3] ntaps = 8 noise_amp = 10**(-snr / 10.0) chan = channels.dynamic_channel_model(200e3, 0.01, 50, .01, 0.5e3, 8, fD, True, 4, delays, mags, ntaps, noise_amp, 0x1337) # create gnuradio data sink snk = blocks.vector_sink_c() # create gnuradio topblock tb = gr.top_block() if snr == 99: # this is actually the pure signal without noise or distortion # connect blocks and perform 1) bit generation; 2) modulation; 3) receive signal chan1 = channels.dynamic_channel_model( 200e3, 0, 0, 0, 0, 0, 0, True, 1, [0], [1], 1, 0, 0x1337) tb.connect(src, mod, chan1, snk) elif snr == -99: # this is signal without noise but with channel distortions # new channel (with multipath and other distortions, but without noise) chan2 = channels.dynamic_channel_model( 200e3, 0.01, 50, .01, 0.5e3, 8, fD, True, 4, delays,
def main(): insufficient_samples = True modvec_indx = 0 with open (os.path.join(dir_name, 'index.txt'), 'a') as index_file: for snr in snr_vals: print "snr is ", snr # Create subfolder # if snr < 0: # folderpath = os.path.join(dir_name,"negative_"+str(abs(snr))) # else: # folderpath = os.path.join(dir_name,str(snr)) # while insufficient_samples: # if mod_type.modname == "QAM16": # tx_len = int(20e4) # if mod_type.modname == "QAM64": # tx_len = int(30e4) tx_len = int(30e4) fD = 1 delays = [0.0, 0.9, 1.7] mags = [1, 0.8, 0.3] ntaps = 8 noise_amp = 10**(-snr/10.0) chan = channels.dynamic_channel_model(SAMP_RATE, 0.01, 50, .01, 0.5e3, 8, fD, True, 4, delays, mags, ntaps, noise_amp, 0x1337 ) tb = gr.top_block() # Choose 1, 2, or 3 sources num_sources = random.randint(1,max_num_sources) sources_list = [] source_add_block = blocks.add_vcc(1) # Generate num_sources sources for i in range(0, num_sources): src = generate_source(i) tb.connect(src, (source_add_block,i)) sources_list.append(src) snk = blocks.vector_sink_c() # Do limiter here at the end, so that different sources don't blocks limiter = blocks.head(gr.sizeof_gr_complex, tx_len) # connect blocks if apply_channel: tb.connect((source_add_block,0), chan, limiter, snk) else: tb.connect((source_add_block,0), limiter, snk) # This is a really cheesy fix! Just run for a couple seconds then quit tb.start() time.sleep(1) tb.stop() raw_output_vector = np.array(snk.data(), dtype=np.complex64) # start the sampler some random time after channel model transients (arbitrary values here) sampler_indx = random.randint(50, 500) while sampler_indx + spec_vec_length < len(raw_output_vector) and modvec_indx < num_samples: # Get a snippet of vector to turn into a spectogram sampled_vector = raw_output_vector[sampler_indx:sampler_indx+spec_vec_length] # Normalize the energy in this vector to be 1 # energy = np.sum((np.abs(sampled_vector))) # Normalize with the max # max_in_vec = np.amax(np.abs(sampled_vector)) # sampled_vector = sampled_vector / max_in_vec f, t, Sxx = signal.spectrogram(sampled_vector, fs = SAMP_RATE, nperseg=vec_length, return_onesided= False, mode = 'complex') # By default, the ordering of the frequencies it non-obvious. # Use FFTShift to get it to go negative/positive. f = fftpack.fftshift(f) Sxx = fftpack.fftshift(Sxx, axes=0) datapoint = {} datapoint['data'] = np.zeros([vec_length, vec_length, 2], dtype=np.float32) # Write data to file datapoint['data'][:,:,0] = np.real(Sxx) datapoint['data'][:,:,1] = np.imag(Sxx) #datapoint['raw_data'] = sampled_vector datapoint['sample_f'] = f datapoint['segment_t'] = t datapoint['objects'] = [src.get_metadata() for src in sources_list] filename = str(modvec_indx) + '.dat' filepath = os.path.join(dir_name,filename) cPickle.dump( datapoint, file(filepath, "wb" ) ) print datapoint['objects'] # Write metadata to text file index_file.write(filename + ' ' + str(snr) + '\n') #print Sxx.shape # dataset[(mod_type.modname, snr)][modvec_indx,0,:] = np.real(sampled_vector) # dataset[(mod_type.modname, snr)][modvec_indx,1,:] = np.imag(sampled_vector) # bound the upper end very high so it's likely we get multiple passes through # independent channels sampler_indx += random.randint(vec_length, round(len(raw_output_vector)*.05)) modvec_indx += 1 print "Generated Sample " + str(modvec_indx) if modvec_indx == num_samples: # we're all done insufficient_samples = False # Store sample frequencies and segment times print "all done. writing to disk"
def __init__(self): gr.top_block.__init__(self, "Top Block") Qt.QWidget.__init__(self) self.setWindowTitle("Top Block") try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "top_block") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.sps = sps = 4 self.samp_rate_umts_ped_b = samp_rate_umts_ped_b = 7.68e6 self.samp_rate_umts_ped_a = samp_rate_umts_ped_a = 7.68e6 self.samp_rate_ca0 = samp_rate_ca0 = 4e9 self.pdp_times_umts_ped_b = pdp_times_umts_ped_b = [ 0, 1.536, 6.144, 9.216, 17.664, 28.416 ] self.pdp_times_umts_ped_a = pdp_times_umts_ped_a = [ 0, 0.8448, 1.4592, 3.1488 ] self.pdp_times_ca0 = pdp_times_ca0 = [ -0.25, -0.125, 0.0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1.0, 1.125, 1.25, 1.5, 1.625, 1.75, 1.875, 2.0, 2.125, 2.25, 2.375, 2.5, 2.75, 2.875, 3.0, 3.125, 3.25, 3.375, 3.5, 3.625, 3.75, 3.875, 4.0, 4.125, 4.25, 4.375, 4.5, 4.625, 4.75, 5.125, 5.25, 5.5, 5.625, 5.75, 6.0, 6.375, 6.5, 6.625, 6.75, 6.875, 7.25, 8.0, 8.125, 8.5, 8.625, 8.75, 8.875, 9.125, 9.25, 9.375, 9.5, 9.875, 10.0, 10.75, 10.875, 11.0, 11.125, 13.125, 13.25 ] self.pdp_mags_umts_ped_b = pdp_mags_umts_ped_b = [ 1, 0.9139311853, 0.6126263942, 0.4493289641, 0.4584060113, 0.0916296839 ] self.pdp_mags_umts_ped_a = pdp_mags_umts_ped_a = [ 1, 0.3790830381, 0.1466069621, 0.1022842067 ] self.pdp_mags_ca0 = pdp_mags_ca0 = [ 0.16529889, 0.46954084, 0.58274825, 0.24561255, 0.50459457, 0.69767633, 1.0, 0.77724474, 0.48675226, 0.46954084, 0.21267289, 0.19090106, 0.31600413, 0.45293801, 0.8057353, 0.64920938, 0.50459457, 0.1978987, 0.35204369, 0.54226525, 0.31600413, 0.15945397, 0.2204686, 0.35204369, 0.37832563, 0.37832563, 0.36494815, 0.2204686, 0.17763933, 0.45293801, 0.52309091, 0.52309091, 0.46954084, 0.35204369, 0.40656966, 0.25461568, 0.23692776, 0.32758753, 0.1978987, 0.21267289, 0.2204686, 0.19090106, 0.24561255, 0.17135806, 0.21267289, 0.16529889, 0.2204686, 0.30483032, 0.33959553, 0.18415085, 0.18415085, 0.22855006, 0.2940516, 0.19090106, 0.17135806, 0.18415085, 0.1978987, 0.17763933, 0.15945397, 0.26394884, 0.24561255, 0.21267289, 0.19090106, 0.17763933, 0.2204686, 0.21267289, 0.17135806, 0.17135806, 0.16529889 ] self.nfilts = nfilts = 32 self.model = model = 2 self.timing_loop_bw = timing_loop_bw = 6.28 / 100.0 self.samp_rate = samp_rate = [ samp_rate_ca0, samp_rate_umts_ped_a, samp_rate_umts_ped_b ][model] self.rrc_taps = rrc_taps = firdes.root_raised_cosine( nfilts, nfilts, 1.0 / float(sps), 0.35, 11 * sps * nfilts) self.phase_bw = phase_bw = 6.28 / 100.0 self.pdp_times = pdp_times = [ pdp_times_ca0, pdp_times_umts_ped_a, pdp_times_umts_ped_b ][model] self.pdp_mags = pdp_mags = [ pdp_mags_ca0, pdp_mags_umts_ped_a, pdp_mags_umts_ped_b ][model] self.number_of_samples = number_of_samples = 1000 self.noise_volt = noise_volt = 0.0001 self.eq_gain = eq_gain = 0.01 self.arity = arity = 4 ################################################## # Blocks ################################################## self._timing_loop_bw_range = Range(0.0, 0.2, 0.01, 6.28 / 100.0, 200) self._timing_loop_bw_win = RangeWidget(self._timing_loop_bw_range, self.set_timing_loop_bw, 'Time: BW', "slider", float) self.top_grid_layout.addWidget(self._timing_loop_bw_win, 0, 1, 1, 1) self._phase_bw_range = Range(0.0, 1.0, 0.01, 6.28 / 100.0, 200) self._phase_bw_win = RangeWidget(self._phase_bw_range, self.set_phase_bw, 'Phase: Bandwidth', "slider", float) self.top_grid_layout.addWidget(self._phase_bw_win, 1, 1, 1, 1) self._noise_volt_range = Range(0, 1, 0.01, 0.0001, 200) self._noise_volt_win = RangeWidget(self._noise_volt_range, self.set_noise_volt, 'Channel: Noise Voltage', "slider", float) self.top_grid_layout.addWidget(self._noise_volt_win, 0, 0, 1, 1) self._eq_gain_range = Range(0.0, 0.1, 0.001, 0.01, 200) self._eq_gain_win = RangeWidget(self._eq_gain_range, self.set_eq_gain, 'Equalizer: rate', "slider", float) self.top_grid_layout.addWidget(self._eq_gain_win, 1, 0, 1, 1) self.qtgui_const_sink_x_1_1 = qtgui.const_sink_c( 1024, #size 'After CMA equilizer @RX', #name 1 #number of inputs ) self.qtgui_const_sink_x_1_1.set_update_time(0.10) self.qtgui_const_sink_x_1_1.set_y_axis(-2, 2) self.qtgui_const_sink_x_1_1.set_x_axis(-2, 2) self.qtgui_const_sink_x_1_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") self.qtgui_const_sink_x_1_1.enable_autoscale(False) self.qtgui_const_sink_x_1_1.enable_grid(False) self.qtgui_const_sink_x_1_1.enable_axis_labels(True) if not True: self.qtgui_const_sink_x_1_1.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "red", "red", "red", "red", "red", "red", "red", "red" ] styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] markers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_const_sink_x_1_1.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_const_sink_x_1_1.set_line_label(i, labels[i]) self.qtgui_const_sink_x_1_1.set_line_width(i, widths[i]) self.qtgui_const_sink_x_1_1.set_line_color(i, colors[i]) self.qtgui_const_sink_x_1_1.set_line_style(i, styles[i]) self.qtgui_const_sink_x_1_1.set_line_marker(i, markers[i]) self.qtgui_const_sink_x_1_1.set_line_alpha(i, alphas[i]) self._qtgui_const_sink_x_1_1_win = sip.wrapinstance( self.qtgui_const_sink_x_1_1.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_const_sink_x_1_1_win, 3, 1, 1, 1) self.qtgui_const_sink_x_1_0_0_0 = qtgui.const_sink_c( 1024, #size 'Channel output', #name 1 #number of inputs ) self.qtgui_const_sink_x_1_0_0_0.set_update_time(0.10) self.qtgui_const_sink_x_1_0_0_0.set_y_axis(-2, 2) self.qtgui_const_sink_x_1_0_0_0.set_x_axis(-2, 2) self.qtgui_const_sink_x_1_0_0_0.set_trigger_mode( qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") self.qtgui_const_sink_x_1_0_0_0.enable_autoscale(False) self.qtgui_const_sink_x_1_0_0_0.enable_grid(False) self.qtgui_const_sink_x_1_0_0_0.enable_axis_labels(True) if not True: self.qtgui_const_sink_x_1_0_0_0.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "red", "red", "red", "red", "red", "red", "red", "red" ] styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] markers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_const_sink_x_1_0_0_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_const_sink_x_1_0_0_0.set_line_label(i, labels[i]) self.qtgui_const_sink_x_1_0_0_0.set_line_width(i, widths[i]) self.qtgui_const_sink_x_1_0_0_0.set_line_color(i, colors[i]) self.qtgui_const_sink_x_1_0_0_0.set_line_style(i, styles[i]) self.qtgui_const_sink_x_1_0_0_0.set_line_marker(i, markers[i]) self.qtgui_const_sink_x_1_0_0_0.set_line_alpha(i, alphas[i]) self._qtgui_const_sink_x_1_0_0_0_win = sip.wrapinstance( self.qtgui_const_sink_x_1_0_0_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_const_sink_x_1_0_0_0_win, 2, 2, 1, 1) self.qtgui_const_sink_x_1_0_0 = qtgui.const_sink_c( 1024, #size 'After constant multiplication', #name 1 #number of inputs ) self.qtgui_const_sink_x_1_0_0.set_update_time(0.10) self.qtgui_const_sink_x_1_0_0.set_y_axis(-2, 2) self.qtgui_const_sink_x_1_0_0.set_x_axis(-2, 2) self.qtgui_const_sink_x_1_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") self.qtgui_const_sink_x_1_0_0.enable_autoscale(False) self.qtgui_const_sink_x_1_0_0.enable_grid(False) self.qtgui_const_sink_x_1_0_0.enable_axis_labels(True) if not True: self.qtgui_const_sink_x_1_0_0.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "red", "red", "red", "red", "red", "red", "red", "red" ] styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] markers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_const_sink_x_1_0_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_const_sink_x_1_0_0.set_line_label(i, labels[i]) self.qtgui_const_sink_x_1_0_0.set_line_width(i, widths[i]) self.qtgui_const_sink_x_1_0_0.set_line_color(i, colors[i]) self.qtgui_const_sink_x_1_0_0.set_line_style(i, styles[i]) self.qtgui_const_sink_x_1_0_0.set_line_marker(i, markers[i]) self.qtgui_const_sink_x_1_0_0.set_line_alpha(i, alphas[i]) self._qtgui_const_sink_x_1_0_0_win = sip.wrapinstance( self.qtgui_const_sink_x_1_0_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_const_sink_x_1_0_0_win, 2, 1, 1, 1) self.qtgui_const_sink_x_1_0 = qtgui.const_sink_c( 1024, #size 'Transmitted modulated symbols', #name 1 #number of inputs ) self.qtgui_const_sink_x_1_0.set_update_time(0.10) self.qtgui_const_sink_x_1_0.set_y_axis(-2, 2) self.qtgui_const_sink_x_1_0.set_x_axis(-2, 2) self.qtgui_const_sink_x_1_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") self.qtgui_const_sink_x_1_0.enable_autoscale(False) self.qtgui_const_sink_x_1_0.enable_grid(False) self.qtgui_const_sink_x_1_0.enable_axis_labels(True) if not True: self.qtgui_const_sink_x_1_0.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "red", "red", "red", "red", "red", "red", "red", "red" ] styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] markers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_const_sink_x_1_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_const_sink_x_1_0.set_line_label(i, labels[i]) self.qtgui_const_sink_x_1_0.set_line_width(i, widths[i]) self.qtgui_const_sink_x_1_0.set_line_color(i, colors[i]) self.qtgui_const_sink_x_1_0.set_line_style(i, styles[i]) self.qtgui_const_sink_x_1_0.set_line_marker(i, markers[i]) self.qtgui_const_sink_x_1_0.set_line_alpha(i, alphas[i]) self._qtgui_const_sink_x_1_0_win = sip.wrapinstance( self.qtgui_const_sink_x_1_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_const_sink_x_1_0_win, 2, 0, 1, 1) self.qtgui_const_sink_x_1 = qtgui.const_sink_c( 1024, #size 'After time synchronization @RX', #name 1 #number of inputs ) self.qtgui_const_sink_x_1.set_update_time(0.10) self.qtgui_const_sink_x_1.set_y_axis(-2, 2) self.qtgui_const_sink_x_1.set_x_axis(-2, 2) self.qtgui_const_sink_x_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") self.qtgui_const_sink_x_1.enable_autoscale(False) self.qtgui_const_sink_x_1.enable_grid(False) self.qtgui_const_sink_x_1.enable_axis_labels(True) if not True: self.qtgui_const_sink_x_1.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "red", "red", "red", "red", "red", "red", "red", "red" ] styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] markers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_const_sink_x_1.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_const_sink_x_1.set_line_label(i, labels[i]) self.qtgui_const_sink_x_1.set_line_width(i, widths[i]) self.qtgui_const_sink_x_1.set_line_color(i, colors[i]) self.qtgui_const_sink_x_1.set_line_style(i, styles[i]) self.qtgui_const_sink_x_1.set_line_marker(i, markers[i]) self.qtgui_const_sink_x_1.set_line_alpha(i, alphas[i]) self._qtgui_const_sink_x_1_win = sip.wrapinstance( self.qtgui_const_sink_x_1.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_const_sink_x_1_win, 3, 0, 1, 1) self.qtgui_const_sink_x_0 = qtgui.const_sink_c( 1024, #size 'After Costas Loop @RX', #name 1 #number of inputs ) self.qtgui_const_sink_x_0.set_update_time(0.10) self.qtgui_const_sink_x_0.set_y_axis(-2, 2) self.qtgui_const_sink_x_0.set_x_axis(-2, 2) self.qtgui_const_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") self.qtgui_const_sink_x_0.enable_autoscale(False) self.qtgui_const_sink_x_0.enable_grid(False) self.qtgui_const_sink_x_0.enable_axis_labels(True) if not True: self.qtgui_const_sink_x_0.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "red", "red", "red", "red", "red", "red", "red", "red" ] styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] markers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_const_sink_x_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_const_sink_x_0.set_line_label(i, labels[i]) self.qtgui_const_sink_x_0.set_line_width(i, widths[i]) self.qtgui_const_sink_x_0.set_line_color(i, colors[i]) self.qtgui_const_sink_x_0.set_line_style(i, styles[i]) self.qtgui_const_sink_x_0.set_line_marker(i, markers[i]) self.qtgui_const_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_const_sink_x_0_win = sip.wrapinstance( self.qtgui_const_sink_x_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_const_sink_x_0_win, 3, 2, 1, 1) self.digital_psk_mod_0 = digital.psk.psk_mod( constellation_points=arity, mod_code="gray", differential=True, samples_per_symbol=sps, excess_bw=0.35, verbose=False, log=False, ) self.digital_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_ccf( sps, timing_loop_bw, (rrc_taps), nfilts, nfilts / 2, 1.5, 2) self.digital_costas_loop_cc_0 = digital.costas_loop_cc( phase_bw, arity, False) self.digital_cma_equalizer_cc_0 = digital.cma_equalizer_cc( 15, 1, eq_gain, 2) self.channels_dynamic_channel_model_0 = channels.dynamic_channel_model( samp_rate, 0.01, 1e3, 0.01, 1e3, 8, 2.0, False, 4.0, (pdp_times), (pdp_mags), 8, noise_volt, 0) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1, 100e3, True) self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vcc( (.5 + .5j, )) self.analog_random_source_x_0 = blocks.vector_source_b( map(int, numpy.random.randint(0, 256, number_of_samples)), True) ################################################## # Connections ################################################## self.connect((self.analog_random_source_x_0, 0), (self.digital_psk_mod_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.qtgui_const_sink_x_1_0_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.channels_dynamic_channel_model_0, 0)) self.connect((self.channels_dynamic_channel_model_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0)) self.connect((self.channels_dynamic_channel_model_0, 0), (self.qtgui_const_sink_x_1_0_0_0, 0)) self.connect((self.digital_cma_equalizer_cc_0, 0), (self.digital_costas_loop_cc_0, 0)) self.connect((self.digital_cma_equalizer_cc_0, 0), (self.qtgui_const_sink_x_1_1, 0)) self.connect((self.digital_costas_loop_cc_0, 0), (self.qtgui_const_sink_x_0, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.digital_cma_equalizer_cc_0, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.qtgui_const_sink_x_1, 0)) self.connect((self.digital_psk_mod_0, 0), (self.blocks_multiply_const_vxx_0, 0)) self.connect((self.digital_psk_mod_0, 0), (self.qtgui_const_sink_x_1_0, 0))
def __init__(self): gr.top_block.__init__( self, "OFDM in the presence of fast fading, channel and hardware impairments" ) Qt.QWidget.__init__(self) self.setWindowTitle( "OFDM in the presence of fast fading, channel and hardware impairments" ) try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "ofdm_simulation") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.vec_length = vec_length = 1 self.update_period = update_period = 0.10 self.timing = timing = 1.0001 self.samp_rate = samp_rate = 7.68e6 self.q_offset = q_offset = 0 self.phase_noise = phase_noise = 0 self.packet_len = packet_len = 50 self.num_of_points = num_of_points = 1024 self.noise = noise = 1.2 self.len_tag_key = len_tag_key = "packet_len" self.iq_ph = iq_ph = 0 self.iq_mag = iq_mag = 0 self.i_offset = i_offset = 0 self.freq = freq = 0.01 self.fft_len = fft_len = 128 self.dist3 = dist3 = 0 self.dist2 = dist2 = 0 self.cfo_std = cfo_std = 0.01 ################################################## # Blocks ################################################## self._timing_range = Range(0.999, 1.001, 0.0001, 1.0001, 200) self._timing_win = RangeWidget(self._timing_range, self.set_timing, 'Timing Offset', "slider", float) self.top_grid_layout.addWidget(self._timing_win, 0, 2, 1, 1) self._q_offset_range = Range(-1, 1, 0.01, 0, 200) self._q_offset_win = RangeWidget(self._q_offset_range, self.set_q_offset, 'Quadrature Offset', "slider", float) self.top_grid_layout.addWidget(self._q_offset_win, 1, 3, 1, 1) self._phase_noise_range = Range(0, 40, 0.5, 0, 200) self._phase_noise_win = RangeWidget(self._phase_noise_range, self.set_phase_noise, 'Phase Noise', "slider", float) self.top_grid_layout.addWidget(self._phase_noise_win, 0, 3, 1, 1) self._noise_range = Range(0, 2, 0.01, 1.2, 200) self._noise_win = RangeWidget(self._noise_range, self.set_noise, 'Noise Voltage', "slider", float) self.top_grid_layout.addWidget(self._noise_win, 0, 0, 1, 1) self._iq_ph_range = Range(-3.14, 3.14, 0.01, 0, 200) self._iq_ph_win = RangeWidget(self._iq_ph_range, self.set_iq_ph, 'IQ Phase Imbalance', "slider", float) self.top_grid_layout.addWidget(self._iq_ph_win, 1, 1, 1, 1) self._iq_mag_range = Range(0, 1, 0.01, 0, 200) self._iq_mag_win = RangeWidget(self._iq_mag_range, self.set_iq_mag, 'IQ Mag. Imbalance', "slider", float) self.top_grid_layout.addWidget(self._iq_mag_win, 1, 0, 1, 1) self._i_offset_range = Range(-1, 1, 0.01, 0, 200) self._i_offset_win = RangeWidget(self._i_offset_range, self.set_i_offset, 'Inphase Offset', "slider", float) self.top_grid_layout.addWidget(self._i_offset_win, 1, 2, 1, 1) self._freq_range = Range(-1, 1, 0.01, 0.01, 200) self._freq_win = RangeWidget(self._freq_range, self.set_freq, 'Frequency Offset', "slider", float) self.top_grid_layout.addWidget(self._freq_win, 0, 1, 1, 1) self._dist3_range = Range(0, 0.1, 0.0001, 0, 200) self._dist3_win = RangeWidget(self._dist3_range, self.set_dist3, 'Third Order Dist', "slider", float) self.top_grid_layout.addWidget(self._dist3_win, 2, 1, 1, 1) self._dist2_range = Range(0, 0.1, 0.0001, 0, 200) self._dist2_win = RangeWidget(self._dist2_range, self.set_dist2, '2nd Order Dist.', "slider", float) self.top_grid_layout.addWidget(self._dist2_win, 2, 0, 1, 1) self._cfo_std_range = Range(0, 0.1, 0.01, 0.01, 200) self._cfo_std_win = RangeWidget(self._cfo_std_range, self.set_cfo_std, 'CFO standart deviation ', "slider", float) self.top_grid_layout.addWidget(self._cfo_std_win, 2, 2, 1, 1) self.qtgui_waterfall_sink_x_1_0 = qtgui.waterfall_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc samp_rate, #bw "GT GUI Waterfall Sink- TX Output", #name 1 #number of inputs ) self.qtgui_waterfall_sink_x_1_0.set_update_time(0.10) self.qtgui_waterfall_sink_x_1_0.enable_grid(False) self.qtgui_waterfall_sink_x_1_0.enable_axis_labels(True) if not True: self.qtgui_waterfall_sink_x_1_0.disable_legend() if "complex" == "float" or "complex" == "msg_float": self.qtgui_waterfall_sink_x_1_0.set_plot_pos_half(not True) labels = ['', '', '', '', '', '', '', '', '', ''] colors = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_waterfall_sink_x_1_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_waterfall_sink_x_1_0.set_line_label(i, labels[i]) self.qtgui_waterfall_sink_x_1_0.set_color_map(i, colors[i]) self.qtgui_waterfall_sink_x_1_0.set_line_alpha(i, alphas[i]) self.qtgui_waterfall_sink_x_1_0.set_intensity_range(-140, 10) self._qtgui_waterfall_sink_x_1_0_win = sip.wrapinstance( self.qtgui_waterfall_sink_x_1_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_waterfall_sink_x_1_0_win, 4, 2, 1, 1) self.qtgui_waterfall_sink_x_1 = qtgui.waterfall_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc samp_rate, #bw "GT GUI Waterfall Sink-TX Output", #name 1 #number of inputs ) self.qtgui_waterfall_sink_x_1.set_update_time(0.10) self.qtgui_waterfall_sink_x_1.enable_grid(False) self.qtgui_waterfall_sink_x_1.enable_axis_labels(True) if not True: self.qtgui_waterfall_sink_x_1.disable_legend() if "complex" == "float" or "complex" == "msg_float": self.qtgui_waterfall_sink_x_1.set_plot_pos_half(not True) labels = ['', '', '', '', '', '', '', '', '', ''] colors = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_waterfall_sink_x_1.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_waterfall_sink_x_1.set_line_label(i, labels[i]) self.qtgui_waterfall_sink_x_1.set_color_map(i, colors[i]) self.qtgui_waterfall_sink_x_1.set_line_alpha(i, alphas[i]) self.qtgui_waterfall_sink_x_1.set_intensity_range(-140, 10) self._qtgui_waterfall_sink_x_1_win = sip.wrapinstance( self.qtgui_waterfall_sink_x_1.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_waterfall_sink_x_1_win, 3, 3, 1, 1) self.qtgui_waterfall_sink_x_0 = qtgui.waterfall_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc samp_rate, #bw 'QT GUI Waterfall Sink - RX RF front-end output', #name 1 #number of inputs ) self.qtgui_waterfall_sink_x_0.set_update_time(0.10) self.qtgui_waterfall_sink_x_0.enable_grid(False) self.qtgui_waterfall_sink_x_0.enable_axis_labels(True) if not True: self.qtgui_waterfall_sink_x_0.disable_legend() if "complex" == "float" or "complex" == "msg_float": self.qtgui_waterfall_sink_x_0.set_plot_pos_half(not True) labels = ['Rx', '', '', '', '', '', '', '', '', ''] colors = [3, 0, 0, 0, 0, 0, 0, 0, 0, 0] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_waterfall_sink_x_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_waterfall_sink_x_0.set_line_label(i, labels[i]) self.qtgui_waterfall_sink_x_0.set_color_map(i, colors[i]) self.qtgui_waterfall_sink_x_0.set_line_alpha(i, alphas[i]) self.qtgui_waterfall_sink_x_0.set_intensity_range(-140, 10) self._qtgui_waterfall_sink_x_0_win = sip.wrapinstance( self.qtgui_waterfall_sink_x_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_waterfall_sink_x_0_win, 5, 2, 1, 1) self.qtgui_time_sink_x_0_1 = qtgui.time_sink_f( num_of_points, #size samp_rate, #samp_rate 'Random source output', #name 1 #number of inputs ) self.qtgui_time_sink_x_0_1.set_update_time(update_period) self.qtgui_time_sink_x_0_1.set_y_axis(-1, 1) self.qtgui_time_sink_x_0_1.set_y_label("", "") self.qtgui_time_sink_x_0_1.enable_tags(-1, True) self.qtgui_time_sink_x_0_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0_1.enable_autoscale(True) self.qtgui_time_sink_x_0_1.enable_grid(False) self.qtgui_time_sink_x_0_1.enable_axis_labels(True) self.qtgui_time_sink_x_0_1.enable_control_panel(False) if not True: self.qtgui_time_sink_x_0_1.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue" ] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_time_sink_x_0_1.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_0_1.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0_1.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0_1.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0_1.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0_1.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0_1.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_1_win = sip.wrapinstance( self.qtgui_time_sink_x_0_1.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_1_win, 3, 0, 1, 1) self.qtgui_time_sink_x_0_0_0_0 = qtgui.time_sink_f( 1024, #size samp_rate, #samp_rate "QT GUI Time Sink - RX RF front-end output", #name 1 #number of inputs ) self.qtgui_time_sink_x_0_0_0_0.set_update_time(0.10) self.qtgui_time_sink_x_0_0_0_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_0_0_0_0.set_y_label('Amplitude', "") self.qtgui_time_sink_x_0_0_0_0.enable_tags(-1, True) self.qtgui_time_sink_x_0_0_0_0.set_trigger_mode( qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0_0_0_0.enable_autoscale(True) self.qtgui_time_sink_x_0_0_0_0.enable_grid(False) self.qtgui_time_sink_x_0_0_0_0.enable_axis_labels(True) self.qtgui_time_sink_x_0_0_0_0.enable_control_panel(False) if not True: self.qtgui_time_sink_x_0_0_0_0.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue" ] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_time_sink_x_0_0_0_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_0_0_0_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0_0_0_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0_0_0_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0_0_0_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0_0_0_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0_0_0_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_0_0_0_win = sip.wrapinstance( self.qtgui_time_sink_x_0_0_0_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_0_0_0_win, 6, 0, 1, 1) self.qtgui_time_sink_x_0_0_0 = qtgui.time_sink_c( 1024, #size samp_rate, #samp_rate "QT GUI Time Sink - RX RF front-end output", #name 1 #number of inputs ) self.qtgui_time_sink_x_0_0_0.set_update_time(0.10) self.qtgui_time_sink_x_0_0_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_0_0_0.set_y_label('Amplitude', "") self.qtgui_time_sink_x_0_0_0.enable_tags(-1, True) self.qtgui_time_sink_x_0_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0_0_0.enable_autoscale(True) self.qtgui_time_sink_x_0_0_0.enable_grid(False) self.qtgui_time_sink_x_0_0_0.enable_axis_labels(True) self.qtgui_time_sink_x_0_0_0.enable_control_panel(False) if not True: self.qtgui_time_sink_x_0_0_0.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue" ] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(2 * 1): if len(labels[i]) == 0: if (i % 2 == 0): self.qtgui_time_sink_x_0_0_0.set_line_label( i, "Re{{Data {0}}}".format(i / 2)) else: self.qtgui_time_sink_x_0_0_0.set_line_label( i, "Im{{Data {0}}}".format(i / 2)) else: self.qtgui_time_sink_x_0_0_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0_0_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0_0_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0_0_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0_0_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0_0_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_0_0_win = sip.wrapinstance( self.qtgui_time_sink_x_0_0_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_0_0_win, 5, 0, 1, 1) self.qtgui_time_sink_x_0_0 = qtgui.time_sink_c( 1024, #size samp_rate, #samp_rate "QT GUI Time Sink - Channel output", #name 1 #number of inputs ) self.qtgui_time_sink_x_0_0.set_update_time(0.10) self.qtgui_time_sink_x_0_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_0_0.set_y_label('Amplitude', "") self.qtgui_time_sink_x_0_0.enable_tags(-1, True) self.qtgui_time_sink_x_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0_0.enable_autoscale(True) self.qtgui_time_sink_x_0_0.enable_grid(False) self.qtgui_time_sink_x_0_0.enable_axis_labels(True) self.qtgui_time_sink_x_0_0.enable_control_panel(False) if not True: self.qtgui_time_sink_x_0_0.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue" ] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(2 * 1): if len(labels[i]) == 0: if (i % 2 == 0): self.qtgui_time_sink_x_0_0.set_line_label( i, "Re{{Data {0}}}".format(i / 2)) else: self.qtgui_time_sink_x_0_0.set_line_label( i, "Im{{Data {0}}}".format(i / 2)) else: self.qtgui_time_sink_x_0_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_0_win = sip.wrapinstance( self.qtgui_time_sink_x_0_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_0_win, 4, 0, 1, 1) self.qtgui_time_sink_x_0 = qtgui.time_sink_c( num_of_points, #size samp_rate, #samp_rate "QT GUI Time Sink - TX output", #name 1 #number of inputs ) self.qtgui_time_sink_x_0.set_update_time(0.10) self.qtgui_time_sink_x_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_0.set_y_label('Amplitude', "") self.qtgui_time_sink_x_0.enable_tags(-1, True) self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0.enable_autoscale(True) self.qtgui_time_sink_x_0.enable_grid(False) self.qtgui_time_sink_x_0.enable_axis_labels(True) self.qtgui_time_sink_x_0.enable_control_panel(False) if not True: self.qtgui_time_sink_x_0.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue" ] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(2 * 1): if len(labels[i]) == 0: if (i % 2 == 0): self.qtgui_time_sink_x_0.set_line_label( i, "Re{{Data {0}}}".format(i / 2)) else: self.qtgui_time_sink_x_0.set_line_label( i, "Im{{Data {0}}}".format(i / 2)) else: self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_win = sip.wrapinstance( self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_win, 3, 1, 1, 1) self.qtgui_number_sink_0 = qtgui.number_sink(gr.sizeof_float, 0, qtgui.NUM_GRAPH_VERT, 1) self.qtgui_number_sink_0.set_update_time(0.10) self.qtgui_number_sink_0.set_title("") labels = ['', '', '', '', '', '', '', '', '', ''] units = ['', '', '', '', '', '', '', '', '', ''] colors = [("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black")] factor = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] for i in xrange(1): self.qtgui_number_sink_0.set_min(i, -1) self.qtgui_number_sink_0.set_max(i, 0) self.qtgui_number_sink_0.set_color(i, colors[i][0], colors[i][1]) if len(labels[i]) == 0: self.qtgui_number_sink_0.set_label(i, "Data {0}".format(i)) else: self.qtgui_number_sink_0.set_label(i, labels[i]) self.qtgui_number_sink_0.set_unit(i, units[i]) self.qtgui_number_sink_0.set_factor(i, factor[i]) self.qtgui_number_sink_0.enable_autoscale(True) self._qtgui_number_sink_0_win = sip.wrapinstance( self.qtgui_number_sink_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_number_sink_0_win, 6, 1, 1, 1) self.qtgui_freq_sink_x_1_0 = qtgui.freq_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc samp_rate, #bw "QT GUI Frequency Sink - TX Output", #name 1 #number of inputs ) self.qtgui_freq_sink_x_1_0.set_update_time(0.10) self.qtgui_freq_sink_x_1_0.set_y_axis(-140, 10) self.qtgui_freq_sink_x_1_0.set_y_label('Relative Gain', 'dB') self.qtgui_freq_sink_x_1_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") self.qtgui_freq_sink_x_1_0.enable_autoscale(False) self.qtgui_freq_sink_x_1_0.enable_grid(False) self.qtgui_freq_sink_x_1_0.set_fft_average(1.0) self.qtgui_freq_sink_x_1_0.enable_axis_labels(True) self.qtgui_freq_sink_x_1_0.enable_control_panel(False) if not True: self.qtgui_freq_sink_x_1_0.disable_legend() if "complex" == "float" or "complex" == "msg_float": self.qtgui_freq_sink_x_1_0.set_plot_pos_half(not True) labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "dark blue" ] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_freq_sink_x_1_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_freq_sink_x_1_0.set_line_label(i, labels[i]) self.qtgui_freq_sink_x_1_0.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_1_0.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_1_0.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_1_0_win = sip.wrapinstance( self.qtgui_freq_sink_x_1_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_freq_sink_x_1_0_win, 4, 1, 1, 1) self.qtgui_freq_sink_x_1 = qtgui.freq_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc samp_rate, #bw "QT GUI Frequency Sink - TX Output", #name 1 #number of inputs ) self.qtgui_freq_sink_x_1.set_update_time(0.10) self.qtgui_freq_sink_x_1.set_y_axis(-140, 10) self.qtgui_freq_sink_x_1.set_y_label('Relative Gain', 'dB') self.qtgui_freq_sink_x_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") self.qtgui_freq_sink_x_1.enable_autoscale(True) self.qtgui_freq_sink_x_1.enable_grid(False) self.qtgui_freq_sink_x_1.set_fft_average(1.0) self.qtgui_freq_sink_x_1.enable_axis_labels(True) self.qtgui_freq_sink_x_1.enable_control_panel(False) if not True: self.qtgui_freq_sink_x_1.disable_legend() if "complex" == "float" or "complex" == "msg_float": self.qtgui_freq_sink_x_1.set_plot_pos_half(not True) labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "dark blue" ] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_freq_sink_x_1.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_freq_sink_x_1.set_line_label(i, labels[i]) self.qtgui_freq_sink_x_1.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_1.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_1.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_1_win = sip.wrapinstance( self.qtgui_freq_sink_x_1.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_freq_sink_x_1_win, 3, 2, 1, 1) self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc samp_rate, #bw 'QT GUI Frequenx=cy Sink - RX RF front-end output', #name 1 #number of inputs ) self.qtgui_freq_sink_x_0.set_update_time(0.10) self.qtgui_freq_sink_x_0.set_y_axis(-80, 10) self.qtgui_freq_sink_x_0.set_y_label('Relative Gain', 'dB') self.qtgui_freq_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") self.qtgui_freq_sink_x_0.enable_autoscale(False) self.qtgui_freq_sink_x_0.enable_grid(False) self.qtgui_freq_sink_x_0.set_fft_average(1.0) self.qtgui_freq_sink_x_0.enable_axis_labels(True) self.qtgui_freq_sink_x_0.enable_control_panel(False) if not True: self.qtgui_freq_sink_x_0.disable_legend() if "complex" == "float" or "complex" == "msg_float": self.qtgui_freq_sink_x_0.set_plot_pos_half(not True) labels = ['Rx', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "dark blue" ] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_freq_sink_x_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_freq_sink_x_0.set_line_label(i, labels[i]) self.qtgui_freq_sink_x_0.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_0.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_0_win = sip.wrapinstance( self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_freq_sink_x_0_win, 5, 1, 1, 1) self.fec_ber_bf_0 = fec.ber_bf(False, 100, -7.0) self.digital_ofdm_tx_0 = digital.ofdm_tx( fft_len=fft_len, cp_len=fft_len / 4, packet_length_tag_key=len_tag_key, bps_header=1, bps_payload=2, rolloff=0, debug_log=False, scramble_bits=False) self.digital_ofdm_rx_0 = digital.ofdm_rx( fft_len=fft_len, cp_len=fft_len / 4, frame_length_tag_key='frame_' + "rx_len", packet_length_tag_key="rx_len", bps_header=1, bps_payload=2, debug_log=False, scramble_bits=False) self.channels_impairments_0 = channels.impairments( phase_noise, iq_mag, iq_ph, q_offset, i_offset, 0, dist2, dist3) self.channels_dynamic_channel_model_0 = channels.dynamic_channel_model( samp_rate, 0.01, 1e3, cfo_std, 1e3, 8, 2.0, False, 4.0, (-0.0025, -0.00125, 0.0, 0.00125, 0.0025, 0.00375, 0.005, 0.00625, 0.0075, 0.00875, 0.01, 0.01125, 0.0125, 0.015, 0.01625, 0.0175, 0.01875, 0.02, 0.02125, 0.0225, 0.02375, 0.025, 0.0275, 0.02875, 0.03, 0.03125, 0.0325, 0.03375, 0.035, 0.03625, 0.0375, 0.03875, 0.04, 0.04125, 0.0425, 0.04375, 0.045, 0.04625, 0.0475, 0.05125, 0.0525, 0.055, 0.05625, 0.0575, 0.06, 0.06375, 0.065, 0.06625, 0.0675, 0.06875, 0.0725, 0.08, 0.08125, 0.085, 0.08625, 0.0875, 0.08875, 0.09125, 0.0925, 0.09375, 0.095, 0.09875, 0.1, 0.1075, 0.10875, 0.11, 0.11125, 0.13125, 0.1325), (0.16529889, 0.46954084, 0.58274825, 0.24561255, 0.50459457, 0.69767633, 1.0, 0.77724474, 0.48675226, 0.46954084, 0.21267289, 0.19090106, 0.31600413, 0.45293801, 0.8057353, 0.64920938, 0.50459457, 0.1978987, 0.35204369, 0.54226525, 0.31600413, 0.15945397, 0.2204686, 0.35204369, 0.37832563, 0.37832563, 0.36494815, 0.2204686, 0.17763933, 0.45293801, 0.52309091, 0.52309091, 0.46954084, 0.35204369, 0.40656966, 0.25461568, 0.23692776, 0.32758753, 0.1978987, 0.21267289, 0.2204686, 0.19090106, 0.24561255, 0.17135806, 0.21267289, 0.16529889, 0.2204686, 0.30483032, 0.33959553, 0.18415085, 0.18415085, 0.22855006, 0.2940516, 0.19090106, 0.17135806, 0.18415085, 0.1978987, 0.17763933, 0.15945397, 0.26394884, 0.24561255, 0.21267289, 0.19090106, 0.17763933, 0.2204686, 0.21267289, 0.17135806, 0.17135806, 0.16529889), 8, 1.0, 0) self.channels_channel_model_0 = channels.channel_model( noise_voltage=noise, frequency_offset=freq, epsilon=timing, taps=(1.0, ), noise_seed=0, block_tags=False) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1, samp_rate, True) self.blocks_tag_debug_0 = blocks.tag_debug(gr.sizeof_char * 1, '', 'packet_num') self.blocks_tag_debug_0.set_display(True) self.blocks_stream_to_tagged_stream_0 = blocks.stream_to_tagged_stream( gr.sizeof_char, vec_length, packet_len, len_tag_key) self.blocks_ctrlport_monitor_performance_0 = not True or monitor( "gr-perf-monitorx") self.blocks_char_to_float_0_0 = blocks.char_to_float(1, 1) self.blocks_char_to_float_0 = blocks.char_to_float(1, 1) self.analog_random_source_x_0 = blocks.vector_source_b( map(int, numpy.random.randint(0, 256, 1000)), True) ################################################## # Connections ################################################## self.connect((self.analog_random_source_x_0, 0), (self.blocks_char_to_float_0, 0)) self.connect((self.analog_random_source_x_0, 0), (self.blocks_stream_to_tagged_stream_0, 0)) self.connect((self.analog_random_source_x_0, 0), (self.fec_ber_bf_0, 0)) self.connect((self.blocks_char_to_float_0, 0), (self.qtgui_time_sink_x_0_1, 0)) self.connect((self.blocks_char_to_float_0_0, 0), (self.qtgui_time_sink_x_0_0_0_0, 0)) self.connect((self.blocks_stream_to_tagged_stream_0, 0), (self.digital_ofdm_tx_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.channels_dynamic_channel_model_0, 0)) self.connect((self.channels_channel_model_0, 0), (self.channels_impairments_0, 0)) self.connect((self.channels_channel_model_0, 0), (self.qtgui_freq_sink_x_1_0, 0)) self.connect((self.channels_channel_model_0, 0), (self.qtgui_time_sink_x_0_0, 0)) self.connect((self.channels_channel_model_0, 0), (self.qtgui_waterfall_sink_x_1_0, 0)) self.connect((self.channels_dynamic_channel_model_0, 0), (self.channels_channel_model_0, 0)) self.connect((self.channels_impairments_0, 0), (self.digital_ofdm_rx_0, 0)) self.connect((self.channels_impairments_0, 0), (self.qtgui_freq_sink_x_0, 0)) self.connect((self.channels_impairments_0, 0), (self.qtgui_time_sink_x_0_0_0, 0)) self.connect((self.channels_impairments_0, 0), (self.qtgui_waterfall_sink_x_0, 0)) self.connect((self.digital_ofdm_rx_0, 0), (self.blocks_char_to_float_0_0, 0)) self.connect((self.digital_ofdm_rx_0, 0), (self.blocks_tag_debug_0, 0)) self.connect((self.digital_ofdm_rx_0, 0), (self.fec_ber_bf_0, 1)) self.connect((self.digital_ofdm_tx_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.digital_ofdm_tx_0, 0), (self.qtgui_freq_sink_x_1, 0)) self.connect((self.digital_ofdm_tx_0, 0), (self.qtgui_time_sink_x_0, 0)) self.connect((self.digital_ofdm_tx_0, 0), (self.qtgui_waterfall_sink_x_1, 0)) self.connect((self.fec_ber_bf_0, 0), (self.qtgui_number_sink_0, 0))
insufficient_modsnr_vectors = True modvec_indx = 0 while insufficient_modsnr_vectors: tx_len = int(10e3) if mod_type.modname == "QAM16": tx_len = int(20e3) if mod_type.modname == "QAM64": tx_len = int(30e3) src = source_alphabet(alphabet_type, tx_len, True) mod = mod_type() fD = 1 delays = [0.0, 0.9, 1.7] mags = [1, 0.8, 0.3] ntaps = 8 noise_amp = 10**(-snr/10.0) chan = channels.dynamic_channel_model( 200e3, 0, 0, 0, 0, 8, 1, False, 4.0, (0, ), (1, ), ntaps, noise_amp, noise_seed=2018 ) #chan = channels.dynamic_channel_model( 200e3, 0.01, 50, .01, 0.5e3, 8, fD, True, 4, delays, mags, ntaps, noise_amp, 0x1337 ) snk = blocks.vector_sink_c() tb = gr.top_block() # connect blockss if apply_channel: tb.connect(src, mod, chan, snk) else: tb.connect(src, mod, snk) tb.run() raw_output_vector = np.array(snk.data(), dtype=np.complex64) # start the sampler some random time after channel model transients (arbitrary values here) sampler_indx = random.randint(50, 500)
cfo_max_dev = 500 # maximum carrier frequency offset in Hz N_sinusoids = 8 # number of sinusoids used in frequency selective fading simulation fD = 1 # doppler frequency LOS_model = True # defines whether the fading model should include a line of site component. LOS->Rician, NLOS->Rayleigh K_factor = 4 # Rician K-factor, the ratio of specular to diffuse power in the model delays = [ 0.0, 0.9, 1.7 ] # A list of fractional sample delays making up the power delay profile mags = [ 1, 0.8, 0.3 ] # A list of magnitudes corresponding to each delay time in the power delay profile ntaps = 8 # The length of the filter to interpolate the power delay profile over. Delays in the PDP must lie between 0 and ntaps_mpath, fractional delays will be sinc-interpolated only to the width of this filter. noise_amp = 10**(-snr / 10.0 ) # Specifies the standard deviation of the AWGN process chan = channels.dynamic_channel_model(sample_rate, sro_std_dev, sro_max_dev, cfo_std_dev, cfo_max_dev, N_sinusoids, fD, LOS_model, K_factor, delays, mags, ntaps, noise_amp, 0x1337) # add an optional eth sink #snk_udp = blocks.udp_sink(gr.sizeof_float*1, '192.168.1.187', 45000, 1472, True)) snk = blocks.vector_sink_c() tb = gr.top_block() # connect blocks print "starting source: " + str(src) + "and mod: " + str(mod) if apply_channel: tb.connect(src, mod, chan, snk) else: tb.connect(src, mod, snk) tb.run()
def __init__(self): gr.top_block.__init__(self, "Top Block") Qt.QWidget.__init__(self) self.setWindowTitle("Top Block") try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "top_block") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.sym = sym = 2 self.samp_rate = samp_rate = 200e3 ################################################## # Blocks ################################################## self.qtgui_time_sink_x_0 = qtgui.time_sink_c( 1024, #size samp_rate, #samp_rate "", #name 1 #number of inputs ) self.qtgui_time_sink_x_0.set_update_time(0.10) self.qtgui_time_sink_x_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_0.set_y_label('Amplitude', "") self.qtgui_time_sink_x_0.enable_tags(-1, True) self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0.enable_autoscale(False) self.qtgui_time_sink_x_0.enable_grid(False) self.qtgui_time_sink_x_0.enable_axis_labels(True) self.qtgui_time_sink_x_0.enable_control_panel(False) if not True: self.qtgui_time_sink_x_0.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue" ] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(2 * 1): if len(labels[i]) == 0: if (i % 2 == 0): self.qtgui_time_sink_x_0.set_line_label( i, "Re{{Data {0}}}".format(i / 2)) else: self.qtgui_time_sink_x_0.set_line_label( i, "Im{{Data {0}}}".format(i / 2)) else: self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_win = sip.wrapinstance( self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_time_sink_x_0_win) self.inspector_tfmodel_vcf_0 = inspector.tfmodel_vcf( "complex64", 128, '/tmp/cnn/00000001', (), 0) self.digital_psk_mod_0 = digital.psk.psk_mod( constellation_points=2, mod_code="gray", differential=True, samples_per_symbol=sym, excess_bw=0.35, verbose=False, log=False, ) snr = 20 fD = 1 delays = [0.0, 0.9, 1.7] mags = [1, 0.8, 0.3] ntaps = 8 noise_amp = 10**(-snr / 10.0) self.channels_dynamic_channel_model_0 = channels.dynamic_channel_model( 200e3, 0.01, 50, .01, 0.5e3, 8, fD, True, 4, delays, mags, ntaps, noise_amp, 0x1337) #self.channels_dynamic_channel_model_0 = channels.dynamic_channel_model( samp_rate, 0.01, 1e3, 50, 1e3, 8, 2.0, False, 4.0, (0.0,0.1,1.3), (1,0.99,0.97), 8, 1.0, 0 ) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1, samp_rate, True) self.blocks_stream_to_vector_0 = blocks.stream_to_vector( gr.sizeof_gr_complex * 1, 128) self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vcc((0.3, )) self.blocks_message_debug_0 = blocks.message_debug() self.analog_random_source_x_0 = blocks.vector_source_b( map(int, numpy.random.randint(0, 256, 100000)), True) ################################################## # Connections ################################################## self.msg_connect((self.inspector_tfmodel_vcf_0, 'classification'), (self.blocks_message_debug_0, 'print')) self.connect((self.analog_random_source_x_0, 0), (self.digital_psk_mod_0, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.channels_dynamic_channel_model_0, 0)) self.connect((self.blocks_stream_to_vector_0, 0), (self.inspector_tfmodel_vcf_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.blocks_multiply_const_vxx_0, 0)) self.connect((self.channels_dynamic_channel_model_0, 0), (self.blocks_stream_to_vector_0, 0)) self.connect((self.channels_dynamic_channel_model_0, 0), (self.qtgui_time_sink_x_0, 0)) self.connect((self.digital_psk_mod_0, 0), (self.blocks_throttle_0, 0))
def __init__(self): gr.top_block.__init__(self, "Top Block") Qt.QWidget.__init__(self) self.setWindowTitle("Top Block") try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "top_block") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.sym = sym = 2 self.samp_rate = samp_rate = 200e3 ################################################## # Blocks ################################################## self.qtgui_time_sink_x_0 = qtgui.time_sink_c( 1024, #size samp_rate, #samp_rate "", #name 1 #number of inputs ) self.qtgui_time_sink_x_0.set_update_time(0.10) self.qtgui_time_sink_x_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_0.set_y_label('Amplitude', "") self.qtgui_time_sink_x_0.enable_tags(-1, True) self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0.enable_autoscale(False) self.qtgui_time_sink_x_0.enable_grid(False) self.qtgui_time_sink_x_0.enable_axis_labels(True) self.qtgui_time_sink_x_0.enable_control_panel(False) if not True: self.qtgui_time_sink_x_0.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue"] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(2*1): if len(labels[i]) == 0: if(i % 2 == 0): self.qtgui_time_sink_x_0.set_line_label(i, "Re{{Data {0}}}".format(i/2)) else: self.qtgui_time_sink_x_0.set_line_label(i, "Im{{Data {0}}}".format(i/2)) else: self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_time_sink_x_0_win) self.inspector_tfmodel_vcf_0 = inspector.tfmodel_vcf("complex64",128,'/tmp/cnn/00000001',(),0) self.digital_psk_mod_0 = digital.psk.psk_mod( constellation_points=2, mod_code="gray", differential=True, samples_per_symbol=sym, excess_bw=0.35, verbose=False, log=False, ) snr = 20 fD = 1 delays = [0.0, 0.9, 1.7] mags = [1, 0.8, 0.3] ntaps = 8 noise_amp = 10**(-snr/10.0) self.channels_dynamic_channel_model_0 = channels.dynamic_channel_model( 200e3, 0.01, 50, .01, 0.5e3, 8, fD, True, 4, delays, mags, ntaps, noise_amp, 0x1337 ) #self.channels_dynamic_channel_model_0 = channels.dynamic_channel_model( samp_rate, 0.01, 1e3, 50, 1e3, 8, 2.0, False, 4.0, (0.0,0.1,1.3), (1,0.99,0.97), 8, 1.0, 0 ) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True) self.blocks_stream_to_vector_0 = blocks.stream_to_vector(gr.sizeof_gr_complex*1, 128) self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vcc((0.3, )) self.blocks_message_debug_0 = blocks.message_debug() self.analog_random_source_x_0 = blocks.vector_source_b(map(int, numpy.random.randint(0, 256, 100000)), True) ################################################## # Connections ################################################## self.msg_connect((self.inspector_tfmodel_vcf_0, 'classification'), (self.blocks_message_debug_0, 'print')) self.connect((self.analog_random_source_x_0, 0), (self.digital_psk_mod_0, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.channels_dynamic_channel_model_0, 0)) self.connect((self.blocks_stream_to_vector_0, 0), (self.inspector_tfmodel_vcf_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.blocks_multiply_const_vxx_0, 0)) self.connect((self.channels_dynamic_channel_model_0, 0), (self.blocks_stream_to_vector_0, 0)) self.connect((self.channels_dynamic_channel_model_0, 0), (self.qtgui_time_sink_x_0, 0)) self.connect((self.digital_psk_mod_0, 0), (self.blocks_throttle_0, 0))
def __init__(self, fD=10, id_user=0): gr.top_block.__init__(self, "Polar Coding with Coded Caching") ################################################## # Parameters ################################################## self.fD = fD self.id_user = id_user ################################################## # Variables ################################################## self.snr = snr = 25 + 20 * numpy.log10(4) self.pilot_symbols = pilot_symbols = (( 1, 1, 1, -1, ), ) self.pilot_carriers = pilot_carriers = (( -21, -7, 7, 21, ), ) self.payload_mod = payload_mod = digital.constellation_qpsk() self.packet_length_tag_key = packet_length_tag_key = "packet_len" self.occupied_carriers = occupied_carriers = ( range(-26, -21) + range(-20, -7) + range(-6, 0) + range(1, 7) + range(8, 21) + range(22, 27), ) self.length_tag_key = length_tag_key = "frame_len" self.header_mod = header_mod = digital.constellation_bpsk() self.fft_len = fft_len = 64 self.variance = variance = 1 / pow(10, snr / 10.0) self.sync_word2 = sync_word2 = [ 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 1, 1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 0, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 0, 0, 0, 0, 0 ] self.sync_word1 = sync_word1 = [ 0., 0., 0., 0., 0., 0., 0., 1.41421356, 0., -1.41421356, 0., 1.41421356, 0., -1.41421356, 0., -1.41421356, 0., -1.41421356, 0., 1.41421356, 0., -1.41421356, 0., 1.41421356, 0., -1.41421356, 0., -1.41421356, 0., -1.41421356, 0., -1.41421356, 0., 1.41421356, 0., -1.41421356, 0., 1.41421356, 0., 1.41421356, 0., 1.41421356, 0., -1.41421356, 0., 1.41421356, 0., 1.41421356, 0., 1.41421356, 0., -1.41421356, 0., 1.41421356, 0., 1.41421356, 0., 1.41421356, 0., 0., 0., 0., 0., 0. ] self.small_packet_len = small_packet_len = 52 self.samp_rate = samp_rate = int(1e6) self.payload_equalizer = payload_equalizer = digital.ofdm_equalizer_simpledfe( fft_len, payload_mod.base(), occupied_carriers, pilot_carriers, pilot_symbols, 0, 1) self.header_formatter = header_formatter = digital.packet_header_ofdm( occupied_carriers, n_syms=1, len_tag_key=packet_length_tag_key, frame_len_tag_key=length_tag_key, bits_per_header_sym=header_mod.bits_per_symbol(), bits_per_payload_sym=payload_mod.bits_per_symbol(), scramble_header=False) self.header_equalizer = header_equalizer = digital.ofdm_equalizer_simpledfe( fft_len, header_mod.base(), occupied_carriers, pilot_carriers, pilot_symbols, 0, 1) self.gain = gain = 25 self.freq = freq = 2450e6 self.coderate = coderate = [1, 2, 2, 3, 4] self.Users = Users = 4 self.Nbfiles = Nbfiles = 20 self.NbStrgUsers = NbStrgUsers = 1 self.NbChuncks = NbChuncks = 200 self.N = N = 2048 ################################################## # Blocks ################################################## self.zeromq_sub_source_0 = zeromq.sub_source(gr.sizeof_gr_complex, 1, 'tcp://localhost:5565', 100, False, -1) self.zeromq_sub_msg_source_0_0_0 = zeromq.sub_msg_source( 'tcp://localhost:5575', 10) self.zeromq_sub_msg_source_0_0 = zeromq.sub_msg_source( 'tcp://localhost:5555', 10) self.projectCACHE_ofdm_frame_equalizer1_vcvc_0 = projectCACHE.ofdm_frame_equalizer1_vcvc( fft_len, fft_len / 4, length_tag_key, True, occupied_carriers, pilot_carriers, pilot_symbols, 0, True) self.projectCACHE_PolarDec_b_0_0 = projectCACHE.PolarDec_b( N, Nbfiles, NbChuncks, id_user, Users, small_packet_len, 42, coderate[id_user], packet_length_tag_key) self.projectCACHE_PC_Error_Rate_0_0 = projectCACHE.PC_Error_Rate( id_user, 200) self.fft_vxx_1 = fft.fft_vcc(fft_len, True, (), True, 1) self.fft_vxx_0 = fft.fft_vcc(fft_len, True, (()), True, 1) self.digital_probe_mpsk_snr_est_c_0 = digital.probe_mpsk_snr_est_c( 3, 1000, 0.0001) self.digital_packet_headerparser_b_0 = digital.packet_headerparser_b( header_formatter.base()) self.digital_ofdm_sync_sc_cfb_0 = digital.ofdm_sync_sc_cfb( fft_len, fft_len / 4, False, 0.9) self.digital_ofdm_serializer_vcc_payload_0 = digital.ofdm_serializer_vcc( fft_len, occupied_carriers, length_tag_key, packet_length_tag_key, 1, '', True) self.digital_ofdm_serializer_vcc_payload = digital.ofdm_serializer_vcc( fft_len, occupied_carriers, length_tag_key, packet_length_tag_key, 1, '', True) self.digital_ofdm_serializer_vcc_header = digital.ofdm_serializer_vcc( fft_len, occupied_carriers, length_tag_key, '', 0, '', True) self.digital_ofdm_frame_equalizer_vcvc_0 = digital.ofdm_frame_equalizer_vcvc( header_equalizer.base(), fft_len / 4, length_tag_key, True, 1) self.digital_ofdm_chanest_vcvc_0 = digital.ofdm_chanest_vcvc( (sync_word1), (sync_word2), 1, 0, 3, False) self.digital_header_payload_demux_0 = digital.header_payload_demux( 3, fft_len, fft_len / 4, length_tag_key, "", True, gr.sizeof_gr_complex, "rx_time", samp_rate, (), 0, ) self.digital_constellation_decoder_cb_0 = digital.constellation_decoder_cb( header_mod.base()) self.channels_dynamic_channel_model_0 = channels.dynamic_channel_model( samp_rate, 1e-4, 1e2, 1e-4, 1e2, 8, fD, False, 2, (0.0, 0.1, 1.3), (1, 0.99, 0.90), 3, numpy.sqrt(variance), numpy.random.randint(0, 500, None)) self.blocks_multiply_xx_0 = blocks.multiply_vcc(1) self.blocks_delay_0 = blocks.delay(gr.sizeof_gr_complex * 1, fft_len + fft_len / 4) self.analog_frequency_modulator_fc_0 = analog.frequency_modulator_fc( -2.0 / fft_len) ################################################## # Connections ################################################## self.msg_connect((self.digital_packet_headerparser_b_0, 'header_data'), (self.digital_header_payload_demux_0, 'header_data')) self.msg_connect((self.digital_probe_mpsk_snr_est_c_0, 'snr'), (self.projectCACHE_PC_Error_Rate_0_0, 'SNR')) self.msg_connect((self.zeromq_sub_msg_source_0_0, 'out'), (self.projectCACHE_PC_Error_Rate_0_0, 'BER_INFO')) self.msg_connect((self.zeromq_sub_msg_source_0_0_0, 'out'), (self.projectCACHE_PC_Error_Rate_0_0, 'CH_USE')) self.connect((self.analog_frequency_modulator_fc_0, 0), (self.blocks_multiply_xx_0, 0)) self.connect((self.blocks_delay_0, 0), (self.blocks_multiply_xx_0, 1)) self.connect((self.blocks_multiply_xx_0, 0), (self.digital_header_payload_demux_0, 0)) self.connect((self.channels_dynamic_channel_model_0, 0), (self.blocks_delay_0, 0)) self.connect((self.channels_dynamic_channel_model_0, 0), (self.digital_ofdm_sync_sc_cfb_0, 0)) self.connect((self.digital_constellation_decoder_cb_0, 0), (self.digital_packet_headerparser_b_0, 0)) self.connect((self.digital_header_payload_demux_0, 0), (self.fft_vxx_0, 0)) self.connect((self.digital_header_payload_demux_0, 1), (self.fft_vxx_1, 0)) self.connect((self.digital_ofdm_chanest_vcvc_0, 0), (self.digital_ofdm_frame_equalizer_vcvc_0, 0)) self.connect((self.digital_ofdm_frame_equalizer_vcvc_0, 0), (self.digital_ofdm_serializer_vcc_header, 0)) self.connect((self.digital_ofdm_serializer_vcc_header, 0), (self.digital_constellation_decoder_cb_0, 0)) self.connect((self.digital_ofdm_serializer_vcc_payload, 0), (self.projectCACHE_PolarDec_b_0_0, 0)) self.connect((self.digital_ofdm_serializer_vcc_payload_0, 0), (self.digital_probe_mpsk_snr_est_c_0, 0)) self.connect((self.digital_ofdm_sync_sc_cfb_0, 0), (self.analog_frequency_modulator_fc_0, 0)) self.connect((self.digital_ofdm_sync_sc_cfb_0, 1), (self.digital_header_payload_demux_0, 1)) self.connect((self.fft_vxx_0, 0), (self.digital_ofdm_chanest_vcvc_0, 0)) self.connect((self.fft_vxx_1, 0), (self.digital_ofdm_serializer_vcc_payload_0, 0)) self.connect((self.fft_vxx_1, 0), (self.projectCACHE_ofdm_frame_equalizer1_vcvc_0, 0)) self.connect((self.projectCACHE_ofdm_frame_equalizer1_vcvc_0, 0), (self.digital_ofdm_serializer_vcc_payload, 0)) self.connect((self.zeromq_sub_source_0, 0), (self.channels_dynamic_channel_model_0, 0))