TX/RX simultaneously using one USRP board

Hi, Eric and other friends

Now I am working on a project that requires simutaneous TX/RX within
one usrp board. I equip too FLEX400 daughter cards on one USRP board.
What I am trying to do is to use the TX to retransmit (i.e. relay)
what the USRP has received from the RX. Is it doable under the current
framework of GNU Radio? If so, could you provide any hints on how to
realize this? An obvious question to me is that in the Python code, we
should either define the usrp as a source or a sink, but in my
application, the USRP board serves as both sink and source. So what
should I do in my case?

Thank you for your input

Dawei

Hey dawei,

I just recently played with the idea of a repeater (receive on
frequency and transmit on another). ALthough I have personally only
used the TvRx and Basic Tx, the concept is basically the same (I
would imagine) for the FLEX400. I haven’t pushed the data rates, but
for narrowband FM, it works great. I guessing the only bottleneck
might be the USB (8MSps total), but I like I said, I haven’t tested
it. Here was my basic flow graph. It worked like a charm.

dst = usrp.sink_c (0, tx_interp)
self.rx_src = usrp.source_c (0, decim)

self.connect (self.rx_src, rx_amp, fm_demod)
self.connect (fm_demod,rx_filter)
self.connect (rx_filter,tx_filter)

self.connect (tx_filter,freq_mod)
self.connect (freq_mod,tx_amp,dst)

So, essentially the key points are that you can use the usrp as both
a sink and source (its duplexing baby!). The underlying code selects
the most likely subdevice (if you don’t do that yourself), so its
pretty easy really. and where I usually have a sink to a file, audio
card, or whatever (for a receiver chain), I just simply use that as
the source for my normal transmit. Here’s a link to the source code,
I haven’t spent any time making it look pretty, but it should work.
I hope this helps some! Good Luck!

http://www.filebox.vt.edu/~scaperot/FM_Rx_Tx_tvrx.py

David S.

David S. wrote:

dst = usrp.sink_c (0, tx_interp)
self.rx_src = usrp.source_c (0, decim)

self.connect (self.rx_src, rx_amp, fm_demod)
self.connect (fm_demod,rx_filter)
self.connect (rx_filter,tx_filter)

self.connect (tx_filter,freq_mod)
self.connect (freq_mod,tx_amp,dst)
Just curious, why did you first fm_demod and then fm_mod.
You could also do:
if_bandwidth=13e3
if_width_of_transission_band=4e3
tx_interp=rx_decim*2
if_sampling_rate=usrp_sampling_rate/rx_decim
if_filter_coeffs = gr.firdes.low_pass (if_gain, # gain
if_sampling_rate, #
sampling rate
if_bandwidth, #
low pass cutoff freq
if_width_of_transission_band,

width of trans. band

                                      gr.firdes.WIN_HANN) # filter 

type

src = usrp.source_c (0, rx_decim)
dst = usrp.sink_c (0, tx_interp)
if_filter=gr_fir_filter_ccf(1, if_filter_coeffs)

self.connect (src, if_filter,dst)

greetings,
Martin

No reason… ; ) I just put together two old scripts that I had
lying around to see if it would work. My ultimate goal is to
receive, demod and change the modulation, and then retransmit, so
that’s probably what I was thinking about…

hope this clears things up!

David S.

Just curious, why did you first fm_demod and then fm_mod.
You could also do:
src = usrp.source_c (0, rx_decim)
dst = usrp.sink_c (0, tx_interp)
if_filter=gr_fir_filter_ccf(1, if_filter_coeffs)
self.connect (src, if_filter, dst)

By adding a few blocks to the FPGA (like the FIR filter and a feedback
buffer), the implementation could avoid pushing these samples across
the USB entirely, without any changes to the Python code!

[This will become much more useful in later USRPs that have bigger
FPGAs. You could pull out a few received signals, e.g. two or three
FM transmissions out of a wide band, translate each to a different
frequency, mix the results together and feed it out the transmit path,
all on the USRP. While simultaneously having some control channels
that run across the USB to be processed by host system software.
Sounds like a great design for a cellular radio base station.]

John

On Thu, Apr 13, 2006 at 01:47:00PM -0400, Dawei Shen wrote:

Hi, Eric and other friends

Now I am working on a project that requires simutaneous TX/RX within
one usrp board. I equip too FLEX400 daughter cards on one USRP board.

Why do you need two Flex 400’s?

What I am trying to do is to use the TX to retransmit (i.e. relay)
what the USRP has received from the RX. Is it doable under the current
framework of GNU Radio?

Yes it’s possible. No problem. Only takes a single Flex 400, unless
you’re trying to relay RX-A and RX-B at the same time.

u_rx = usrp.source(0, …)
u_tx = usrp.sink(0, …)

Then carry on as usual.

I’d start with a single Flex 400 that reads from the RX and then sends
to the TX. You’re probably going to need some kind of squelch or
power detection to determine whether or not to transmit. In the
simple minded first cut, just send zeros when you don’t want to
transmit.

EVERY REASON IN THE WORLD.

The additional path loss from your transmiter to the next recipients
receiver through a linear “transponder” might be all the difference in
the world in FM copy that is usable and too noisy to use.

All of this code could not be more timely. I thank you all. I am
building a linear and a digital “transponder” using the Flex400 and
Flex2400 for demonstration purposes for AMSAT (the Radio Amateur
Satellite Corporation). Through a transponder, if you can live with
the computational complexity, it is almost always better to “demod -
remod”.

Bob McGwier
ARS: N4HY

David S. wrote:

On Apr 13, 2006, at 10:30 PM, Martin D. wrote:

the USB (8MSps total), but I like I said, I haven’t tested it. Here
self.connect (freq_mod,tx_amp,dst)

low pass cutoff freq

whatever (for a receiver chain), I just simply use that as the source

Hi, Eric and other friends


Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page


AMSAT VP Engineering. Member: ARRL, AMSAT-DL, TAPR, Packrats,
NJQRP/AMQRP, QRP ARCI, QCWA, FRC. ARRL SDR Wrk Grp Chairman
Laziness is the number one inspiration for ingenuity. Guilty as
charged!

On Sun, Apr 16, 2006 at 03:28:51PM -0400, Dawei Shen wrote:

Hi, Eric

As far as know, Flex 400 only has a single subdevice.

single subdevice for Tx, single subdevice for Rx.

The Flex daughterboards look like two distinct pieces of h/w to the
s/w. They have separate LO’s, etc.

How do you use one Flex400 daughter card for both transmission and
reception at the same time? Do you mean I use only one antenna using
the TX/RX port, or I use two antennas with one using Rx2 for
reception and the other using TX/RX port for transmisson?

If you are transmitting and receiving full duplex (simultaneously),
you’ll need to use TX/RX for transmit and RX2 for input (and you’ll
need to be TXing and RXing at pretty widely separated frequencies,
and/or use a diplexer).

The rx subdevice class has a method for selecting which antenna port
to use for reception:

def select_rx_antenna(self, which_antenna):
    """
    Specify which antenna port to use for reception.
    @param which_antenna: either 'TX/RX' or 'RX2'
    """
    if which_antenna in (0, 'TX/RX'):
        self._u.write_io(self._which, 0,        RX2_RX1N)
    elif which_antenna in (1, 'RX2'):
        self._u.write_io(self._which, RX2_RX1N, RX2_RX1N)
    else:
        raise ValueError, "which_antenna must be either 'TX/RX' or 

‘RX2’"

If you’re not transmitting and receiving at the same time, you can use
the single Tx/Rx port for both, along with Auto T/R mode

self.subdev.set_auto_tr(True) # must execute on both the Rx and Tx

Eric

Hi, Eric

As far as know, Flex 400 only has a single subdevice. How do you use
one Flex400 daughter card for both transmission and reception at the
same time? Do you mean I use only one antenna using the TX/RX port, or
I use two antennas with one using Rx2 for reception and the other
using TX/RX port for transmisson?

Thanks

Dawei