summaryrefslogtreecommitdiff
path: root/gr-digital/python
diff options
context:
space:
mode:
authorBen Reynwar <ben@reynwar.net>2012-08-14 07:12:53 -0700
committerBen Reynwar <ben@reynwar.net>2012-08-14 07:22:43 -0700
commit3e46aef392ba9b2e63bbfefefdb7178cc87049ab (patch)
tree942e3a7a78344b638859b9f65ce37cacb070eb01 /gr-digital/python
parentfe96ee8d82b2666951cf3cef8f7f5d991396273f (diff)
docs: Changed arguments in python docstrings to new formatting style.
Diffstat (limited to 'gr-digital/python')
-rw-r--r--gr-digital/python/gfsk.py37
-rw-r--r--gr-digital/python/modulation_utils.py9
-rw-r--r--gr-digital/python/ofdm.py18
-rw-r--r--gr-digital/python/ofdm_packet_utils.py34
-rw-r--r--gr-digital/python/ofdm_receiver.py19
-rw-r--r--gr-digital/python/packet_utils.py28
-rw-r--r--gr-digital/python/pkt.py31
7 files changed, 78 insertions, 98 deletions
diff --git a/gr-digital/python/gfsk.py b/gr-digital/python/gfsk.py
index c85fdf0e00..aa602d8b8d 100644
--- a/gr-digital/python/gfsk.py
+++ b/gr-digital/python/gfsk.py
@@ -68,14 +68,11 @@ class gfsk_mod(gr.hier_block2):
The input is a byte stream (unsigned char) and the
output is the complex modulated signal at baseband.
- @param samples_per_symbol: samples per baud >= 2
- @type samples_per_symbol: integer
- @param bt: Gaussian filter bandwidth * symbol time
- @type bt: float
- @param verbose: Print information about modulator?
- @type verbose: bool
- @param debug: Print modualtion data to files?
- @type debug: bool
+ Args:
+ samples_per_symbol: samples per baud >= 2 (integer)
+ bt: Gaussian filter bandwidth * symbol time (float)
+ verbose: Print information about modulator? (bool)
+ debug: Print modualtion data to files? (bool)
"""
gr.hier_block2.__init__(self, "gfsk_mod",
@@ -188,23 +185,19 @@ class gfsk_demod(gr.hier_block2):
The input is the complex modulated signal at baseband.
The output is a stream of bits packed 1 bit per byte (the LSB)
- @param samples_per_symbol: samples per baud
- @type samples_per_symbol: integer
- @param verbose: Print information about modulator?
- @type verbose: bool
- @param log: Print modualtion data to files?
- @type log: bool
+ Args:
+ samples_per_symbol: samples per baud (integer)
+ verbose: Print information about modulator? (bool)
+ log: Print modualtion data to files? (bool)
Clock recovery parameters. These all have reasonble defaults.
- @param gain_mu: controls rate of mu adjustment
- @type gain_mu: float
- @param mu: fractional delay [0.0, 1.0]
- @type mu: float
- @param omega_relative_limit: sets max variation in omega
- @type omega_relative_limit: float, typically 0.000200 (200 ppm)
- @param freq_error: bit rate error as a fraction
- @param float
+ Args:
+ gain_mu: controls rate of mu adjustment (float)
+ mu: fractional delay [0.0, 1.0] (float)
+ omega_relative_limit: sets max variation in omega (float, typically 0.000200 (200 ppm))
+ freq_error: bit rate error as a fraction
+ float:
"""
gr.hier_block2.__init__(self, "gfsk_demod",
diff --git a/gr-digital/python/modulation_utils.py b/gr-digital/python/modulation_utils.py
index cb3a9812d4..d499094d05 100644
--- a/gr-digital/python/modulation_utils.py
+++ b/gr-digital/python/modulation_utils.py
@@ -74,11 +74,10 @@ def extract_kwargs_from_options(function, excluded_args, options):
but in that case the default provided in the __init__ argument
list will be used since there is no kwargs entry.)
- @param function: the function whose parameter list will be examined
- @param excluded_args: function arguments that are NOT to be added to the dictionary
- @type excluded_args: sequence of strings
- @param options: result of command argument parsing
- @type options: optparse.Values
+ Args:
+ function: the function whose parameter list will be examined
+ excluded_args: function arguments that are NOT to be added to the dictionary (sequence of strings)
+ options: result of command argument parsing (optparse.Values)
"""
# Try this in C++ ;)
diff --git a/gr-digital/python/ofdm.py b/gr-digital/python/ofdm.py
index 9f57920efc..4c53ad0108 100644
--- a/gr-digital/python/ofdm.py
+++ b/gr-digital/python/ofdm.py
@@ -46,10 +46,10 @@ class ofdm_mod(gr.hier_block2):
Packets to be sent are enqueued by calling send_pkt.
The output is the complex modulated signal at baseband.
- @param options: pass modulation options from higher layers (fft length, occupied tones, etc.)
- @param msgq_limit: maximum number of messages in message queue
- @type msgq_limit: int
- @param pad_for_usrp: If true, packets are padded such that they end up a multiple of 128 samples
+ Args:
+ options: pass modulation options from higher layers (fft length, occupied tones, etc.)
+ msgq_limit: maximum number of messages in message queue (int)
+ pad_for_usrp: If true, packets are padded such that they end up a multiple of 128 samples
"""
gr.hier_block2.__init__(self, "ofdm_mod",
@@ -130,8 +130,8 @@ class ofdm_mod(gr.hier_block2):
"""
Send the payload.
- @param payload: data to send
- @type payload: string
+ Args:
+ payload: data to send (string)
"""
if eof:
msg = gr.message(1) # tell self._pkt_input we're not sending any more packets
@@ -188,9 +188,9 @@ class ofdm_demod(gr.hier_block2):
The input is the complex modulated signal at baseband.
Demodulated packets are sent to the handler.
- @param options: pass modulation options from higher layers (fft length, occupied tones, etc.)
- @param callback: function of two args: ok, payload
- @type callback: ok: bool; payload: string
+ Args:
+ options: pass modulation options from higher layers (fft length, occupied tones, etc.)
+ callback: function of two args: ok, payload (ok: bool; payload: string)
"""
gr.hier_block2.__init__(self, "ofdm_demod",
gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
diff --git a/gr-digital/python/ofdm_packet_utils.py b/gr-digital/python/ofdm_packet_utils.py
index d0000e6db5..c49dfe4f8e 100644
--- a/gr-digital/python/ofdm_packet_utils.py
+++ b/gr-digital/python/ofdm_packet_utils.py
@@ -101,14 +101,12 @@ def make_packet(payload, samples_per_symbol, bits_per_symbol,
"""
Build a packet, given access code, payload, and whitener offset
- @param payload: packet payload, len [0, 4096]
- @param samples_per_symbol: samples per symbol (needed for padding calculation)
- @type samples_per_symbol: int
- @param bits_per_symbol: (needed for padding calculation)
- @type bits_per_symbol: int
- @param whitener_offset offset into whitener string to use [0-16)
- @param whitening: Turn whitener on or off
- @type whitening: bool
+ Args:
+ payload: packet payload, len [0, 4096]
+ samples_per_symbol: samples per symbol (needed for padding calculation) (int)
+ bits_per_symbol: (needed for padding calculation) (int)
+ whitener_offset: offset into whitener string to use [0-16)
+ whitening: Turn whitener on or off (bool)
Packet will have access code at the beginning, followed by length, payload
and finally CRC-32.
@@ -150,13 +148,13 @@ def _npadding_bytes(pkt_byte_len, samples_per_symbol, bits_per_symbol):
we want to pad so that after modulation the resulting packet
is a multiple of 128 samples.
- @param ptk_byte_len: len in bytes of packet, not including padding.
- @param samples_per_symbol: samples per bit (1 bit / symbolwidth GMSK)
- @type samples_per_symbol: int
- @param bits_per_symbol: bits per symbol (log2(modulation order))
- @type bits_per_symbol: int
+ Args:
+ ptk_byte_len: len in bytes of packet, not including padding.
+ samples_per_symbol: samples per bit (1 bit / symbolwidth GMSK) (int)
+ bits_per_symbol: bits per symbol (log2(modulation order)) (int)
- @returns number of bytes of padding to append.
+ Returns:
+ number of bytes of padding to append.
"""
modulus = 128
byte_modulus = gru.lcm(modulus/8, samples_per_symbol) * bits_per_symbol / samples_per_symbol
@@ -170,10 +168,10 @@ def unmake_packet(whitened_payload_with_crc, whitener_offset=0, dewhitening=1):
"""
Return (ok, payload)
- @param whitened_payload_with_crc: string
- @param whitener_offset offset into whitener string to use [0-16)
- @param dewhitening: Turn whitener on or off
- @type dewhitening: bool
+ Args:
+ whitened_payload_with_crc: string
+ whitener_offset: offset into whitener string to use [0-16)
+ dewhitening: Turn whitener on or off (bool)
"""
if dewhitening:
diff --git a/gr-digital/python/ofdm_receiver.py b/gr-digital/python/ofdm_receiver.py
index 9d4d6e559d..33d9b66268 100644
--- a/gr-digital/python/ofdm_receiver.py
+++ b/gr-digital/python/ofdm_receiver.py
@@ -47,18 +47,13 @@ class ofdm_receiver(gr.hier_block2):
The input is the complex modulated signal at baseband.
Synchronized packets are sent back to the demodulator.
- @param fft_length: total number of subcarriers
- @type fft_length: int
- @param cp_length: length of cyclic prefix as specified in subcarriers (<= fft_length)
- @type cp_length: int
- @param occupied_tones: number of subcarriers used for data
- @type occupied_tones: int
- @param snr: estimated signal to noise ratio used to guide cyclic prefix synchronizer
- @type snr: float
- @param ks: known symbols used as preambles to each packet
- @type ks: list of lists
- @param logging: turn file logging on or off
- @type logging: bool
+ Args:
+ fft_length: total number of subcarriers (int)
+ cp_length: length of cyclic prefix as specified in subcarriers (<= fft_length) (int)
+ occupied_tones: number of subcarriers used for data (int)
+ snr: estimated signal to noise ratio used to guide cyclic prefix synchronizer (float)
+ ks: known symbols used as preambles to each packet (list of lists)
+ logging: turn file logging on or off (bool)
"""
gr.hier_block2.__init__(self, "ofdm_receiver",
diff --git a/gr-digital/python/packet_utils.py b/gr-digital/python/packet_utils.py
index 2e216ff50e..2929758ef0 100644
--- a/gr-digital/python/packet_utils.py
+++ b/gr-digital/python/packet_utils.py
@@ -107,13 +107,12 @@ def make_packet(payload, samples_per_symbol, bits_per_symbol,
"""
Build a packet, given access code, payload, and whitener offset
- @param payload: packet payload, len [0, 4096]
- @param samples_per_symbol: samples per symbol (needed for padding calculation)
- @type samples_per_symbol: int
- @param bits_per_symbol: (needed for padding calculation)
- @type bits_per_symbol: int
- @param access_code: string of ascii 0's and 1's
- @param whitener_offset offset into whitener string to use [0-16)
+ Args:
+ payload: packet payload, len [0, 4096]
+ samples_per_symbol: samples per symbol (needed for padding calculation) (int)
+ bits_per_symbol: (needed for padding calculation) (int)
+ access_code: string of ascii 0's and 1's
+ whitener_offset: offset into whitener string to use [0-16)
Packet will have access code at the beginning, followed by length, payload
and finally CRC-32.
@@ -156,13 +155,13 @@ def _npadding_bytes(pkt_byte_len, samples_per_symbol, bits_per_symbol):
we want to pad so that after modulation the resulting packet
is a multiple of 128 samples.
- @param ptk_byte_len: len in bytes of packet, not including padding.
- @param samples_per_symbol: samples per bit (1 bit / symbolwidth GMSK)
- @type samples_per_symbol: int
- @param bits_per_symbol: bits per symbol (log2(modulation order))
- @type bits_per_symbol: int
+ Args:
+ ptk_byte_len: len in bytes of packet, not including padding.
+ samples_per_symbol: samples per bit (1 bit / symbolwidth GMSK) (int)
+ bits_per_symbol: bits per symbol (log2(modulation order)) (int)
- @returns number of bytes of padding to append.
+ Returns:
+ number of bytes of padding to append.
"""
modulus = 128
byte_modulus = gru.lcm(modulus/8, samples_per_symbol) * bits_per_symbol / samples_per_symbol
@@ -176,7 +175,8 @@ def unmake_packet(whitened_payload_with_crc, whitener_offset=0, dewhitening=True
"""
Return (ok, payload)
- @param whitened_payload_with_crc: string
+ Args:
+ whitened_payload_with_crc: string
"""
if dewhitening:
diff --git a/gr-digital/python/pkt.py b/gr-digital/python/pkt.py
index 09254a7caa..283a150d2c 100644
--- a/gr-digital/python/pkt.py
+++ b/gr-digital/python/pkt.py
@@ -44,14 +44,12 @@ class mod_pkts(gr.hier_block2):
Packets to be sent are enqueued by calling send_pkt.
The output is the complex modulated signal at baseband.
- @param modulator: instance of modulator class (gr_block or hier_block2)
- @type modulator: complex baseband out
- @param access_code: AKA sync vector
- @type access_code: string of 1's and 0's between 1 and 64 long
- @param msgq_limit: maximum number of messages in message queue
- @type msgq_limit: int
- @param pad_for_usrp: If true, packets are padded such that they end up a multiple of 128 samples
- @param use_whitener_offset: If true, start of whitener XOR string is incremented each packet
+ Args:
+ modulator: instance of modulator class (gr_block or hier_block2) (complex baseband out)
+ access_code: AKA sync vector (string of 1's and 0's between 1 and 64 long)
+ msgq_limit: maximum number of messages in message queue (int)
+ pad_for_usrp: If true, packets are padded such that they end up a multiple of 128 samples
+ use_whitener_offset: If true, start of whitener XOR string is incremented each packet
See gmsk_mod for remaining parameters
"""
@@ -79,8 +77,8 @@ class mod_pkts(gr.hier_block2):
"""
Send the payload.
- @param payload: data to send
- @type payload: string
+ Args:
+ payload: data to send (string)
"""
if eof:
msg = gr.message(1) # tell self._pkt_input we're not sending any more packets
@@ -116,14 +114,11 @@ class demod_pkts(gr.hier_block2):
The input is the complex modulated signal at baseband.
Demodulated packets are sent to the handler.
- @param demodulator: instance of demodulator class (gr_block or hier_block2)
- @type demodulator: complex baseband in
- @param access_code: AKA sync vector
- @type access_code: string of 1's and 0's
- @param callback: function of two args: ok, payload
- @type callback: ok: bool; payload: string
- @param threshold: detect access_code with up to threshold bits wrong (-1 -> use default)
- @type threshold: int
+ Args:
+ demodulator: instance of demodulator class (gr_block or hier_block2) (complex baseband in)
+ access_code: AKA sync vector (string of 1's and 0's)
+ callback: function of two args: ok, payload (ok: bool; payload: string)
+ threshold: detect access_code with up to threshold bits wrong (-1 -> use default) (int)
"""
gr.hier_block2.__init__(self, "demod_pkts",