/gnuradio-examples/python/digital/transmit_path.py and bitrate Question?


#1

I’ve been trying to analyse the transmit_path.py script and stumped with
the
bitrate value. I see bitrate being brought in from the options and
also
derived from pick_bitrate but I don’t see where somthing is being done
with
it. I know that the bitrate is being used but for the life of me I
can’t
see where something is being set with the bitrate. I see there is a
bitrate fuction and it returns the bitrate…I thought that somethnig
is
calling that function and there’s where the bitrate is being used…I
looked but can’t seem to find where the bitrate function is being called
either in this script or by any other script. Does some one know where
the
bitrate is being used/set?

Cheers,
Jody


#2

2009/3/19 w w removed_email_address@domain.invalid:

I’ve been trying to analyse the transmit_path.py script and stumped with the
bitrate value. I see bitrate being brought in from the options and also
derived from pick_bitrate but I don’t see where somthing is being done with
it.

It is assigned in transmit_path.py, line 119.

It is used in tunnel.py, line 255.

The bitrate is a derived variable, mostly for display to the user,
though tunnel.py warns if the TX and RX sides don’t match.

The modulator only needs to know the samples per symbol to use; the
transmitted bit rate is then additionally determined by the USRP
interpolation and DAC rate.

Johnathan


#3

On Thu, Mar 19, 2009 at 09:27:03AM -0700, Johnathan C. wrote:

The bitrate is a derived variable, mostly for display to the user,
though tunnel.py warns if the TX and RX sides don’t match.

The possibly confusing part is that if the user specifies the bitrate,
we’ll derive the other related values. It’s basically a constraint
satisfaction problem.

Eric

From pick_bitrate.py:

def pick_tx_bitrate(bitrate, bits_per_symbol, samples_per_symbol,
interp_rate, converter_rate=128e6):
“”"
Given the 4 input parameters, return at configuration that matches

@param bitrate: desired bitrate or None
@type bitrate: number or None
@param bits_per_symbol: E.g., BPSK -> 1, QPSK -> 2, 8-PSK -> 3
@type bits_per_symbol: integer >= 1
@param samples_per_symbol: samples/baud (aka samples/symbol)
@type samples_per_symbol: number or None
@param interp_rate: USRP interpolation factor
@type interp_rate: integer or None
@param converter_rate: converter sample rate in Hz
@type converter_rate: number

@returns tuple (bitrate, samples_per_symbol, interp_rate)
"""
return _pick_bitrate(bitrate, bits_per_symbol, samples_per_symbol,
                     interp_rate, converter_rate, _gen_tx_info)

def pick_rx_bitrate(bitrate, bits_per_symbol, samples_per_symbol,
decim_rate, converter_rate=64e6):
“”"
Given the 4 input parameters, return at configuration that matches

@param bitrate: desired bitrate or None
@type bitrate: number or None
@param bits_per_symbol: E.g., BPSK -> 1, QPSK -> 2, 8-PSK -> 3
@type bits_per_symbol: integer >= 1
@param samples_per_symbol: samples/baud (aka samples/symbol)
@type samples_per_symbol: number or None
@param decim_rate: USRP decimation factor
@type decim_rate: integer or None
@param converter_rate: converter sample rate in Hz
@type converter_rate: number

@returns tuple (bitrate, samples_per_symbol, decim_rate)
"""
return _pick_bitrate(bitrate, bits_per_symbol, samples_per_symbol,
                     decim_rate, converter_rate, _gen_rx_info)

#4

On Thu, Mar 19, 2009 at 02:28:08PM -0400, w w wrote:

What’s confusing for me is that I see the bitrate variable (it seems to have
a profound importantance) but it looks to me like it never gets assigned to
a block. The following is line 119 from transmit_path.py. In my mind the
function of lines 119-121, is to assign/derive values for bitrate, interp
and SPS from pick_tx_bitrate…Is this correct? Of course it looks
like bitrate stays the same unless it goes above 4 mbs.
I don’t see where the bitrate is being assigned to either the
packet transmitter or the modulator (which seems to me the most logical
place to use bitrate). I see where interpolation is being set for the usrp
and I also see where sample per symbol is being used in various places.

With my mind looking from all angles, the only thing I come up with is that
interpolation is being used to control bitrate…but that don’t make
sense.

Why not? This is a software radio. Everything scales with the
sample rate, and the interpolation value sets the complex baseband
sample rate.

Eric


#5

What’s confusing for me is that I see the bitrate variable (it seems to
have
a profound importantance) but it looks to me like it never gets assigned
to
a block. The following is line 119 from transmit_path.py. In my mind
the
function of lines 119-121, is to assign/derive values for bitrate,
interp
and SPS from pick_tx_bitrate…Is this correct? Of course it looks
like bitrate stays the same unless it goes above 4 mbs.
I don’t see where the bitrate is being assigned to either the
packet transmitter or the modulator (which seems to me the most logical
place to use bitrate). I see where interpolation is being set for the
usrp
and I also see where sample per symbol is being used in various places.
With my mind looking from all angles, the only thing I come up with is
that
interpolation is being used to control bitrate…but that don’t make
sense.

Where I’m going astray?

Cheers,
Jody

# derive values of bitrate, samples_per_symbol, and interp from desired
info

** (self._bitrate, self._samples_per_symbol, self._interp) =
pick_tx_bitrate(self._bitrate,
self._modulator_class.bits_per_symbol(),
self._samples_per_symbol,
self._interp,
dac_rate)

  self.u.set_interp_rate(self._interp)