# # Copyright 2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. # from gnuradio import gr from gnuradio import usrp2 class usrp_transmit_path(gr.hier_block2): def __init__(self): ''' See below for what options should hold ''' gr.hier_block2.__init__(self, "usrp_transmit_path", gr.io_signature(0, 0, 0), # Input signature gr.io_signature(0, 0, 0)) # Output signature sample_freq = 1 sin_freq = 0.1 amplitude = 1 offset = 0 self.src = gr.sig_source_c(sample_freq, gr.GR_SIN_WAVE, sin_freq, amplitude, offset) n_samples = 256 self.head = gr.head(gr.sizeof_gr_complex, n_samples) self.u = usrp2.sink_32fc("eth2","") self.u.set_center_freq(2450e6) self.u.set_interp(128) self.connect(self.src, self.head, self.u)