USRP as relay


#1

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


#2

Hi Pratik,

I hope this would help you
http://lists.gnu.org/archive/html/discuss-gnuradio/2006-04/msg00196.html

regards,
Tarun

On 7/18/07, pratik hetamsaria removed_email_address@domain.invalid wrote:

code for reference. I am able to see that the usrp reads the data coming at

parser = OptionParser(option_class=eng_option)
    parser.add_option("-q", "--tx-freq", type="eng_float",
self._tx_amplitude = options.tx_amplitude
self.amp = gr.multiply_const_cc(0)
self.amp.set_k(self._tx_amplitude)

#3

hi tarun,

I have been looking at those links only.Rather the entire code which i
have made is based upon that. I came to know how to declare the usrp as
source and sink from the archives. But making it as a relay is somehow
not working and i don’t have any idea where can be the possible mistake.
It would be very helpful if you can point out where i am making the
mistake.

Thanks
Pratik Hetamsaria

Tarun T. removed_email_address@domain.invalid wrote: Hi Pratik,

I hope this would help you
http://lists.gnu.org/archive/html/discuss-gnuradio/2006-04/msg00196.html

regards,
Tarun

On 7/18/07, pratik hetamsaria removed_email_address@domain.invalid wrote:
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.