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)