|
From: | Tarun Tiwari |
Subject: | Re: [Discuss-gnuradio] USRP as relay |
Date: | Thu, 19 Jul 2007 15:08:29 -0500 |
hi..
I want to make the usrp function as a relay for audio files.
Apart from working on rx_voice.py for getting the relay function to work(i have written about the problem faced by me in my previous mail)
http://lists.gnu.org/archive/html/discuss-gnuradio/2007-07/msg00203.html
i just made up a simple code which would do the same.I am attaching the code for reference. I am able to see that the usrp reads the data coming at 910MHz(in my case) which is transmitted by tx_voice.py by writing the data onto a file and then passing it to the demodulator(i am able to see the packets by passing the file as input to rx_voice.py). But, after retransmission at 950MHz , at another machine i am not able to receive any packets. I am able to see that the usrp does transmit something at 950MHz because i can see a spike in a spectrum analyzer at that frequency. I am not able to get what can be the possible problem. Kindly point out if there is any error in my code. Is there any fundamental mistake which i am doing. I have been mailing quite a lot regarding this but not getting any response.
Please help.
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
Get the freedom to save as many mails as you wish. Click here to know how.
_______________________________________________
Discuss-gnuradio mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Prev in Thread] | Current Thread | [Next in Thread] |