hi,
I am posting this again as i havent got any concrete replies.I have been
stuck making the usrp work as a relay for a very long time. I am giving
the code which i am using for making it work as a relay. Can somebody
please point out where is the mistake. I am trying to receive a signal
sent by usrp_siggen.py at 910MHz and retransmit it at 950MHz. However,
when i view the signal at 950MHz using usrp_oscope.py then i am able to
see only noise. There is no sine wave present at that frequency. I am
not able to understand what is the usrp transmitting at 950 MHz then.
What i know is that the usrp does receive the sine wave at 910MHz.
PLease point out where is the mistake in my code.
Thanks
Pratik Hetamsaria
class my_graph(gr.flow_graph):
def __init__(self):
gr.flow_graph.__init_ _(self)
parser = OptionParser(option_class=eng_option)
parser.add_option("-R", "--rx-subdev-spec", type="subdev",
default=None)
parser.add_option("-d", “–decim”, type=“int”, default=256)
parser.add_option("-f", “–freq”, type=“eng_float”,
default=910e6)
parser.add_option("-g", “–gain”, type=“eng_float”, default=45)
parser.add_option("-T", “–tx-subdev-spec”, type=“subdev”,
default=None)
parser.add_option("-a", “–tx-amplitude”, type=“eng_float”,
default=32000)
parser.add_option("-q", “–tx-freq”, type=“eng_float”,
default=950e6)
parser.add_option("-i", “–interp”, type=“intx”, default=512)
(options, args) = parser.parse_args()
rx_src = usrp.source_c (0, options.decim)
rx_subdev_spec = (0,0)
rx_src.set_mux(usrp.determine_rx_mux_value(rx_src, rx_subdev_spec))
subdev = usrp.selected_subdev(rx_src, rx_subdev_spec)
r = rx_src.tune(0, subdev, options.freq)
self._tx_amplitude = options.tx_amplitude
self.amp = gr.multiply_const_cc(0)
self.amp.set_k(self._tx_amplitude)
dst = usrp.sink_c(0, options.interp)
if options.tx_subdev_spec is None:
tx_subdev_spec = usrp.pick_tx_subdevice(dst)
dst.set_mux(usrp.determine_tx_mux_value (dst, tx_subdev_spec))
subdev = usrp.selected_subdev(dst, tx_subdev_spec)
r = dst.tune(subdev._which, subdev, options.tx_freq )
filename = "/home/polytech/Desktop/usrp_data_receive.dat"
destination = gr.file_sink(gr.sizeof_gr_complex, filename)
self.connect(rx_src, destination)
self.connect(rx_src, self.amp, dst)
if name == ‘main’:
try:
my_graph().run()
except KeyboardInterrupt:
pass