summaryrefslogtreecommitdiff
path: root/gr-digital
diff options
context:
space:
mode:
Diffstat (limited to 'gr-digital')
-rw-r--r--[-rwxr-xr-x]gr-digital/examples/berawgn.py23
-rw-r--r--gr-digital/examples/demod/pam_timing.grc2459
-rw-r--r--[-rwxr-xr-x]gr-digital/examples/example_costas.py8
-rw-r--r--[-rwxr-xr-x]gr-digital/examples/example_fll.py8
-rw-r--r--[-rwxr-xr-x]gr-digital/examples/example_timing.py12
-rw-r--r--[-rwxr-xr-x]gr-digital/examples/gen_whitener.py1
-rw-r--r--[-rwxr-xr-x]gr-digital/examples/narrowband/benchmark_add_channel.py26
-rw-r--r--[-rwxr-xr-x]gr-digital/examples/narrowband/benchmark_rx.py36
-rw-r--r--[-rwxr-xr-x]gr-digital/examples/narrowband/benchmark_tx.py38
-rw-r--r--[-rwxr-xr-x]gr-digital/examples/narrowband/digital_bert_rx.py56
-rw-r--r--[-rwxr-xr-x]gr-digital/examples/narrowband/digital_bert_tx.py8
-rw-r--r--gr-digital/examples/narrowband/receive_path.py44
-rw-r--r--[-rwxr-xr-x]gr-digital/examples/narrowband/rx_voice.py47
-rw-r--r--gr-digital/examples/narrowband/transmit_path.py43
-rw-r--r--[-rwxr-xr-x]gr-digital/examples/narrowband/tunnel.py78
-rw-r--r--[-rwxr-xr-x]gr-digital/examples/narrowband/tx_voice.py48
-rw-r--r--gr-digital/examples/narrowband/uhd_interface.py100
-rw-r--r--[-rwxr-xr-x]gr-digital/examples/ofdm/benchmark_add_channel.py28
-rw-r--r--gr-digital/examples/ofdm/receive_path.py1
-rw-r--r--gr-digital/examples/ofdm/transmit_path.py29
-rw-r--r--gr-digital/examples/ofdm/uhd_interface.py76
-rw-r--r--[-rwxr-xr-x]gr-digital/examples/run_length.py37
-rw-r--r--[-rwxr-xr-x]gr-digital/examples/snr_estimators.py36
-rw-r--r--gr-digital/grc/CMakeLists.txt4
-rw-r--r--gr-digital/grc/digital.tree.yml85
-rw-r--r--gr-digital/grc/digital_additive_scrambler_bb.block.yml43
-rw-r--r--gr-digital/grc/digital_additive_scrambler_bb.xml56
-rw-r--r--gr-digital/grc/digital_binary_slicer_fb.block.yml16
-rw-r--r--gr-digital/grc/digital_binary_slicer_fb.xml20
-rw-r--r--gr-digital/grc/digital_block_tree.xml134
-rw-r--r--gr-digital/grc/digital_burst_shaper.block.yml50
-rw-r--r--gr-digital/grc/digital_burst_shaper.xml71
-rw-r--r--gr-digital/grc/digital_chunks_to_symbols.block.yml53
-rw-r--r--gr-digital/grc/digital_chunks_to_symbols.xml78
-rw-r--r--gr-digital/grc/digital_clock_recovery_mm_xx.block.yml51
-rw-r--r--gr-digital/grc/digital_clock_recovery_mm_xx.xml69
-rw-r--r--gr-digital/grc/digital_cma_equalizer_cc.block.yml33
-rw-r--r--gr-digital/grc/digital_cma_equalizer_cc.xml42
-rw-r--r--gr-digital/grc/digital_constellation.block.yml72
-rw-r--r--gr-digital/grc/digital_constellation.xml113
-rw-r--r--gr-digital/grc/digital_constellation_decoder_cb.block.yml21
-rw-r--r--gr-digital/grc/digital_constellation_decoder_cb.xml25
-rw-r--r--gr-digital/grc/digital_constellation_modulator.block.yml58
-rw-r--r--gr-digital/grc/digital_constellation_modulator.xml111
-rw-r--r--gr-digital/grc/digital_constellation_receiver_cb.block.yml62
-rw-r--r--gr-digital/grc/digital_constellation_receiver_cb.xml92
-rw-r--r--gr-digital/grc/digital_constellation_rect.block.yml65
-rw-r--r--gr-digital/grc/digital_constellation_rect.xml89
-rw-r--r--gr-digital/grc/digital_constellation_soft_decoder_cf.block.yml21
-rw-r--r--gr-digital/grc/digital_constellation_soft_decoder_cf.xml25
-rw-r--r--gr-digital/grc/digital_corr_est_cc.block.yml38
-rw-r--r--gr-digital/grc/digital_corr_est_cc.xml50
-rw-r--r--gr-digital/grc/digital_correlate_access_code_bb.block.yml25
-rw-r--r--gr-digital/grc/digital_correlate_access_code_bb.xml31
-rw-r--r--gr-digital/grc/digital_correlate_access_code_tag_xx.block.yml40
-rw-r--r--gr-digital/grc/digital_correlate_access_code_tag_xx.xml55
-rw-r--r--gr-digital/grc/digital_correlate_access_code_xx_ts.block.yml37
-rw-r--r--gr-digital/grc/digital_correlate_access_code_xx_ts.xml58
-rw-r--r--gr-digital/grc/digital_costas_loop_cc.block.yml48
-rw-r--r--gr-digital/grc/digital_costas_loop_cc.xml74
-rw-r--r--gr-digital/grc/digital_cpmmod_bc.block.yml40
-rw-r--r--gr-digital/grc/digital_cpmmod_bc.xml69
-rw-r--r--gr-digital/grc/digital_crc32_async_bb.block.yml25
-rw-r--r--gr-digital/grc/digital_crc32_async_bb.xml32
-rw-r--r--gr-digital/grc/digital_crc32_bb.block.yml33
-rw-r--r--gr-digital/grc/digital_crc32_bb.xml47
-rw-r--r--gr-digital/grc/digital_descrambler_bb.block.yml30
-rw-r--r--gr-digital/grc/digital_descrambler_bb.xml38
-rw-r--r--gr-digital/grc/digital_diff_decoder_bb.block.yml21
-rw-r--r--gr-digital/grc/digital_diff_decoder_bb.xml25
-rw-r--r--gr-digital/grc/digital_diff_encoder_bb.block.yml21
-rw-r--r--gr-digital/grc/digital_diff_encoder_bb.xml25
-rw-r--r--gr-digital/grc/digital_diff_phasor_cc.block.yml16
-rw-r--r--gr-digital/grc/digital_diff_phasor_cc.xml20
-rw-r--r--gr-digital/grc/digital_dxpsk_demod.block.yml75
-rw-r--r--gr-digital/grc/digital_dxpsk_demod.xml154
-rw-r--r--gr-digital/grc/digital_dxpsk_mod.block.yml52
-rw-r--r--gr-digital/grc/digital_dxpsk_mod.xml117
-rw-r--r--gr-digital/grc/digital_fll_band_edge_cc.block.yml53
-rw-r--r--gr-digital/grc/digital_fll_band_edge_cc.xml70
-rw-r--r--gr-digital/grc/digital_framer_sink_1.block.yml17
-rw-r--r--gr-digital/grc/digital_framer_sink_1.xml21
-rw-r--r--gr-digital/grc/digital_gfsk_demod.block.yml58
-rw-r--r--gr-digital/grc/digital_gfsk_demod.xml95
-rw-r--r--gr-digital/grc/digital_gfsk_mod.block.yml45
-rw-r--r--gr-digital/grc/digital_gfsk_mod.xml74
-rw-r--r--gr-digital/grc/digital_glfsr_source_x.block.yml37
-rw-r--r--gr-digital/grc/digital_glfsr_source_x.xml61
-rw-r--r--gr-digital/grc/digital_gmsk_demod.block.yml54
-rw-r--r--gr-digital/grc/digital_gmsk_demod.xml88
-rw-r--r--gr-digital/grc/digital_gmsk_mod.block.yml41
-rw-r--r--gr-digital/grc/digital_gmsk_mod.xml67
-rw-r--r--gr-digital/grc/digital_gmskmod_bc.block.yml30
-rw-r--r--gr-digital/grc/digital_gmskmod_bc.xml38
-rw-r--r--gr-digital/grc/digital_hdlc_deframer_bp.block.yml26
-rw-r--r--gr-digital/grc/digital_hdlc_deframer_bp.xml27
-rw-r--r--gr-digital/grc/digital_hdlc_framer_pb.block.yml21
-rw-r--r--gr-digital/grc/digital_hdlc_framer_pb.xml20
-rw-r--r--gr-digital/grc/digital_header_payload_demux.block.yml85
-rw-r--r--gr-digital/grc/digital_header_payload_demux.xml138
-rw-r--r--gr-digital/grc/digital_kurtotic_equalizer_cc.block.yml26
-rw-r--r--gr-digital/grc/digital_kurtotic_equalizer_cc.xml31
-rw-r--r--gr-digital/grc/digital_lms_dd_equalizer_cc.block.yml32
-rw-r--r--gr-digital/grc/digital_lms_dd_equalizer_cc.xml41
-rw-r--r--gr-digital/grc/digital_map_bb.block.yml21
-rw-r--r--gr-digital/grc/digital_map_bb.xml25
-rw-r--r--gr-digital/grc/digital_modulate_vector.block.yml22
-rw-r--r--gr-digital/grc/digital_modulate_vector.xml34
-rw-r--r--gr-digital/grc/digital_mpsk_snr_est_cc.block.yml35
-rw-r--r--gr-digital/grc/digital_mpsk_snr_est_cc.xml56
-rw-r--r--gr-digital/grc/digital_msk_timing_recovery_cc.block.yml42
-rw-r--r--gr-digital/grc/digital_msk_timing_recovery_cc.xml49
-rw-r--r--gr-digital/grc/digital_ofdm_carrier_allocator_cvc.block.yml44
-rw-r--r--gr-digital/grc/digital_ofdm_carrier_allocator_cvc.xml51
-rw-r--r--gr-digital/grc/digital_ofdm_chanest_vcvc.block.yml53
-rw-r--r--gr-digital/grc/digital_ofdm_chanest_vcvc.xml64
-rw-r--r--gr-digital/grc/digital_ofdm_cyclic_prefixer.block.yml38
-rw-r--r--gr-digital/grc/digital_ofdm_cyclic_prefixer.xml67
-rw-r--r--gr-digital/grc/digital_ofdm_frame_equalizer_vcvc.block.yml46
-rw-r--r--gr-digital/grc/digital_ofdm_frame_equalizer_vcvc.xml58
-rw-r--r--gr-digital/grc/digital_ofdm_rx.block.yml95
-rw-r--r--gr-digital/grc/digital_ofdm_rx.xml190
-rw-r--r--gr-digital/grc/digital_ofdm_serializer_vcc.block.yml51
-rw-r--r--gr-digital/grc/digital_ofdm_serializer_vcc.xml60
-rw-r--r--gr-digital/grc/digital_ofdm_sync_sc_cfb.block.yml35
-rw-r--r--gr-digital/grc/digital_ofdm_sync_sc_cfb.xml44
-rw-r--r--gr-digital/grc/digital_ofdm_tx.block.yml100
-rw-r--r--gr-digital/grc/digital_ofdm_tx.xml196
-rw-r--r--gr-digital/grc/digital_packet_headergenerator_bb.block.yml27
-rw-r--r--gr-digital/grc/digital_packet_headergenerator_bb.xml26
-rw-r--r--gr-digital/grc/digital_packet_headergenerator_bb_default.block.yml25
-rw-r--r--gr-digital/grc/digital_packet_headergenerator_bb_default.xml26
-rw-r--r--gr-digital/grc/digital_packet_headerparser_b.block.yml21
-rw-r--r--gr-digital/grc/digital_packet_headerparser_b.xml19
-rw-r--r--gr-digital/grc/digital_packet_headerparser_b_default.block.yml25
-rw-r--r--gr-digital/grc/digital_packet_headerparser_b_default.xml26
-rw-r--r--gr-digital/grc/digital_packet_sink.block.yml24
-rw-r--r--gr-digital/grc/digital_packet_sink.xml32
-rw-r--r--gr-digital/grc/digital_pfb_clock_sync.block.yml69
-rw-r--r--gr-digital/grc/digital_pfb_clock_sync.xml97
-rw-r--r--gr-digital/grc/digital_pn_correlator_cc.block.yml29
-rw-r--r--gr-digital/grc/digital_pn_correlator_cc.xml37
-rw-r--r--gr-digital/grc/digital_probe_density_b.block.yml24
-rw-r--r--gr-digital/grc/digital_probe_density_b.xml29
-rw-r--r--gr-digital/grc/digital_probe_mpsk_snr_est_c.block.yml42
-rw-r--r--gr-digital/grc/digital_probe_mpsk_snr_est_c.xml67
-rw-r--r--gr-digital/grc/digital_protocol_formatter_async.block.yml26
-rw-r--r--gr-digital/grc/digital_protocol_formatter_async.xml33
-rw-r--r--gr-digital/grc/digital_protocol_formatter_bb.block.yml25
-rw-r--r--gr-digital/grc/digital_protocol_formatter_bb.xml32
-rw-r--r--gr-digital/grc/digital_protocol_parser_b.block.yml22
-rw-r--r--gr-digital/grc/digital_protocol_parser_b.xml25
-rw-r--r--gr-digital/grc/digital_psk_demod.block.yml79
-rw-r--r--gr-digital/grc/digital_psk_demod.xml146
-rw-r--r--gr-digital/grc/digital_psk_mod.block.yml65
-rw-r--r--gr-digital/grc/digital_psk_mod.xml126
-rw-r--r--gr-digital/grc/digital_qam_demod.block.yml80
-rw-r--r--gr-digital/grc/digital_qam_demod.xml147
-rw-r--r--gr-digital/grc/digital_qam_mod.block.yml65
-rw-r--r--gr-digital/grc/digital_qam_mod.xml126
-rw-r--r--gr-digital/grc/digital_scrambler_bb.block.yml30
-rw-r--r--gr-digital/grc/digital_scrambler_bb.xml38
-rw-r--r--gr-digital/grc/digital_simple_correlator.block.yml21
-rw-r--r--gr-digital/grc/digital_simple_correlator.xml25
-rw-r--r--gr-digital/grc/digital_simple_framer.block.yml21
-rw-r--r--gr-digital/grc/digital_simple_framer.xml25
-rw-r--r--gr-digital/grc/digital_symbol_sync_xx.block.yml108
-rw-r--r--gr-digital/grc/digital_symbol_sync_xx.xml207
-rw-r--r--gr-digital/grc/variable_header_format_default.block.yml25
-rw-r--r--gr-digital/grc/variable_header_format_default.xml42
-rw-r--r--gr-digital/python/digital/CMakeLists.txt2
-rw-r--r--gr-digital/python/digital/__init__.py66
-rw-r--r--gr-digital/python/digital/bpsk.py7
-rw-r--r--gr-digital/python/digital/constellation_map_generator.py1
-rw-r--r--gr-digital/python/digital/cpm.py121
-rw-r--r--gr-digital/python/digital/crc.py13
-rw-r--r--gr-digital/python/digital/generic_mod_demod.py68
-rw-r--r--gr-digital/python/digital/gfsk.py167
-rw-r--r--gr-digital/python/digital/gmsk.py135
-rw-r--r--gr-digital/python/digital/modulation_utils.py1
-rw-r--r--gr-digital/python/digital/ofdm.py109
-rw-r--r--gr-digital/python/digital/ofdm_packet_utils.py31
-rw-r--r--gr-digital/python/digital/ofdm_receiver.py58
-rw-r--r--gr-digital/python/digital/ofdm_sync_fixed.py1
-rw-r--r--gr-digital/python/digital/ofdm_sync_ml.py50
-rw-r--r--gr-digital/python/digital/ofdm_sync_pn.py31
-rw-r--r--gr-digital/python/digital/ofdm_sync_pnac.py31
-rw-r--r--gr-digital/python/digital/ofdm_txrx.py27
-rw-r--r--gr-digital/python/digital/packet_utils.py52
-rw-r--r--gr-digital/python/digital/pkt.py64
-rw-r--r--gr-digital/python/digital/psk.py32
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/psk_constellations.py4
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_binary_slicer_fb.py20
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_burst_shaper.py9
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_chunks_to_symbols.py7
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_clock_recovery_mm.py1
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_cma_equalizer.py37
-rw-r--r--gr-digital/python/digital/qa_constellation.py18
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_constellation_decoder_cb.py30
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_constellation_receiver.py31
-rw-r--r--gr-digital/python/digital/qa_constellation_soft_decoder_cf.py13
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_correlate_access_code.py3
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_correlate_access_code_XX_ts.py5
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_correlate_access_code_tag.py3
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_costas_loop_cc.py12
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_cpm.py1
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_crc32.py1
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_crc32_bb.py13
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_diff_encoder.py1
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_diff_phasor_cc.py1
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_digital.py1
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_fll_band_edge.py4
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_framer_sink.py3
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_glfsr_source.py19
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_hdlc_framer.py5
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_header_payload_demux.py29
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_lfsr.py3
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_lms_equalizer.py37
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_map.py3
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_mpsk_snr_est.py19
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_ofdm_carrier_allocator_cvc.py17
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_ofdm_chanest_vcvc.py10
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_ofdm_cyclic_prefixer.py16
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_ofdm_frame_equalizer_vcvc.py18
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_ofdm_serializer_vcc.py26
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_ofdm_sync_sc_cfb.py28
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_ofdm_txrx.py1
-rw-r--r--gr-digital/python/digital/qa_packet_format.py19
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_packet_headergenerator_bb.py1
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_packet_headerparser_b.py11
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_pfb_clock_sync.py18
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_pn_correlator_cc.py1
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_probe_density.py4
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_scrambler.py5
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_simple_correlator.py1
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qa_simple_framer.py1
-rw-r--r--gr-digital/python/digital/qam.py77
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/qam_constellations.py11
-rw-r--r--gr-digital/python/digital/qamlike.py19
-rw-r--r--gr-digital/python/digital/qpsk.py8
-rw-r--r--gr-digital/python/digital/soft_dec_lut_gen.py19
-rw-r--r--[-rwxr-xr-x]gr-digital/python/digital/test_soft_decisions.py35
-rw-r--r--gr-digital/python/digital/utils/alignment.py12
-rw-r--r--gr-digital/python/digital/utils/gray_code.py16
-rw-r--r--gr-digital/python/digital/utils/mod_codes.py1
-rw-r--r--gr-digital/python/digital/utils/tagged_streams.py23
-rw-r--r--gr-digital/swig/digital_swig.py.in8
247 files changed, 5809 insertions, 7050 deletions
diff --git a/gr-digital/examples/berawgn.py b/gr-digital/examples/berawgn.py
index c47d99174a..886c93bdfe 100755..100644
--- a/gr-digital/examples/berawgn.py
+++ b/gr-digital/examples/berawgn.py
@@ -32,6 +32,10 @@ Of course, expect the maximum value for BER to be one order of
magnitude below what you chose for N_BITS.
"""
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
+
import math
import numpy
@@ -43,13 +47,13 @@ import sys
try:
from scipy.special import erfc
except ImportError:
- print "Error: could not import scipy (http://www.scipy.org/)"
+ print("Error: could not import scipy (http://www.scipy.org/)")
sys.exit(1)
try:
import pylab
except ImportError:
- print "Error: could not import pylab (http://matplotlib.sourceforge.net/)"
+ print("Error: could not import pylab (http://matplotlib.sourceforge.net/)")
sys.exit(1)
# Best to choose powers of 10
@@ -58,7 +62,7 @@ RAND_SEED = 42
def berawgn(EbN0):
""" Calculates theoretical bit error rate in AWGN (for BPSK and given Eb/N0) """
- return 0.5 * erfc(math.sqrt(10**(float(EbN0)/10)))
+ return 0.5 * erfc(math.sqrt(10**(float(EbN0) / 10)))
class BitErrors(gr.hier_block2):
""" Two inputs: true and received bits. We compare them and
@@ -81,7 +85,7 @@ class BitErrors(gr.hier_block2):
blocks.unpack_k_bits_bb(bits_per_byte),
blocks.uchar_to_float(),
blocks.integrate_ff(intdump_decim),
- blocks.multiply_const_ff(1.0/N_BITS),
+ blocks.multiply_const_ff(1.0 / N_BITS),
self)
self.connect((self, 1), (comp, 1))
@@ -91,7 +95,7 @@ class BERAWGNSimu(gr.top_block):
gr.top_block.__init__(self)
self.const = digital.qpsk_constellation()
# Source is N_BITS bits, non-repeated
- data = map(int, numpy.random.randint(0, self.const.arity(), N_BITS/self.const.bits_per_symbol()))
+ data = list(map(int, numpy.random.randint(0, self.const.arity(), N_BITS / self.const.bits_per_symbol())))
src = blocks.vector_source_b(data, False)
mod = digital.chunks_to_symbols_bc((self.const.points()), 1)
add = blocks.add_vcc()
@@ -107,12 +111,12 @@ class BERAWGNSimu(gr.top_block):
def EbN0_to_noise_voltage(self, EbN0):
""" Converts Eb/N0 to a complex noise voltage (assuming unit symbol power) """
- return 1.0 / math.sqrt(self.const.bits_per_symbol() * 10**(float(EbN0)/10))
+ return 1.0 / math.sqrt(self.const.bits_per_symbol( * 10**(float(EbN0) / 10)))
def simulate_ber(EbN0):
""" All the work's done here: create flow graph, run, read out BER """
- print "Eb/N0 = %d dB" % EbN0
+ print("Eb/N0 = %d dB" % EbN0)
fg = BERAWGNSimu(EbN0)
fg.run()
return numpy.sum(fg.sink.data())
@@ -120,9 +124,9 @@ def simulate_ber(EbN0):
if __name__ == "__main__":
EbN0_min = 0
EbN0_max = 15
- EbN0_range = range(EbN0_min, EbN0_max+1)
+ EbN0_range = list(range(EbN0_min, EbN0_max+1))
ber_theory = [berawgn(x) for x in EbN0_range]
- print "Simulating..."
+ print("Simulating...")
ber_simu = [simulate_ber(x) for x in EbN0_range]
f = pylab.figure()
@@ -135,4 +139,3 @@ if __name__ == "__main__":
s.legend()
s.grid()
pylab.show()
-
diff --git a/gr-digital/examples/demod/pam_timing.grc b/gr-digital/examples/demod/pam_timing.grc
index cb1f1ad981..3c0fcfeda0 100644
--- a/gr-digital/examples/demod/pam_timing.grc
+++ b/gr-digital/examples/demod/pam_timing.grc
@@ -1,22 +1,23 @@
-<?xml version='1.0' encoding='ASCII'?>
+<?xml version='1.0' encoding='utf-8'?>
+<?grc format='1' created='3.7.10'?>
<flow_graph>
<timestamp>Sat Jul 12 13:50:56 2014</timestamp>
<block>
<key>options</key>
<param>
- <key>id</key>
- <value>pam_timing</value>
+ <key>author</key>
+ <value></value>
</param>
<param>
- <key>_enabled</key>
- <value>True</value>
+ <key>window_size</key>
+ <value>1280, 1024</value>
</param>
<param>
- <key>title</key>
- <value></value>
+ <key>category</key>
+ <value>Custom</value>
</param>
<param>
- <key>author</key>
+ <key>comment</key>
<value></value>
</param>
<param>
@@ -24,16 +25,44 @@
<value></value>
</param>
<param>
- <key>window_size</key>
- <value>1280, 1024</value>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(-1, 0)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
</param>
<param>
<key>generate_options</key>
<value>qt_gui</value>
</param>
<param>
- <key>category</key>
- <value>Custom</value>
+ <key>hier_block_src_path</key>
+ <value>.:</value>
+ </param>
+ <param>
+ <key>id</key>
+ <value>pam_timing</value>
+ </param>
+ <param>
+ <key>max_nouts</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>qt_qss_theme</key>
+ <value></value>
+ </param>
+ <param>
+ <key>realtime_scheduling</key>
+ <value></value>
+ </param>
+ <param>
+ <key>run_command</key>
+ <value>{python} -u {filename}</value>
</param>
<param>
<key>run_options</key>
@@ -44,233 +73,445 @@
<value>True</value>
</param>
<param>
- <key>max_nouts</key>
- <value>0</value>
+ <key>thread_safe_setters</key>
+ <value></value>
</param>
<param>
- <key>realtime_scheduling</key>
+ <key>title</key>
<value></value>
</param>
+ </block>
+ <block>
+ <key>variable</key>
<param>
- <key>alias</key>
+ <key>comment</key>
<value></value>
</param>
<param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
<key>_coordinate</key>
- <value>(-1, 0)</value>
+ <value>(206, 116)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
- </block>
- <block>
- <key>variable</key>
<param>
<key>id</key>
<value>const</value>
</param>
<param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
<key>value</key>
<value>digital.qpsk_constellation()</value>
</param>
+ </block>
+ <block>
+ <key>variable_qtgui_range</key>
<param>
- <key>alias</key>
+ <key>comment</key>
<value></value>
</param>
<param>
+ <key>value</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
<key>_coordinate</key>
- <value>(206, 116)</value>
+ <value>(268, 527)</value>
+ </param>
+ <param>
+ <key>gui_hint</key>
+ <value>4,2,1,1</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
- </block>
- <block>
- <key>variable</key>
<param>
<key>id</key>
- <value>sig_amp</value>
+ <value>freq_offset</value>
</param>
<param>
- <key>_enabled</key>
- <value>True</value>
+ <key>label</key>
+ <value>Frequency Offset</value>
+ </param>
+ <param>
+ <key>min_len</key>
+ <value>200</value>
+ </param>
+ <param>
+ <key>orient</key>
+ <value>Qt.Horizontal</value>
+ </param>
+ <param>
+ <key>start</key>
+ <value>-.5</value>
+ </param>
+ <param>
+ <key>step</key>
+ <value>.01</value>
+ </param>
+ <param>
+ <key>stop</key>
+ <value>.5</value>
+ </param>
+ <param>
+ <key>rangeType</key>
+ <value>float</value>
+ </param>
+ <param>
+ <key>widget</key>
+ <value>counter_slider</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_qtgui_range</key>
+ <param>
+ <key>comment</key>
+ <value></value>
</param>
<param>
<key>value</key>
<value>1</value>
</param>
<param>
- <key>alias</key>
- <value></value>
+ <key>_enabled</key>
+ <value>True</value>
</param>
<param>
<key>_coordinate</key>
- <value>(791, 46)</value>
+ <value>(6, 526)</value>
+ </param>
+ <param>
+ <key>gui_hint</key>
+ <value>2,2,1,1</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
- </block>
- <block>
- <key>variable</key>
<param>
<key>id</key>
- <value>samp_rate</value>
+ <value>interpratio</value>
</param>
<param>
- <key>_enabled</key>
- <value>True</value>
+ <key>label</key>
+ <value>Timing Offset</value>
</param>
<param>
- <key>value</key>
- <value>32000</value>
+ <key>min_len</key>
+ <value>200</value>
</param>
<param>
- <key>alias</key>
- <value></value>
+ <key>orient</key>
+ <value>Qt.Horizontal</value>
</param>
<param>
- <key>_coordinate</key>
- <value>(267, 357)</value>
+ <key>start</key>
+ <value>.99</value>
</param>
<param>
- <key>_rotation</key>
- <value>0</value>
+ <key>step</key>
+ <value>0.0001</value>
+ </param>
+ <param>
+ <key>stop</key>
+ <value>1.01</value>
+ </param>
+ <param>
+ <key>rangeType</key>
+ <value>float</value>
+ </param>
+ <param>
+ <key>widget</key>
+ <value>counter_slider</value>
</param>
</block>
<block>
<key>variable</key>
<param>
- <key>id</key>
- <value>spb</value>
+ <key>comment</key>
+ <value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
+ <key>_coordinate</key>
+ <value>(562, 334)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>id</key>
+ <value>nfilts</value>
+ </param>
+ <param>
<key>value</key>
- <value>4.2563</value>
+ <value>32</value>
</param>
+ </block>
+ <block>
+ <key>variable_qtgui_range</key>
<param>
- <key>alias</key>
+ <key>comment</key>
<value></value>
</param>
<param>
+ <key>value</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
<key>_coordinate</key>
- <value>(300, 0)</value>
+ <value>(130, 528)</value>
+ </param>
+ <param>
+ <key>gui_hint</key>
+ <value>3,2,1,1</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
+ <param>
+ <key>id</key>
+ <value>noise_amp</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Channel Noise</value>
+ </param>
+ <param>
+ <key>min_len</key>
+ <value>200</value>
+ </param>
+ <param>
+ <key>orient</key>
+ <value>Qt.Horizontal</value>
+ </param>
+ <param>
+ <key>start</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>step</key>
+ <value>.001</value>
+ </param>
+ <param>
+ <key>stop</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>rangeType</key>
+ <value>float</value>
+ </param>
+ <param>
+ <key>widget</key>
+ <value>counter_slider</value>
+ </param>
</block>
<block>
<key>variable</key>
<param>
- <key>id</key>
- <value>rolloff</value>
+ <key>comment</key>
+ <value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
+ <key>_coordinate</key>
+ <value>(482, 335)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>id</key>
+ <value>rolloff</value>
+ </param>
+ <param>
<key>value</key>
<value>.35</value>
</param>
+ </block>
+ <block>
+ <key>variable</key>
<param>
- <key>alias</key>
+ <key>comment</key>
<value></value>
</param>
<param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
<key>_coordinate</key>
- <value>(482, 335)</value>
+ <value>(267, 357)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
+ <param>
+ <key>id</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>32000</value>
+ </param>
</block>
<block>
<key>variable</key>
<param>
- <key>id</key>
- <value>nfilts</value>
+ <key>comment</key>
+ <value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
+ <key>_coordinate</key>
+ <value>(791, 46)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>id</key>
+ <value>sig_amp</value>
+ </param>
+ <param>
<key>value</key>
- <value>32</value>
+ <value>1</value>
</param>
+ </block>
+ <block>
+ <key>variable</key>
<param>
- <key>alias</key>
+ <key>comment</key>
<value></value>
</param>
<param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
<key>_coordinate</key>
- <value>(562, 334)</value>
+ <value>(300, 0)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
+ <param>
+ <key>id</key>
+ <value>spb</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>4.2563</value>
+ </param>
</block>
<block>
- <key>analog_random_source_x</key>
+ <key>variable_qtgui_range</key>
<param>
- <key>id</key>
- <value>analog_random_source_x</value>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
- <key>type</key>
- <value>byte</value>
+ <key>_coordinate</key>
+ <value>(451, 0)</value>
</param>
<param>
- <key>min</key>
+ <key>gui_hint</key>
+ <value>1,2,1,1</value>
+ </param>
+ <param>
+ <key>_rotation</key>
<value>0</value>
</param>
<param>
- <key>max</key>
- <value>const.arity()</value>
+ <key>id</key>
+ <value>time_bw</value>
</param>
<param>
- <key>num_samps</key>
- <value>10000000</value>
+ <key>label</key>
+ <value>Timing Loop BW</value>
</param>
<param>
- <key>repeat</key>
- <value>True</value>
+ <key>min_len</key>
+ <value>200</value>
</param>
<param>
+ <key>orient</key>
+ <value>Qt.Horizontal</value>
+ </param>
+ <param>
+ <key>start</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>step</key>
+ <value>.001</value>
+ </param>
+ <param>
+ <key>stop</key>
+ <value>.1</value>
+ </param>
+ <param>
+ <key>rangeType</key>
+ <value>float</value>
+ </param>
+ <param>
+ <key>widget</key>
+ <value>counter_slider</value>
+ </param>
+ </block>
+ <block>
+ <key>analog_random_source_x</key>
+ <param>
<key>alias</key>
<value></value>
</param>
<param>
- <key>affinity</key>
+ <key>comment</key>
<value></value>
</param>
<param>
- <key>minoutbuf</key>
- <value>0</value>
+ <key>affinity</key>
+ <value></value>
</param>
<param>
- <key>maxoutbuf</key>
- <value>0</value>
+ <key>_enabled</key>
+ <value>True</value>
</param>
<param>
<key>_coordinate</key>
@@ -280,103 +521,107 @@
<key>_rotation</key>
<value>0</value>
</param>
- </block>
- <block>
- <key>digital_chunks_to_symbols_xx</key>
<param>
<key>id</key>
- <value>digital_chunks_to_symbols_xx</value>
+ <value>analog_random_source_x</value>
</param>
<param>
- <key>_enabled</key>
- <value>True</value>
+ <key>maxoutbuf</key>
+ <value>0</value>
</param>
<param>
- <key>in_type</key>
- <value>byte</value>
+ <key>max</key>
+ <value>const.arity()</value>
</param>
<param>
- <key>out_type</key>
- <value>complex</value>
+ <key>minoutbuf</key>
+ <value>0</value>
</param>
<param>
- <key>symbol_table</key>
- <value>const.points()</value>
+ <key>min</key>
+ <value>0</value>
</param>
<param>
- <key>dimension</key>
- <value>1</value>
+ <key>num_samps</key>
+ <value>10000000</value>
</param>
<param>
- <key>num_ports</key>
- <value>1</value>
+ <key>type</key>
+ <value>byte</value>
</param>
<param>
+ <key>repeat</key>
+ <value>True</value>
+ </param>
+ </block>
+ <block>
+ <key>blocks_multiply_const_vxx</key>
+ <param>
<key>alias</key>
<value></value>
</param>
<param>
- <key>affinity</key>
+ <key>comment</key>
<value></value>
</param>
<param>
- <key>minoutbuf</key>
- <value>0</value>
+ <key>const</key>
+ <value>sig_amp</value>
</param>
<param>
- <key>maxoutbuf</key>
- <value>0</value>
+ <key>affinity</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
</param>
<param>
<key>_coordinate</key>
- <value>(203, 178)</value>
+ <value>(760, 159)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
- </block>
- <block>
- <key>blocks_throttle</key>
<param>
<key>id</key>
- <value>blocks_throttle_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
+ <value>blocks_multiply_const_vxx_0</value>
</param>
<param>
<key>type</key>
<value>complex</value>
</param>
<param>
- <key>samples_per_second</key>
- <value>samp_rate</value>
+ <key>maxoutbuf</key>
+ <value>0</value>
</param>
<param>
- <key>vlen</key>
- <value>1</value>
+ <key>minoutbuf</key>
+ <value>0</value>
</param>
<param>
- <key>ignoretag</key>
- <value>True</value>
+ <key>vlen</key>
+ <value>1</value>
</param>
+ </block>
+ <block>
+ <key>blocks_throttle</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
- <key>affinity</key>
+ <key>comment</key>
<value></value>
</param>
<param>
- <key>minoutbuf</key>
- <value>0</value>
+ <key>affinity</key>
+ <value></value>
</param>
<param>
- <key>maxoutbuf</key>
- <value>0</value>
+ <key>_enabled</key>
+ <value>True</value>
</param>
<param>
<key>_coordinate</key>
@@ -386,43 +631,47 @@
<key>_rotation</key>
<value>0</value>
</param>
- </block>
- <block>
- <key>channels_channel_model</key>
<param>
<key>id</key>
- <value>channels_channel_model_0</value>
+ <value>blocks_throttle_0</value>
</param>
<param>
- <key>_enabled</key>
+ <key>ignoretag</key>
<value>True</value>
</param>
<param>
- <key>noise_voltage</key>
- <value>noise_amp</value>
+ <key>maxoutbuf</key>
+ <value>0</value>
</param>
<param>
- <key>freq_offset</key>
- <value>freq_offset</value>
+ <key>minoutbuf</key>
+ <value>0</value>
</param>
<param>
- <key>epsilon</key>
- <value>interpratio</value>
+ <key>samples_per_second</key>
+ <value>samp_rate</value>
</param>
<param>
- <key>taps</key>
- <value>1.0</value>
+ <key>type</key>
+ <value>complex</value>
</param>
<param>
- <key>seed</key>
- <value>42</value>
+ <key>vlen</key>
+ <value>1</value>
+ </param>
+ </block>
+ <block>
+ <key>channels_channel_model</key>
+ <param>
+ <key>alias</key>
+ <value></value>
</param>
<param>
<key>block_tags</key>
<value>False</value>
</param>
<param>
- <key>alias</key>
+ <key>comment</key>
<value></value>
</param>
<param>
@@ -430,12 +679,16 @@
<value></value>
</param>
<param>
- <key>minoutbuf</key>
- <value>0</value>
+ <key>_enabled</key>
+ <value>True</value>
</param>
<param>
- <key>maxoutbuf</key>
- <value>0</value>
+ <key>epsilon</key>
+ <value>interpratio</value>
+ </param>
+ <param>
+ <key>freq_offset</key>
+ <value>freq_offset</value>
</param>
<param>
<key>_coordinate</key>
@@ -445,43 +698,39 @@
<key>_rotation</key>
<value>0</value>
</param>
- </block>
- <block>
- <key>pfb_arb_resampler_xxx</key>
<param>
<key>id</key>
- <value>pfb_arb_resampler_xxx_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
+ <value>channels_channel_model_0</value>
</param>
<param>
- <key>type</key>
- <value>ccf</value>
+ <key>maxoutbuf</key>
+ <value>0</value>
</param>
<param>
- <key>rrate</key>
- <value>spb</value>
+ <key>minoutbuf</key>
+ <value>0</value>
</param>
<param>
- <key>taps</key>
- <value>firdes.root_raised_cosine(nfilts, nfilts, 1.0, rolloff, 44*nfilts)</value>
+ <key>noise_voltage</key>
+ <value>noise_amp</value>
</param>
<param>
- <key>nfilts</key>
- <value>32</value>
+ <key>seed</key>
+ <value>42</value>
</param>
<param>
- <key>atten</key>
- <value>100</value>
+ <key>taps</key>
+ <value>1.0</value>
</param>
+ </block>
+ <block>
+ <key>digital_chunks_to_symbols_xx</key>
<param>
- <key>samp_delay</key>
- <value>0</value>
+ <key>alias</key>
+ <value></value>
</param>
<param>
- <key>alias</key>
+ <key>comment</key>
<value></value>
</param>
<param>
@@ -489,73 +738,58 @@
<value></value>
</param>
<param>
- <key>minoutbuf</key>
- <value>0</value>
+ <key>dimension</key>
+ <value>1</value>
</param>
<param>
- <key>maxoutbuf</key>
- <value>0</value>
+ <key>_enabled</key>
+ <value>True</value>
</param>
<param>
<key>_coordinate</key>
- <value>(458, 179)</value>
+ <value>(203, 178)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
- </block>
- <block>
- <key>import</key>
<param>
<key>id</key>
- <value>import_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>import</key>
- <value>from gnuradio import digital</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
+ <value>digital_chunks_to_symbols_xx</value>
</param>
<param>
- <key>_coordinate</key>
- <value>(-1, 61)</value>
+ <key>in_type</key>
+ <value>byte</value>
</param>
<param>
- <key>_rotation</key>
+ <key>maxoutbuf</key>
<value>0</value>
</param>
- </block>
- <block>
- <key>blocks_multiply_const_vxx</key>
<param>
- <key>id</key>
- <value>blocks_multiply_const_vxx_0</value>
+ <key>minoutbuf</key>
+ <value>0</value>
</param>
<param>
- <key>_enabled</key>
- <value>True</value>
+ <key>num_ports</key>
+ <value>1</value>
</param>
<param>
- <key>type</key>
+ <key>out_type</key>
<value>complex</value>
</param>
<param>
- <key>const</key>
- <value>sig_amp</value>
+ <key>symbol_table</key>
+ <value>const.points()</value>
</param>
+ </block>
+ <block>
+ <key>digital_pfb_clock_sync_xxx</key>
<param>
- <key>vlen</key>
- <value>1</value>
+ <key>alias</key>
+ <value></value>
</param>
<param>
- <key>alias</key>
+ <key>comment</key>
<value></value>
</param>
<param>
@@ -563,614 +797,616 @@
<value></value>
</param>
<param>
- <key>minoutbuf</key>
- <value>0</value>
+ <key>_enabled</key>
+ <value>True</value>
</param>
<param>
- <key>maxoutbuf</key>
- <value>0</value>
+ <key>filter_size</key>
+ <value>nfilts</value>
</param>
<param>
<key>_coordinate</key>
- <value>(760, 159)</value>
+ <value>(467, 403)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
- </block>
- <block>
- <key>qtgui_time_sink_x</key>
<param>
<key>id</key>
- <value>qtgui_time_sink_x_0</value>
+ <value>digital_pfb_clock_sync_xxx_0</value>
</param>
<param>
- <key>_enabled</key>
- <value>True</value>
+ <key>init_phase</key>
+ <value>0</value>
</param>
<param>
- <key>type</key>
- <value>complex</value>
+ <key>loop_bw</key>
+ <value>time_bw</value>
</param>
<param>
- <key>name</key>
- <value>Error</value>
+ <key>maxoutbuf</key>
+ <value>0</value>
</param>
<param>
- <key>ylabel</key>
- <value>Amplitude</value>
+ <key>max_dev</key>
+ <value>1.5</value>
</param>
<param>
- <key>yunit</key>
- <value>""</value>
+ <key>minoutbuf</key>
+ <value>0</value>
</param>
<param>
- <key>size</key>
- <value>1024</value>
+ <key>osps</key>
+ <value>1</value>
</param>
<param>
- <key>srate</key>
- <value>samp_rate</value>
+ <key>sps</key>
+ <value>spb</value>
</param>
<param>
- <key>grid</key>
- <value>False</value>
+ <key>taps</key>
+ <value>firdes.root_raised_cosine(nfilts, nfilts*spb, 1.0, rolloff, 44*nfilts)</value>
</param>
<param>
- <key>autoscale</key>
- <value>False</value>
+ <key>type</key>
+ <value>ccf</value>
</param>
+ </block>
+ <block>
+ <key>import</key>
<param>
- <key>ymin</key>
- <value>-1</value>
+ <key>alias</key>
+ <value></value>
</param>
<param>
- <key>ymax</key>
- <value>1</value>
+ <key>comment</key>
+ <value></value>
</param>
<param>
- <key>nconnections</key>
- <value>1</value>
+ <key>_enabled</key>
+ <value>True</value>
</param>
<param>
- <key>update_time</key>
- <value>0.10</value>
+ <key>_coordinate</key>
+ <value>(-1, 61)</value>
</param>
<param>
- <key>entags</key>
- <value>True</value>
+ <key>_rotation</key>
+ <value>0</value>
</param>
<param>
- <key>gui_hint</key>
- <value>notebook@3</value>
+ <key>id</key>
+ <value>import_0</value>
</param>
<param>
- <key>tr_mode</key>
- <value>qtgui.TRIG_MODE_FREE</value>
+ <key>import</key>
+ <value>from gnuradio import digital</value>
</param>
+ </block>
+ <block>
+ <key>qtgui_tab_widget</key>
<param>
- <key>tr_slope</key>
- <value>qtgui.TRIG_SLOPE_POS</value>
+ <key>alias</key>
+ <value></value>
</param>
<param>
- <key>tr_level</key>
- <value>0.0</value>
+ <key>comment</key>
+ <value></value>
</param>
<param>
- <key>tr_delay</key>
- <value>0</value>
+ <key>_enabled</key>
+ <value>True</value>
</param>
<param>
- <key>tr_chan</key>
+ <key>_coordinate</key>
+ <value>(485, 554)</value>
+ </param>
+ <param>
+ <key>gui_hint</key>
+ <value>1,1,5,1</value>
+ </param>
+ <param>
+ <key>_rotation</key>
<value>0</value>
</param>
<param>
- <key>tr_tag</key>
- <value>""</value>
+ <key>id</key>
+ <value>notebook</value>
+ </param>
+ <param>
+ <key>label0</key>
+ <value>Error</value>
</param>
<param>
<key>label1</key>
- <value></value>
+ <value>Phase</value>
</param>
<param>
- <key>width1</key>
- <value>1</value>
+ <key>label10</key>
+ <value>Tab 10</value>
</param>
<param>
- <key>color1</key>
- <value>"blue"</value>
+ <key>label11</key>
+ <value>Tab 11</value>
</param>
<param>
- <key>style1</key>
- <value>1</value>
+ <key>label12</key>
+ <value>Tab 12</value>
</param>
<param>
- <key>marker1</key>
- <value>-1</value>
+ <key>label13</key>
+ <value>Tab 13</value>
</param>
<param>
- <key>alpha1</key>
- <value>1.0</value>
+ <key>label14</key>
+ <value>Tab 14</value>
</param>
<param>
- <key>label2</key>
- <value></value>
+ <key>label15</key>
+ <value>Tab 15</value>
</param>
<param>
- <key>width2</key>
- <value>1</value>
+ <key>label16</key>
+ <value>Tab 16</value>
</param>
<param>
- <key>color2</key>
- <value>"red"</value>
+ <key>label17</key>
+ <value>Tab 17</value>
</param>
<param>
- <key>style2</key>
- <value>1</value>
+ <key>label18</key>
+ <value>Tab 18</value>
</param>
<param>
- <key>marker2</key>
- <value>-1</value>
+ <key>label19</key>
+ <value>Tab 19</value>
</param>
<param>
- <key>alpha2</key>
- <value>1.0</value>
+ <key>label2</key>
+ <value>Freq</value>
</param>
<param>
<key>label3</key>
- <value></value>
+ <value>Resampled Signal</value>
</param>
<param>
- <key>width3</key>
- <value>1</value>
+ <key>label4</key>
+ <value>Tab 4</value>
</param>
<param>
- <key>color3</key>
- <value>"green"</value>
+ <key>label5</key>
+ <value>Tab 5</value>
</param>
<param>
- <key>style3</key>
- <value>1</value>
+ <key>label6</key>
+ <value>Tab 6</value>
</param>
<param>
- <key>marker3</key>
- <value>-1</value>
+ <key>label7</key>
+ <value>Tab 7</value>
</param>
<param>
- <key>alpha3</key>
- <value>1.0</value>
+ <key>label8</key>
+ <value>Tab 8</value>
</param>
<param>
- <key>label4</key>
+ <key>label9</key>
+ <value>Tab 9</value>
+ </param>
+ <param>
+ <key>num_tabs</key>
+ <value>4</value>
+ </param>
+ </block>
+ <block>
+ <key>pfb_arb_resampler_xxx</key>
+ <param>
+ <key>alias</key>
<value></value>
</param>
<param>
- <key>width4</key>
- <value>1</value>
+ <key>comment</key>
+ <value></value>
</param>
<param>
- <key>color4</key>
- <value>"black"</value>
+ <key>affinity</key>
+ <value></value>
</param>
<param>
- <key>style4</key>
- <value>1</value>
+ <key>_enabled</key>
+ <value>True</value>
</param>
<param>
- <key>marker4</key>
- <value>-1</value>
+ <key>_coordinate</key>
+ <value>(458, 179)</value>
</param>
<param>
- <key>alpha4</key>
- <value>1.0</value>
+ <key>_rotation</key>
+ <value>0</value>
</param>
<param>
- <key>label5</key>
- <value></value>
+ <key>id</key>
+ <value>pfb_arb_resampler_xxx_0</value>
</param>
<param>
- <key>width5</key>
- <value>1</value>
+ <key>maxoutbuf</key>
+ <value>0</value>
</param>
<param>
- <key>color5</key>
- <value>"cyan"</value>
+ <key>minoutbuf</key>
+ <value>0</value>
</param>
<param>
- <key>style5</key>
- <value>1</value>
+ <key>nfilts</key>
+ <value>32</value>
</param>
<param>
- <key>marker5</key>
- <value>-1</value>
+ <key>rrate</key>
+ <value>spb</value>
</param>
<param>
- <key>alpha5</key>
- <value>1.0</value>
+ <key>samp_delay</key>
+ <value>0</value>
</param>
<param>
- <key>label6</key>
- <value></value>
+ <key>atten</key>
+ <value>100</value>
</param>
<param>
- <key>width6</key>
- <value>1</value>
+ <key>taps</key>
+ <value>firdes.root_raised_cosine(nfilts, nfilts, 1.0, rolloff, 44*nfilts)</value>
</param>
<param>
- <key>color6</key>
- <value>"magenta"</value>
+ <key>type</key>
+ <value>ccf</value>
</param>
+ </block>
+ <block>
+ <key>qtgui_time_sink_x</key>
<param>
- <key>style6</key>
- <value>1</value>
+ <key>autoscale</key>
+ <value>False</value>
</param>
<param>
- <key>marker6</key>
- <value>-1</value>
+ <key>axislabels</key>
+ <value>True</value>
</param>
<param>
- <key>alpha6</key>
- <value>1.0</value>
+ <key>alias</key>
+ <value></value>
</param>
<param>
- <key>label7</key>
+ <key>comment</key>
<value></value>
</param>
<param>
- <key>width7</key>
- <value>1</value>
+ <key>ctrlpanel</key>
+ <value>False</value>
</param>
<param>
- <key>color7</key>
- <value>"yellow"</value>
+ <key>affinity</key>
+ <value></value>
</param>
<param>
- <key>style7</key>
- <value>1</value>
+ <key>entags</key>
+ <value>True</value>
</param>
<param>
- <key>marker7</key>
- <value>-1</value>
+ <key>_enabled</key>
+ <value>True</value>
</param>
<param>
- <key>alpha7</key>
- <value>1.0</value>
+ <key>_coordinate</key>
+ <value>(1020, 128)</value>
</param>
<param>
- <key>label8</key>
- <value></value>
+ <key>gui_hint</key>
+ <value>notebook@3</value>
</param>
<param>
- <key>width8</key>
- <value>1</value>
+ <key>_rotation</key>
+ <value>0</value>
</param>
<param>
- <key>color8</key>
- <value>"dark red"</value>
+ <key>grid</key>
+ <value>False</value>
</param>
<param>
- <key>style8</key>
- <value>1</value>
+ <key>id</key>
+ <value>qtgui_time_sink_x_0</value>
</param>
<param>
- <key>marker8</key>
- <value>-1</value>
+ <key>legend</key>
+ <value>True</value>
</param>
<param>
- <key>alpha8</key>
+ <key>alpha1</key>
<value>1.0</value>
</param>
<param>
- <key>label9</key>
- <value></value>
+ <key>color1</key>
+ <value>"blue"</value>
</param>
<param>
- <key>width9</key>
- <value>1</value>
+ <key>label1</key>
+ <value></value>
</param>
<param>
- <key>color9</key>
- <value>"dark green"</value>
+ <key>marker1</key>
+ <value>-1</value>
</param>
<param>
- <key>style9</key>
+ <key>style1</key>
<value>1</value>
</param>
<param>
- <key>marker9</key>
- <value>-1</value>
+ <key>width1</key>
+ <value>1</value>
</param>
<param>
- <key>alpha9</key>
+ <key>alpha10</key>
<value>1.0</value>
</param>
<param>
- <key>label10</key>
- <value></value>
+ <key>color10</key>
+ <value>"blue"</value>
</param>
<param>
- <key>width10</key>
- <value>1</value>
+ <key>label10</key>
+ <value></value>
</param>
<param>
- <key>color10</key>
- <value>"blue"</value>
+ <key>marker10</key>
+ <value>-1</value>
</param>
<param>
<key>style10</key>
<value>1</value>
</param>
<param>
- <key>marker10</key>
- <value>-1</value>
+ <key>width10</key>
+ <value>1</value>
</param>
<param>
- <key>alpha10</key>
+ <key>alpha2</key>
<value>1.0</value>
</param>
<param>
- <key>alias</key>
- <value></value>
+ <key>color2</key>
+ <value>"red"</value>
</param>
<param>
- <key>affinity</key>
+ <key>label2</key>
<value></value>
</param>
<param>
- <key>_coordinate</key>
- <value>(1020, 128)</value>
+ <key>marker2</key>
+ <value>-1</value>
</param>
<param>
- <key>_rotation</key>
- <value>0</value>
+ <key>style2</key>
+ <value>1</value>
</param>
- </block>
- <block>
- <key>qtgui_tab_widget</key>
<param>
- <key>id</key>
- <value>notebook</value>
+ <key>width2</key>
+ <value>1</value>
</param>
<param>
- <key>_enabled</key>
- <value>True</value>
+ <key>alpha3</key>
+ <value>1.0</value>
</param>
<param>
- <key>num_tabs</key>
- <value>4</value>
+ <key>color3</key>
+ <value>"green"</value>
</param>
<param>
- <key>label0</key>
- <value>Error</value>
+ <key>label3</key>
+ <value></value>
</param>
<param>
- <key>label1</key>
- <value>Phase</value>
+ <key>marker3</key>
+ <value>-1</value>
</param>
<param>
- <key>label2</key>
- <value>Freq</value>
+ <key>style3</key>
+ <value>1</value>
</param>
<param>
- <key>label3</key>
- <value>Resampled Signal</value>
+ <key>width3</key>
+ <value>1</value>
</param>
<param>
- <key>label4</key>
- <value>Tab 4</value>
+ <key>alpha4</key>
+ <value>1.0</value>
</param>
<param>
- <key>gui_hint</key>
- <value>1,1,5,1</value>
+ <key>color4</key>
+ <value>"black"</value>
</param>
<param>
- <key>alias</key>
+ <key>label4</key>
<value></value>
</param>
<param>
- <key>_coordinate</key>
- <value>(485, 554)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_qtgui_range</key>
- <param>
- <key>id</key>
- <value>interpratio</value>
+ <key>marker4</key>
+ <value>-1</value>
</param>
<param>
- <key>_enabled</key>
- <value>True</value>
+ <key>style4</key>
+ <value>1</value>
</param>
<param>
- <key>label</key>
- <value>Timing Offset</value>
+ <key>width4</key>
+ <value>1</value>
</param>
<param>
- <key>value</key>
- <value>1</value>
+ <key>alpha5</key>
+ <value>1.0</value>
</param>
<param>
- <key>start</key>
- <value>.99</value>
+ <key>color5</key>
+ <value>"cyan"</value>
</param>
<param>
- <key>stop</key>
- <value>1.01</value>
+ <key>label5</key>
+ <value></value>
</param>
<param>
- <key>step</key>
- <value>0.0001</value>
+ <key>marker5</key>
+ <value>-1</value>
</param>
<param>
- <key>widget</key>
- <value>counter_slider</value>
+ <key>style5</key>
+ <value>1</value>
</param>
<param>
- <key>orient</key>
- <value>Qt.Horizontal</value>
+ <key>width5</key>
+ <value>1</value>
</param>
<param>
- <key>min_len</key>
- <value>200</value>
+ <key>alpha6</key>
+ <value>1.0</value>
</param>
<param>
- <key>gui_hint</key>
- <value>2,2,1,1</value>
+ <key>color6</key>
+ <value>"magenta"</value>
</param>
<param>
- <key>alias</key>
+ <key>label6</key>
<value></value>
</param>
<param>
- <key>_coordinate</key>
- <value>(6, 526)</value>
+ <key>marker6</key>
+ <value>-1</value>
</param>
<param>
- <key>_rotation</key>
- <value>0</value>
+ <key>style6</key>
+ <value>1</value>
</param>
- </block>
- <block>
- <key>variable_qtgui_range</key>
<param>
- <key>id</key>
- <value>noise_amp</value>
+ <key>width6</key>
+ <value>1</value>
</param>
<param>
- <key>_enabled</key>
- <value>True</value>
+ <key>alpha7</key>
+ <value>1.0</value>
</param>
<param>
- <key>label</key>
- <value>Channel Noise</value>
+ <key>color7</key>
+ <value>"yellow"</value>
</param>
<param>
- <key>value</key>
- <value>0</value>
+ <key>label7</key>
+ <value></value>
</param>
<param>
- <key>start</key>
- <value>0</value>
+ <key>marker7</key>
+ <value>-1</value>
</param>
<param>
- <key>stop</key>
+ <key>style7</key>
<value>1</value>
</param>
<param>
- <key>step</key>
- <value>.001</value>
- </param>
- <param>
- <key>widget</key>
- <value>counter_slider</value>
+ <key>width7</key>
+ <value>1</value>
</param>
<param>
- <key>orient</key>
- <value>Qt.Horizontal</value>
+ <key>alpha8</key>
+ <value>1.0</value>
</param>
<param>
- <key>min_len</key>
- <value>200</value>
+ <key>color8</key>
+ <value>"dark red"</value>
</param>
<param>
- <key>gui_hint</key>
- <value>3,2,1,1</value>
+ <key>label8</key>
+ <value></value>
</param>
<param>
- <key>alias</key>
- <value></value>
+ <key>marker8</key>
+ <value>-1</value>
</param>
<param>
- <key>_coordinate</key>
- <value>(130, 528)</value>
+ <key>style8</key>
+ <value>1</value>
</param>
<param>
- <key>_rotation</key>
- <value>0</value>
+ <key>width8</key>
+ <value>1</value>
</param>
- </block>
- <block>
- <key>variable_qtgui_range</key>
<param>
- <key>id</key>
- <value>freq_offset</value>
+ <key>alpha9</key>
+ <value>1.0</value>
</param>
<param>
- <key>_enabled</key>
- <value>True</value>
+ <key>color9</key>
+ <value>"dark green"</value>
</param>
<param>
- <key>label</key>
- <value>Frequency Offset</value>
+ <key>label9</key>
+ <value></value>
</param>
<param>
- <key>value</key>
- <value>0</value>
+ <key>marker9</key>
+ <value>-1</value>
</param>
<param>
- <key>start</key>
- <value>-.5</value>
+ <key>style9</key>
+ <value>1</value>
</param>
<param>
- <key>stop</key>
- <value>.5</value>
+ <key>width9</key>
+ <value>1</value>
</param>
<param>
- <key>step</key>
- <value>.01</value>
+ <key>name</key>
+ <value>Error</value>
</param>
<param>
- <key>widget</key>
- <value>counter_slider</value>
+ <key>nconnections</key>
+ <value>1</value>
</param>
<param>
- <key>orient</key>
- <value>Qt.Horizontal</value>
+ <key>size</key>
+ <value>1024</value>
</param>
<param>
- <key>min_len</key>
- <value>200</value>
+ <key>srate</key>
+ <value>samp_rate</value>
</param>
<param>
- <key>gui_hint</key>
- <value>4,2,1,1</value>
+ <key>tr_chan</key>
+ <value>0</value>
</param>
<param>
- <key>alias</key>
- <value></value>
+ <key>tr_delay</key>
+ <value>0</value>
</param>
<param>
- <key>_coordinate</key>
- <value>(268, 527)</value>
+ <key>tr_level</key>
+ <value>0.0</value>
</param>
<param>
- <key>_rotation</key>
- <value>0</value>
+ <key>tr_mode</key>
+ <value>qtgui.TRIG_MODE_FREE</value>
</param>
- </block>
- <block>
- <key>qtgui_time_sink_x</key>
<param>
- <key>id</key>
- <value>qtgui_time_sink_x_1_1</value>
+ <key>tr_slope</key>
+ <value>qtgui.TRIG_SLOPE_POS</value>
</param>
<param>
- <key>_enabled</key>
- <value>True</value>
+ <key>tr_tag</key>
+ <value>""</value>
</param>
<param>
<key>type</key>
- <value>float</value>
+ <value>complex</value>
</param>
<param>
- <key>name</key>
- <value>Phase</value>
+ <key>update_time</key>
+ <value>0.10</value>
</param>
<param>
<key>ylabel</key>
@@ -1181,343 +1417,359 @@
<value>""</value>
</param>
<param>
- <key>size</key>
- <value>1024</value>
+ <key>ymax</key>
+ <value>1</value>
</param>
<param>
- <key>srate</key>
- <value>samp_rate</value>
+ <key>ymin</key>
+ <value>-1</value>
</param>
+ </block>
+ <block>
+ <key>qtgui_time_sink_x</key>
<param>
- <key>grid</key>
+ <key>autoscale</key>
<value>False</value>
</param>
<param>
- <key>autoscale</key>
+ <key>axislabels</key>
<value>True</value>
</param>
<param>
- <key>ymin</key>
- <value>-1</value>
+ <key>alias</key>
+ <value></value>
</param>
<param>
- <key>ymax</key>
- <value>1</value>
+ <key>comment</key>
+ <value></value>
</param>
<param>
- <key>nconnections</key>
- <value>1</value>
+ <key>ctrlpanel</key>
+ <value>False</value>
</param>
<param>
- <key>update_time</key>
- <value>0.10</value>
+ <key>affinity</key>
+ <value></value>
</param>
<param>
<key>entags</key>
<value>True</value>
</param>
<param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(1029, 281)</value>
+ </param>
+ <param>
<key>gui_hint</key>
- <value>notebook@1</value>
+ <value></value>
</param>
<param>
- <key>tr_mode</key>
- <value>qtgui.TRIG_MODE_FREE</value>
+ <key>_rotation</key>
+ <value>0</value>
</param>
<param>
- <key>tr_slope</key>
- <value>qtgui.TRIG_SLOPE_POS</value>
+ <key>grid</key>
+ <value>False</value>
</param>
<param>
- <key>tr_level</key>
- <value>0.0</value>
+ <key>id</key>
+ <value>qtgui_time_sink_x_0_0</value>
</param>
<param>
- <key>tr_delay</key>
- <value>0</value>
+ <key>legend</key>
+ <value>True</value>
</param>
<param>
- <key>tr_chan</key>
- <value>0</value>
+ <key>alpha1</key>
+ <value>1.0</value>
</param>
<param>
- <key>tr_tag</key>
- <value>""</value>
+ <key>color1</key>
+ <value>"blue"</value>
</param>
<param>
<key>label1</key>
<value></value>
</param>
<param>
+ <key>marker1</key>
+ <value>-1</value>
+ </param>
+ <param>
+ <key>style1</key>
+ <value>1</value>
+ </param>
+ <param>
<key>width1</key>
<value>1</value>
</param>
<param>
- <key>color1</key>
+ <key>alpha10</key>
+ <value>1.0</value>
+ </param>
+ <param>
+ <key>color10</key>
<value>"blue"</value>
</param>
<param>
- <key>style1</key>
- <value>1</value>
+ <key>label10</key>
+ <value></value>
</param>
<param>
- <key>marker1</key>
+ <key>marker10</key>
<value>-1</value>
</param>
<param>
- <key>alpha1</key>
- <value>1.0</value>
+ <key>style10</key>
+ <value>1</value>
</param>
<param>
- <key>label2</key>
- <value></value>
+ <key>width10</key>
+ <value>1</value>
</param>
<param>
- <key>width2</key>
- <value>1</value>
+ <key>alpha2</key>
+ <value>1.0</value>
</param>
<param>
<key>color2</key>
<value>"red"</value>
</param>
<param>
- <key>style2</key>
- <value>1</value>
+ <key>label2</key>
+ <value></value>
</param>
<param>
<key>marker2</key>
<value>-1</value>
</param>
<param>
- <key>alpha2</key>
- <value>1.0</value>
+ <key>style2</key>
+ <value>1</value>
</param>
<param>
- <key>label3</key>
- <value></value>
+ <key>width2</key>
+ <value>1</value>
</param>
<param>
- <key>width3</key>
- <value>1</value>
+ <key>alpha3</key>
+ <value>1.0</value>
</param>
<param>
<key>color3</key>
<value>"green"</value>
</param>
<param>
- <key>style3</key>
- <value>1</value>
+ <key>label3</key>
+ <value></value>
</param>
<param>
<key>marker3</key>
<value>-1</value>
</param>
<param>
- <key>alpha3</key>
- <value>1.0</value>
+ <key>style3</key>
+ <value>1</value>
</param>
<param>
- <key>label4</key>
- <value></value>
+ <key>width3</key>
+ <value>1</value>
</param>
<param>
- <key>width4</key>
- <value>1</value>
+ <key>alpha4</key>
+ <value>1.0</value>
</param>
<param>
<key>color4</key>
<value>"black"</value>
</param>
<param>
- <key>style4</key>
- <value>1</value>
+ <key>label4</key>
+ <value></value>
</param>
<param>
<key>marker4</key>
<value>-1</value>
</param>
<param>
- <key>alpha4</key>
- <value>1.0</value>
+ <key>style4</key>
+ <value>1</value>
</param>
<param>
- <key>label5</key>
- <value></value>
+ <key>width4</key>
+ <value>1</value>
</param>
<param>
- <key>width5</key>
- <value>1</value>
+ <key>alpha5</key>
+ <value>1.0</value>
</param>
<param>
<key>color5</key>
<value>"cyan"</value>
</param>
<param>
- <key>style5</key>
- <value>1</value>
+ <key>label5</key>
+ <value></value>
</param>
<param>
<key>marker5</key>
<value>-1</value>
</param>
<param>
- <key>alpha5</key>
- <value>1.0</value>
+ <key>style5</key>
+ <value>1</value>
</param>
<param>
- <key>label6</key>
- <value></value>
+ <key>width5</key>
+ <value>1</value>
</param>
<param>
- <key>width6</key>
- <value>1</value>
+ <key>alpha6</key>
+ <value>1.0</value>
</param>
<param>
<key>color6</key>
<value>"magenta"</value>
</param>
<param>
- <key>style6</key>
- <value>1</value>
+ <key>label6</key>
+ <value></value>
</param>
<param>
<key>marker6</key>
<value>-1</value>
</param>
<param>
- <key>alpha6</key>
- <value>1.0</value>
+ <key>style6</key>
+ <value>1</value>
</param>
<param>
- <key>label7</key>
- <value></value>
+ <key>width6</key>
+ <value>1</value>
</param>
<param>
- <key>width7</key>
- <value>1</value>
+ <key>alpha7</key>
+ <value>1.0</value>
</param>
<param>
<key>color7</key>
<value>"yellow"</value>
</param>
<param>
- <key>style7</key>
- <value>1</value>
+ <key>label7</key>
+ <value></value>
</param>
<param>
<key>marker7</key>
<value>-1</value>
</param>
<param>
- <key>alpha7</key>
- <value>1.0</value>
+ <key>style7</key>
+ <value>1</value>
</param>
<param>
- <key>label8</key>
- <value></value>
+ <key>width7</key>
+ <value>1</value>
</param>
<param>
- <key>width8</key>
- <value>1</value>
+ <key>alpha8</key>
+ <value>1.0</value>
</param>
<param>
<key>color8</key>
<value>"dark red"</value>
</param>
<param>
- <key>style8</key>
- <value>1</value>
+ <key>label8</key>
+ <value></value>
</param>
<param>
<key>marker8</key>
<value>-1</value>
</param>
<param>
- <key>alpha8</key>
- <value>1.0</value>
+ <key>style8</key>
+ <value>1</value>
</param>
<param>
- <key>label9</key>
- <value></value>
+ <key>width8</key>
+ <value>1</value>
</param>
<param>
- <key>width9</key>
- <value>1</value>
+ <key>alpha9</key>
+ <value>1.0</value>
</param>
<param>
<key>color9</key>
<value>"dark green"</value>
</param>
<param>
- <key>style9</key>
- <value>1</value>
+ <key>label9</key>
+ <value></value>
</param>
<param>
<key>marker9</key>
<value>-1</value>
</param>
<param>
- <key>alpha9</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label10</key>
- <value></value>
+ <key>style9</key>
+ <value>1</value>
</param>
<param>
- <key>width10</key>
+ <key>width9</key>
<value>1</value>
</param>
<param>
- <key>color10</key>
- <value>"blue"</value>
+ <key>name</key>
+ <value>Scope Plot</value>
</param>
<param>
- <key>style10</key>
+ <key>nconnections</key>
<value>1</value>
</param>
<param>
- <key>marker10</key>
- <value>-1</value>
+ <key>size</key>
+ <value>1024</value>
</param>
<param>
- <key>alpha10</key>
- <value>1.0</value>
+ <key>srate</key>
+ <value>samp_rate</value>
</param>
<param>
- <key>alias</key>
- <value></value>
+ <key>tr_chan</key>
+ <value>0</value>
</param>
<param>
- <key>affinity</key>
- <value></value>
+ <key>tr_delay</key>
+ <value>0</value>
</param>
<param>
- <key>_coordinate</key>
- <value>(1014, 622)</value>
+ <key>tr_level</key>
+ <value>0.0</value>
</param>
<param>
- <key>_rotation</key>
- <value>0</value>
+ <key>tr_mode</key>
+ <value>qtgui.TRIG_MODE_FREE</value>
</param>
- </block>
- <block>
- <key>qtgui_time_sink_x</key>
<param>
- <key>id</key>
- <value>qtgui_time_sink_x_1_0</value>
+ <key>tr_slope</key>
+ <value>qtgui.TRIG_SLOPE_POS</value>
</param>
<param>
- <key>_enabled</key>
- <value>True</value>
+ <key>tr_tag</key>
+ <value>""</value>
</param>
<param>
<key>type</key>
- <value>float</value>
+ <value>complex</value>
</param>
<param>
- <key>name</key>
- <value>Rate</value>
+ <key>update_time</key>
+ <value>0.10</value>
</param>
<param>
<key>ylabel</key>
@@ -1528,343 +1780,359 @@
<value>""</value>
</param>
<param>
- <key>size</key>
- <value>1024</value>
+ <key>ymax</key>
+ <value>1</value>
</param>
<param>
- <key>srate</key>
- <value>samp_rate</value>
+ <key>ymin</key>
+ <value>-1</value>
</param>
+ </block>
+ <block>
+ <key>qtgui_time_sink_x</key>
<param>
- <key>grid</key>
- <value>False</value>
+ <key>autoscale</key>
+ <value>True</value>
</param>
<param>
- <key>autoscale</key>
+ <key>axislabels</key>
<value>True</value>
</param>
<param>
- <key>ymin</key>
- <value>-1</value>
+ <key>alias</key>
+ <value></value>
</param>
<param>
- <key>ymax</key>
- <value>1</value>
+ <key>comment</key>
+ <value></value>
</param>
<param>
- <key>nconnections</key>
- <value>1</value>
+ <key>ctrlpanel</key>
+ <value>False</value>
</param>
<param>
- <key>update_time</key>
- <value>0.10</value>
+ <key>affinity</key>
+ <value></value>
</param>
<param>
<key>entags</key>
<value>True</value>
</param>
<param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(1024, 400)</value>
+ </param>
+ <param>
<key>gui_hint</key>
- <value>notebook@2</value>
+ <value>notebook@0</value>
</param>
<param>
- <key>tr_mode</key>
- <value>qtgui.TRIG_MODE_FREE</value>
+ <key>_rotation</key>
+ <value>0</value>
</param>
<param>
- <key>tr_slope</key>
- <value>qtgui.TRIG_SLOPE_POS</value>
+ <key>grid</key>
+ <value>False</value>
</param>
<param>
- <key>tr_level</key>
- <value>0.0</value>
+ <key>id</key>
+ <value>qtgui_time_sink_x_1</value>
</param>
<param>
- <key>tr_delay</key>
- <value>0</value>
+ <key>legend</key>
+ <value>True</value>
</param>
<param>
- <key>tr_chan</key>
- <value>0</value>
+ <key>alpha1</key>
+ <value>1.0</value>
</param>
<param>
- <key>tr_tag</key>
- <value>""</value>
+ <key>color1</key>
+ <value>"blue"</value>
</param>
<param>
<key>label1</key>
<value></value>
</param>
<param>
+ <key>marker1</key>
+ <value>-1</value>
+ </param>
+ <param>
+ <key>style1</key>
+ <value>1</value>
+ </param>
+ <param>
<key>width1</key>
<value>1</value>
</param>
<param>
- <key>color1</key>
+ <key>alpha10</key>
+ <value>1.0</value>
+ </param>
+ <param>
+ <key>color10</key>
<value>"blue"</value>
</param>
<param>
- <key>style1</key>
- <value>1</value>
+ <key>label10</key>
+ <value></value>
</param>
<param>
- <key>marker1</key>
+ <key>marker10</key>
<value>-1</value>
</param>
<param>
- <key>alpha1</key>
- <value>1.0</value>
+ <key>style10</key>
+ <value>1</value>
</param>
<param>
- <key>label2</key>
- <value></value>
+ <key>width10</key>
+ <value>1</value>
</param>
<param>
- <key>width2</key>
- <value>1</value>
+ <key>alpha2</key>
+ <value>1.0</value>
</param>
<param>
<key>color2</key>
<value>"red"</value>
</param>
<param>
- <key>style2</key>
- <value>1</value>
+ <key>label2</key>
+ <value></value>
</param>
<param>
<key>marker2</key>
<value>-1</value>
</param>
<param>
- <key>alpha2</key>
- <value>1.0</value>
+ <key>style2</key>
+ <value>1</value>
</param>
<param>
- <key>label3</key>
- <value></value>
+ <key>width2</key>
+ <value>1</value>
</param>
<param>
- <key>width3</key>
- <value>1</value>
+ <key>alpha3</key>
+ <value>1.0</value>
</param>
<param>
<key>color3</key>
<value>"green"</value>
</param>
<param>
- <key>style3</key>
- <value>1</value>
+ <key>label3</key>
+ <value></value>
</param>
<param>
<key>marker3</key>
<value>-1</value>
</param>
<param>
- <key>alpha3</key>
- <value>1.0</value>
+ <key>style3</key>
+ <value>1</value>
</param>
<param>
- <key>label4</key>
- <value></value>
+ <key>width3</key>
+ <value>1</value>
</param>
<param>
- <key>width4</key>
- <value>1</value>
+ <key>alpha4</key>
+ <value>1.0</value>
</param>
<param>
<key>color4</key>
<value>"black"</value>
</param>
<param>
- <key>style4</key>
- <value>1</value>
+ <key>label4</key>
+ <value></value>
</param>
<param>
<key>marker4</key>
<value>-1</value>
</param>
<param>
- <key>alpha4</key>
- <value>1.0</value>
+ <key>style4</key>
+ <value>1</value>
</param>
<param>
- <key>label5</key>
- <value></value>
+ <key>width4</key>
+ <value>1</value>
</param>
<param>
- <key>width5</key>
- <value>1</value>
+ <key>alpha5</key>
+ <value>1.0</value>
</param>
<param>
<key>color5</key>
<value>"cyan"</value>
</param>
<param>
- <key>style5</key>
- <value>1</value>
+ <key>label5</key>
+ <value></value>
</param>
<param>
<key>marker5</key>
<value>-1</value>
</param>
<param>
- <key>alpha5</key>
- <value>1.0</value>
+ <key>style5</key>
+ <value>1</value>
</param>
<param>
- <key>label6</key>
- <value></value>
+ <key>width5</key>
+ <value>1</value>
</param>
<param>
- <key>width6</key>
- <value>1</value>
+ <key>alpha6</key>
+ <value>1.0</value>
</param>
<param>
<key>color6</key>
<value>"magenta"</value>
</param>
<param>
- <key>style6</key>
- <value>1</value>
+ <key>label6</key>
+ <value></value>
</param>
<param>
<key>marker6</key>
<value>-1</value>
</param>
<param>
- <key>alpha6</key>
- <value>1.0</value>
+ <key>style6</key>
+ <value>1</value>
</param>
<param>
- <key>label7</key>
- <value></value>
+ <key>width6</key>
+ <value>1</value>
</param>
<param>
- <key>width7</key>
- <value>1</value>
+ <key>alpha7</key>
+ <value>1.0</value>
</param>
<param>
<key>color7</key>
<value>"yellow"</value>
</param>
<param>
- <key>style7</key>
- <value>1</value>
+ <key>label7</key>
+ <value></value>
</param>
<param>
<key>marker7</key>
<value>-1</value>
</param>
<param>
- <key>alpha7</key>
- <value>1.0</value>
+ <key>style7</key>
+ <value>1</value>
</param>
<param>
- <key>label8</key>
- <value></value>
+ <key>width7</key>
+ <value>1</value>
</param>
<param>
- <key>width8</key>
- <value>1</value>
+ <key>alpha8</key>
+ <value>1.0</value>
</param>
<param>
<key>color8</key>
<value>"dark red"</value>
</param>
<param>
- <key>style8</key>
- <value>1</value>
+ <key>label8</key>
+ <value></value>
</param>
<param>
<key>marker8</key>
<value>-1</value>
</param>
<param>
- <key>alpha8</key>
- <value>1.0</value>
+ <key>style8</key>
+ <value>1</value>
</param>
<param>
- <key>label9</key>
- <value></value>
+ <key>width8</key>
+ <value>1</value>
</param>
<param>
- <key>width9</key>
- <value>1</value>
+ <key>alpha9</key>
+ <value>1.0</value>
</param>
<param>
<key>color9</key>
<value>"dark green"</value>
</param>
<param>
- <key>style9</key>
- <value>1</value>
+ <key>label9</key>
+ <value></value>
</param>
<param>
<key>marker9</key>
<value>-1</value>
</param>
<param>
- <key>alpha9</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label10</key>
- <value></value>
+ <key>style9</key>
+ <value>1</value>
</param>
<param>
- <key>width10</key>
+ <key>width9</key>
<value>1</value>
</param>
<param>
- <key>color10</key>
- <value>"blue"</value>
+ <key>name</key>
+ <value>Error</value>
</param>
<param>
- <key>style10</key>
+ <key>nconnections</key>
<value>1</value>
</param>
<param>
- <key>marker10</key>
- <value>-1</value>
+ <key>size</key>
+ <value>1024</value>
</param>
<param>
- <key>alpha10</key>
- <value>1.0</value>
+ <key>srate</key>
+ <value>samp_rate</value>
</param>
<param>
- <key>alias</key>
- <value></value>
+ <key>tr_chan</key>
+ <value>0</value>
</param>
<param>
- <key>affinity</key>
- <value></value>
+ <key>tr_delay</key>
+ <value>0</value>
</param>
<param>
- <key>_coordinate</key>
- <value>(1018, 503)</value>
+ <key>tr_level</key>
+ <value>0.0</value>
</param>
<param>
- <key>_rotation</key>
- <value>0</value>
+ <key>tr_mode</key>
+ <value>qtgui.TRIG_MODE_FREE</value>
</param>
- </block>
- <block>
- <key>qtgui_time_sink_x</key>
<param>
- <key>id</key>
- <value>qtgui_time_sink_x_1</value>
+ <key>tr_slope</key>
+ <value>qtgui.TRIG_SLOPE_POS</value>
</param>
<param>
- <key>_enabled</key>
- <value>True</value>
+ <key>tr_tag</key>
+ <value>""</value>
</param>
<param>
<key>type</key>
<value>float</value>
</param>
<param>
- <key>name</key>
- <value>Error</value>
+ <key>update_time</key>
+ <value>0.10</value>
</param>
<param>
<key>ylabel</key>
@@ -1875,343 +2143,359 @@
<value>""</value>
</param>
<param>
- <key>size</key>
- <value>1024</value>
+ <key>ymax</key>
+ <value>1</value>
</param>
<param>
- <key>srate</key>
- <value>samp_rate</value>
+ <key>ymin</key>
+ <value>-1</value>
</param>
+ </block>
+ <block>
+ <key>qtgui_time_sink_x</key>
<param>
- <key>grid</key>
- <value>False</value>
+ <key>autoscale</key>
+ <value>True</value>
</param>
<param>
- <key>autoscale</key>
+ <key>axislabels</key>
<value>True</value>
</param>
<param>
- <key>ymin</key>
- <value>-1</value>
+ <key>alias</key>
+ <value></value>
</param>
<param>
- <key>ymax</key>
- <value>1</value>
+ <key>comment</key>
+ <value></value>
</param>
<param>
- <key>nconnections</key>
- <value>1</value>
+ <key>ctrlpanel</key>
+ <value>False</value>
</param>
<param>
- <key>update_time</key>
- <value>0.10</value>
+ <key>affinity</key>
+ <value></value>
</param>
<param>
<key>entags</key>
<value>True</value>
</param>
<param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(1018, 503)</value>
+ </param>
+ <param>
<key>gui_hint</key>
- <value>notebook@0</value>
+ <value>notebook@2</value>
</param>
<param>
- <key>tr_mode</key>
- <value>qtgui.TRIG_MODE_FREE</value>
+ <key>_rotation</key>
+ <value>0</value>
</param>
<param>
- <key>tr_slope</key>
- <value>qtgui.TRIG_SLOPE_POS</value>
+ <key>grid</key>
+ <value>False</value>
</param>
<param>
- <key>tr_level</key>
- <value>0.0</value>
+ <key>id</key>
+ <value>qtgui_time_sink_x_1_0</value>
</param>
<param>
- <key>tr_delay</key>
- <value>0</value>
+ <key>legend</key>
+ <value>True</value>
</param>
<param>
- <key>tr_chan</key>
- <value>0</value>
+ <key>alpha1</key>
+ <value>1.0</value>
</param>
<param>
- <key>tr_tag</key>
- <value>""</value>
+ <key>color1</key>
+ <value>"blue"</value>
</param>
<param>
<key>label1</key>
<value></value>
</param>
<param>
+ <key>marker1</key>
+ <value>-1</value>
+ </param>
+ <param>
+ <key>style1</key>
+ <value>1</value>
+ </param>
+ <param>
<key>width1</key>
<value>1</value>
</param>
<param>
- <key>color1</key>
+ <key>alpha10</key>
+ <value>1.0</value>
+ </param>
+ <param>
+ <key>color10</key>
<value>"blue"</value>
</param>
<param>
- <key>style1</key>
- <value>1</value>
+ <key>label10</key>
+ <value></value>
</param>
<param>
- <key>marker1</key>
+ <key>marker10</key>
<value>-1</value>
</param>
<param>
- <key>alpha1</key>
- <value>1.0</value>
+ <key>style10</key>
+ <value>1</value>
</param>
<param>
- <key>label2</key>
- <value></value>
+ <key>width10</key>
+ <value>1</value>
</param>
<param>
- <key>width2</key>
- <value>1</value>
+ <key>alpha2</key>
+ <value>1.0</value>
</param>
<param>
<key>color2</key>
<value>"red"</value>
</param>
<param>
- <key>style2</key>
- <value>1</value>
+ <key>label2</key>
+ <value></value>
</param>
<param>
<key>marker2</key>
<value>-1</value>
</param>
<param>
- <key>alpha2</key>
- <value>1.0</value>
+ <key>style2</key>
+ <value>1</value>
</param>
<param>
- <key>label3</key>
- <value></value>
+ <key>width2</key>
+ <value>1</value>
</param>
<param>
- <key>width3</key>
- <value>1</value>
+ <key>alpha3</key>
+ <value>1.0</value>
</param>
<param>
<key>color3</key>
<value>"green"</value>
</param>
<param>
- <key>style3</key>
- <value>1</value>
+ <key>label3</key>
+ <value></value>
</param>
<param>
<key>marker3</key>
<value>-1</value>
</param>
<param>
- <key>alpha3</key>
- <value>1.0</value>
+ <key>style3</key>
+ <value>1</value>
</param>
<param>
- <key>label4</key>
- <value></value>
+ <key>width3</key>
+ <value>1</value>
</param>
<param>
- <key>width4</key>
- <value>1</value>
+ <key>alpha4</key>
+ <value>1.0</value>
</param>
<param>
<key>color4</key>
<value>"black"</value>
</param>
<param>
- <key>style4</key>
- <value>1</value>
+ <key>label4</key>
+ <value></value>
</param>
<param>
<key>marker4</key>
<value>-1</value>
</param>
<param>
- <key>alpha4</key>
- <value>1.0</value>
+ <key>style4</key>
+ <value>1</value>
</param>
<param>
- <key>label5</key>
- <value></value>
+ <key>width4</key>
+ <value>1</value>
</param>
<param>
- <key>width5</key>
- <value>1</value>
+ <key>alpha5</key>
+ <value>1.0</value>
</param>
<param>
<key>color5</key>
<value>"cyan"</value>
</param>
<param>
- <key>style5</key>
- <value>1</value>
+ <key>label5</key>
+ <value></value>
</param>
<param>
<key>marker5</key>
<value>-1</value>
</param>
<param>
- <key>alpha5</key>
- <value>1.0</value>
+ <key>style5</key>
+ <value>1</value>
</param>
<param>
- <key>label6</key>
- <value></value>
+ <key>width5</key>
+ <value>1</value>
</param>
<param>
- <key>width6</key>
- <value>1</value>
+ <key>alpha6</key>
+ <value>1.0</value>
</param>
<param>
<key>color6</key>
<value>"magenta"</value>
</param>
<param>
- <key>style6</key>
- <value>1</value>
+ <key>label6</key>
+ <value></value>
</param>
<param>
<key>marker6</key>
<value>-1</value>
</param>
<param>
- <key>alpha6</key>
- <value>1.0</value>
+ <key>style6</key>
+ <value>1</value>
</param>
<param>
- <key>label7</key>
- <value></value>
+ <key>width6</key>
+ <value>1</value>
</param>
<param>
- <key>width7</key>
- <value>1</value>
+ <key>alpha7</key>
+ <value>1.0</value>
</param>
<param>
<key>color7</key>
<value>"yellow"</value>
</param>
<param>
- <key>style7</key>
- <value>1</value>
+ <key>label7</key>
+ <value></value>
</param>
<param>
<key>marker7</key>
<value>-1</value>
</param>
<param>
- <key>alpha7</key>
- <value>1.0</value>
+ <key>style7</key>
+ <value>1</value>
</param>
<param>
- <key>label8</key>
- <value></value>
+ <key>width7</key>
+ <value>1</value>
</param>
<param>
- <key>width8</key>
- <value>1</value>
+ <key>alpha8</key>
+ <value>1.0</value>
</param>
<param>
<key>color8</key>
<value>"dark red"</value>
</param>
<param>
- <key>style8</key>
- <value>1</value>
+ <key>label8</key>
+ <value></value>
</param>
<param>
<key>marker8</key>
<value>-1</value>
</param>
<param>
- <key>alpha8</key>
- <value>1.0</value>
+ <key>style8</key>
+ <value>1</value>
</param>
<param>
- <key>label9</key>
- <value></value>
+ <key>width8</key>
+ <value>1</value>
</param>
<param>
- <key>width9</key>
- <value>1</value>
+ <key>alpha9</key>
+ <value>1.0</value>
</param>
<param>
<key>color9</key>
<value>"dark green"</value>
</param>
<param>
- <key>style9</key>
- <value>1</value>
+ <key>label9</key>
+ <value></value>
</param>
<param>
<key>marker9</key>
<value>-1</value>
</param>
<param>
- <key>alpha9</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label10</key>
- <value></value>
+ <key>style9</key>
+ <value>1</value>
</param>
<param>
- <key>width10</key>
+ <key>width9</key>
<value>1</value>
</param>
<param>
- <key>color10</key>
- <value>"blue"</value>
+ <key>name</key>
+ <value>Rate</value>
</param>
<param>
- <key>style10</key>
+ <key>nconnections</key>
<value>1</value>
</param>
<param>
- <key>marker10</key>
- <value>-1</value>
+ <key>size</key>
+ <value>1024</value>
</param>
<param>
- <key>alpha10</key>
- <value>1.0</value>
+ <key>srate</key>
+ <value>samp_rate</value>
</param>
<param>
- <key>alias</key>
- <value></value>
+ <key>tr_chan</key>
+ <value>0</value>
</param>
<param>
- <key>affinity</key>
- <value></value>
+ <key>tr_delay</key>
+ <value>0</value>
</param>
<param>
- <key>_coordinate</key>
- <value>(1017, 378)</value>
+ <key>tr_level</key>
+ <value>0.0</value>
</param>
<param>
- <key>_rotation</key>
- <value>0</value>
+ <key>tr_mode</key>
+ <value>qtgui.TRIG_MODE_FREE</value>
</param>
- </block>
- <block>
- <key>qtgui_time_sink_x</key>
<param>
- <key>id</key>
- <value>qtgui_time_sink_x_0_0</value>
+ <key>tr_slope</key>
+ <value>qtgui.TRIG_SLOPE_POS</value>
</param>
<param>
- <key>_enabled</key>
- <value>True</value>
+ <key>tr_tag</key>
+ <value>""</value>
</param>
<param>
<key>type</key>
- <value>complex</value>
+ <value>float</value>
</param>
<param>
- <key>name</key>
- <value>Scope Plot</value>
+ <key>update_time</key>
+ <value>0.10</value>
</param>
<param>
<key>ylabel</key>
@@ -2222,473 +2506,398 @@
<value>""</value>
</param>
<param>
- <key>size</key>
- <value>1024</value>
+ <key>ymax</key>
+ <value>1</value>
</param>
<param>
- <key>srate</key>
- <value>samp_rate</value>
+ <key>ymin</key>
+ <value>-1</value>
</param>
+ </block>
+ <block>
+ <key>qtgui_time_sink_x</key>
<param>
- <key>grid</key>
- <value>False</value>
+ <key>autoscale</key>
+ <value>True</value>
</param>
<param>
- <key>autoscale</key>
- <value>False</value>
+ <key>axislabels</key>
+ <value>True</value>
</param>
<param>
- <key>ymin</key>
- <value>-1</value>
+ <key>alias</key>
+ <value></value>
</param>
<param>
- <key>ymax</key>
- <value>1</value>
+ <key>comment</key>
+ <value></value>
</param>
<param>
- <key>nconnections</key>
- <value>1</value>
+ <key>ctrlpanel</key>
+ <value>False</value>
</param>
<param>
- <key>update_time</key>
- <value>0.10</value>
+ <key>affinity</key>
+ <value></value>
</param>
<param>
<key>entags</key>
<value>True</value>
</param>
<param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(1014, 622)</value>
+ </param>
+ <param>
<key>gui_hint</key>
- <value></value>
+ <value>notebook@1</value>
</param>
<param>
- <key>tr_mode</key>
- <value>qtgui.TRIG_MODE_FREE</value>
+ <key>_rotation</key>
+ <value>0</value>
</param>
<param>
- <key>tr_slope</key>
- <value>qtgui.TRIG_SLOPE_POS</value>
+ <key>grid</key>
+ <value>False</value>
</param>
<param>
- <key>tr_level</key>
- <value>0.0</value>
+ <key>id</key>
+ <value>qtgui_time_sink_x_1_1</value>
</param>
<param>
- <key>tr_delay</key>
- <value>0</value>
+ <key>legend</key>
+ <value>True</value>
</param>
<param>
- <key>tr_chan</key>
- <value>0</value>
+ <key>alpha1</key>
+ <value>1.0</value>
</param>
<param>
- <key>tr_tag</key>
- <value>""</value>
+ <key>color1</key>
+ <value>"blue"</value>
</param>
<param>
<key>label1</key>
<value></value>
</param>
<param>
+ <key>marker1</key>
+ <value>-1</value>
+ </param>
+ <param>
+ <key>style1</key>
+ <value>1</value>
+ </param>
+ <param>
<key>width1</key>
<value>1</value>
</param>
<param>
- <key>color1</key>
+ <key>alpha10</key>
+ <value>1.0</value>
+ </param>
+ <param>
+ <key>color10</key>
<value>"blue"</value>
</param>
<param>
- <key>style1</key>
- <value>1</value>
+ <key>label10</key>
+ <value></value>
</param>
<param>
- <key>marker1</key>
+ <key>marker10</key>
<value>-1</value>
</param>
<param>
- <key>alpha1</key>
- <value>1.0</value>
+ <key>style10</key>
+ <value>1</value>
</param>
<param>
- <key>label2</key>
- <value></value>
+ <key>width10</key>
+ <value>1</value>
</param>
<param>
- <key>width2</key>
- <value>1</value>
+ <key>alpha2</key>
+ <value>1.0</value>
</param>
<param>
<key>color2</key>
<value>"red"</value>
</param>
<param>
- <key>style2</key>
- <value>1</value>
+ <key>label2</key>
+ <value></value>
</param>
<param>
<key>marker2</key>
<value>-1</value>
</param>
<param>
- <key>alpha2</key>
- <value>1.0</value>
+ <key>style2</key>
+ <value>1</value>
</param>
<param>
- <key>label3</key>
- <value></value>
+ <key>width2</key>
+ <value>1</value>
</param>
<param>
- <key>width3</key>
- <value>1</value>
+ <key>alpha3</key>
+ <value>1.0</value>
</param>
<param>
<key>color3</key>
<value>"green"</value>
</param>
<param>
- <key>style3</key>
- <value>1</value>
+ <key>label3</key>
+ <value></value>
</param>
<param>
<key>marker3</key>
<value>-1</value>
</param>
<param>
- <key>alpha3</key>
- <value>1.0</value>
+ <key>style3</key>
+ <value>1</value>
</param>
<param>
- <key>label4</key>
- <value></value>
+ <key>width3</key>
+ <value>1</value>
</param>
<param>
- <key>width4</key>
- <value>1</value>
+ <key>alpha4</key>
+ <value>1.0</value>
</param>
<param>
<key>color4</key>
<value>"black"</value>
</param>
<param>
- <key>style4</key>
- <value>1</value>
+ <key>label4</key>
+ <value></value>
</param>
<param>
<key>marker4</key>
<value>-1</value>
</param>
<param>
- <key>alpha4</key>
- <value>1.0</value>
+ <key>style4</key>
+ <value>1</value>
</param>
<param>
- <key>label5</key>
- <value></value>
+ <key>width4</key>
+ <value>1</value>
</param>
<param>
- <key>width5</key>
- <value>1</value>
+ <key>alpha5</key>
+ <value>1.0</value>
</param>
<param>
<key>color5</key>
<value>"cyan"</value>
</param>
<param>
- <key>style5</key>
- <value>1</value>
+ <key>label5</key>
+ <value></value>
</param>
<param>
<key>marker5</key>
<value>-1</value>
</param>
<param>
- <key>alpha5</key>
- <value>1.0</value>
+ <key>style5</key>
+ <value>1</value>
</param>
<param>
- <key>label6</key>
- <value></value>
+ <key>width5</key>
+ <value>1</value>
</param>
<param>
- <key>width6</key>
- <value>1</value>
+ <key>alpha6</key>
+ <value>1.0</value>
</param>
<param>
<key>color6</key>
<value>"magenta"</value>
</param>
<param>
- <key>style6</key>
- <value>1</value>
+ <key>label6</key>
+ <value></value>
</param>
<param>
<key>marker6</key>
<value>-1</value>
</param>
<param>
- <key>alpha6</key>
- <value>1.0</value>
+ <key>style6</key>
+ <value>1</value>
</param>
<param>
- <key>label7</key>
- <value></value>
+ <key>width6</key>
+ <value>1</value>
</param>
<param>
- <key>width7</key>
- <value>1</value>
+ <key>alpha7</key>
+ <value>1.0</value>
</param>
<param>
<key>color7</key>
<value>"yellow"</value>
</param>
<param>
- <key>style7</key>
- <value>1</value>
+ <key>label7</key>
+ <value></value>
</param>
<param>
<key>marker7</key>
<value>-1</value>
</param>
<param>
- <key>alpha7</key>
- <value>1.0</value>
+ <key>style7</key>
+ <value>1</value>
</param>
<param>
- <key>label8</key>
- <value></value>
+ <key>width7</key>
+ <value>1</value>
</param>
<param>
- <key>width8</key>
- <value>1</value>
+ <key>alpha8</key>
+ <value>1.0</value>
</param>
<param>
<key>color8</key>
<value>"dark red"</value>
</param>
<param>
- <key>style8</key>
- <value>1</value>
+ <key>label8</key>
+ <value></value>
</param>
<param>
<key>marker8</key>
<value>-1</value>
</param>
<param>
- <key>alpha8</key>
- <value>1.0</value>
+ <key>style8</key>
+ <value>1</value>
</param>
<param>
- <key>label9</key>
- <value></value>
+ <key>width8</key>
+ <value>1</value>
</param>
<param>
- <key>width9</key>
- <value>1</value>
+ <key>alpha9</key>
+ <value>1.0</value>
</param>
<param>
<key>color9</key>
<value>"dark green"</value>
</param>
<param>
- <key>style9</key>
- <value>1</value>
+ <key>label9</key>
+ <value></value>
</param>
<param>
<key>marker9</key>
<value>-1</value>
</param>
<param>
- <key>alpha9</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label10</key>
- <value></value>
- </param>
- <param>
- <key>width10</key>
+ <key>style9</key>
<value>1</value>
</param>
<param>
- <key>color10</key>
- <value>"blue"</value>
- </param>
- <param>
- <key>style10</key>
+ <key>width9</key>
<value>1</value>
</param>
<param>
- <key>marker10</key>
- <value>-1</value>
- </param>
- <param>
- <key>alpha10</key>
- <value>1.0</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(1029, 281)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
+ <key>name</key>
+ <value>Phase</value>
</param>
- </block>
- <block>
- <key>variable_qtgui_range</key>
<param>
- <key>id</key>
- <value>time_bw</value>
+ <key>nconnections</key>
+ <value>1</value>
</param>
<param>
- <key>_enabled</key>
- <value>True</value>
+ <key>size</key>
+ <value>1024</value>
</param>
<param>
- <key>label</key>
- <value>Timing Loop BW</value>
+ <key>srate</key>
+ <value>samp_rate</value>
</param>
<param>
- <key>value</key>
+ <key>tr_chan</key>
<value>0</value>
</param>
<param>
- <key>start</key>
+ <key>tr_delay</key>
<value>0</value>
</param>
<param>
- <key>stop</key>
- <value>.1</value>
- </param>
- <param>
- <key>step</key>
- <value>.001</value>
- </param>
- <param>
- <key>widget</key>
- <value>counter_slider</value>
- </param>
- <param>
- <key>orient</key>
- <value>Qt.Horizontal</value>
- </param>
- <param>
- <key>min_len</key>
- <value>200</value>
- </param>
- <param>
- <key>gui_hint</key>
- <value>1,2,1,1</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(451, 0)</value>
+ <key>tr_level</key>
+ <value>0.0</value>
</param>
<param>
- <key>_rotation</key>
- <value>0</value>
+ <key>tr_mode</key>
+ <value>qtgui.TRIG_MODE_FREE</value>
</param>
- </block>
- <block>
- <key>digital_pfb_clock_sync_xxx</key>
<param>
- <key>id</key>
- <value>digital_pfb_clock_sync_xxx_0</value>
+ <key>tr_slope</key>
+ <value>qtgui.TRIG_SLOPE_POS</value>
</param>
<param>
- <key>_enabled</key>
- <value>True</value>
+ <key>tr_tag</key>
+ <value>""</value>
</param>
<param>
<key>type</key>
- <value>ccf</value>
- </param>
- <param>
- <key>sps</key>
- <value>spb</value>
- </param>
- <param>
- <key>loop_bw</key>
- <value>time_bw</value>
- </param>
- <param>
- <key>taps</key>
- <value>firdes.root_raised_cosine(nfilts, nfilts*spb, 1.0, rolloff, 44*nfilts)</value>
+ <value>float</value>
</param>
<param>
- <key>filter_size</key>
- <value>nfilts</value>
+ <key>update_time</key>
+ <value>0.10</value>
</param>
<param>
- <key>init_phase</key>
- <value>16</value>
+ <key>ylabel</key>
+ <value>Amplitude</value>
</param>
<param>
- <key>max_dev</key>
- <value>1.5</value>
+ <key>yunit</key>
+ <value>""</value>
</param>
<param>
- <key>osps</key>
+ <key>ymax</key>
<value>1</value>
</param>
<param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(467, 403)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
+ <key>ymin</key>
+ <value>-1</value>
</param>
</block>
<connection>
- <source_block_id>blocks_throttle_0</source_block_id>
- <sink_block_id>digital_pfb_clock_sync_xxx_0</sink_block_id>
+ <source_block_id>analog_random_source_x</source_block_id>
+ <sink_block_id>digital_chunks_to_symbols_xx</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
- <source_block_id>pfb_arb_resampler_xxx_0</source_block_id>
- <sink_block_id>blocks_multiply_const_vxx_0</sink_block_id>
+ <source_block_id>blocks_multiply_const_vxx_0</source_block_id>
+ <sink_block_id>channels_channel_model_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
- <source_block_id>digital_chunks_to_symbols_xx</source_block_id>
- <sink_block_id>pfb_arb_resampler_xxx_0</sink_block_id>
+ <source_block_id>blocks_multiply_const_vxx_0</source_block_id>
+ <sink_block_id>qtgui_time_sink_x_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
- <source_block_id>analog_random_source_x</source_block_id>
- <sink_block_id>digital_chunks_to_symbols_xx</sink_block_id>
+ <source_block_id>blocks_throttle_0</source_block_id>
+ <sink_block_id>digital_pfb_clock_sync_xxx_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
@@ -2699,15 +2908,15 @@
<sink_key>0</sink_key>
</connection>
<connection>
- <source_block_id>blocks_multiply_const_vxx_0</source_block_id>
- <sink_block_id>channels_channel_model_0</sink_block_id>
+ <source_block_id>digital_chunks_to_symbols_xx</source_block_id>
+ <sink_block_id>pfb_arb_resampler_xxx_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
- <source_block_id>blocks_multiply_const_vxx_0</source_block_id>
- <sink_block_id>qtgui_time_sink_x_0</sink_block_id>
- <source_key>0</source_key>
+ <source_block_id>digital_pfb_clock_sync_xxx_0</source_block_id>
+ <sink_block_id>qtgui_time_sink_x_1</sink_block_id>
+ <source_key>1</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
@@ -2718,12 +2927,6 @@
</connection>
<connection>
<source_block_id>digital_pfb_clock_sync_xxx_0</source_block_id>
- <sink_block_id>qtgui_time_sink_x_1</sink_block_id>
- <source_key>1</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>digital_pfb_clock_sync_xxx_0</source_block_id>
<sink_block_id>qtgui_time_sink_x_1_1</sink_block_id>
<source_key>3</source_key>
<sink_key>0</sink_key>
@@ -2734,4 +2937,10 @@
<source_key>2</source_key>
<sink_key>0</sink_key>
</connection>
+ <connection>
+ <source_block_id>pfb_arb_resampler_xxx_0</source_block_id>
+ <sink_block_id>blocks_multiply_const_vxx_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
</flow_graph>
diff --git a/gr-digital/examples/example_costas.py b/gr-digital/examples/example_costas.py
index 77495d944c..56fc419013 100755..100644
--- a/gr-digital/examples/example_costas.py
+++ b/gr-digital/examples/example_costas.py
@@ -20,6 +20,10 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
+
from gnuradio import gr, digital, filter
from gnuradio import blocks
from gnuradio import channels
@@ -31,13 +35,13 @@ import sys
try:
import scipy
except ImportError:
- print "Error: could not import scipy (http://www.scipy.org/)"
+ print("Error: could not import scipy (http://www.scipy.org/)")
sys.exit(1)
try:
import pylab
except ImportError:
- print "Error: could not import pylab (http://matplotlib.sourceforge.net/)"
+ print("Error: could not import pylab (http://matplotlib.sourceforge.net/)")
sys.exit(1)
class example_costas(gr.top_block):
diff --git a/gr-digital/examples/example_fll.py b/gr-digital/examples/example_fll.py
index cda92eaa78..2603f06342 100755..100644
--- a/gr-digital/examples/example_fll.py
+++ b/gr-digital/examples/example_fll.py
@@ -20,6 +20,10 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
+
from gnuradio import gr, digital, filter
from gnuradio import blocks
from gnuradio import channels
@@ -31,13 +35,13 @@ import sys
try:
import scipy
except ImportError:
- print "Error: could not import scipy (http://www.scipy.org/)"
+ print("Error: could not import scipy (http://www.scipy.org/)")
sys.exit(1)
try:
import pylab
except ImportError:
- print "Error: could not import pylab (http://matplotlib.sourceforge.net/)"
+ print("Error: could not import pylab (http://matplotlib.sourceforge.net/)")
sys.exit(1)
class example_fll(gr.top_block):
diff --git a/gr-digital/examples/example_timing.py b/gr-digital/examples/example_timing.py
index 5c10c04016..348d62b6f3 100755..100644
--- a/gr-digital/examples/example_timing.py
+++ b/gr-digital/examples/example_timing.py
@@ -20,6 +20,10 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
+
from gnuradio import gr, digital, filter
from gnuradio import blocks
from gnuradio import channels
@@ -31,13 +35,13 @@ import sys
try:
import scipy
except ImportError:
- print "Error: could not import scipy (http://www.scipy.org/)"
+ print("Error: could not import scipy (http://www.scipy.org/)")
sys.exit(1)
try:
import pylab
except ImportError:
- print "Error: could not import pylab (http://matplotlib.sourceforge.net/)"
+ print("Error: could not import pylab (http://matplotlib.sourceforge.net/)")
sys.exit(1)
from scipy import fftpack
@@ -69,8 +73,8 @@ class example_timing(gr.top_block):
self.taps = self.clk.taps()
self.dtaps = self.clk.diff_taps()
- self.delay = int(scipy.ceil(((len(rrc_taps)-1)/2 +
- (len(self.taps[0])-1)/2)/float(sps))) + 1
+ self.delay = int(scipy.ceil((old_div((len(rrc_taps)-1) / 2 +
+ (len(self.taps[0])-1) / 2),float(sps)))) + 1
self.vsnk_err = blocks.vector_sink_f()
diff --git a/gr-digital/examples/gen_whitener.py b/gr-digital/examples/gen_whitener.py
index 62345cee5d..4b4ecdb528 100755..100644
--- a/gr-digital/examples/gen_whitener.py
+++ b/gr-digital/examples/gen_whitener.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import unicode_literals
from gnuradio import gr, gru
from gnuradio import blocks
from gnuradio.eng_arg import eng_float, intx
diff --git a/gr-digital/examples/narrowband/benchmark_add_channel.py b/gr-digital/examples/narrowband/benchmark_add_channel.py
index cd85f4e488..846caddd26 100755..100644
--- a/gr-digital/examples/narrowband/benchmark_add_channel.py
+++ b/gr-digital/examples/narrowband/benchmark_add_channel.py
@@ -1,24 +1,28 @@
#!/usr/bin/env python
#
# Copyright 2010,2011 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
from gnuradio import channels, gr
from gnuradio import blocks
@@ -32,14 +36,14 @@ class my_top_block(gr.top_block):
def __init__(self, ifile, ofile, options):
gr.top_block.__init__(self)
- SNR = 10.0**(options.snr/10.0)
+ SNR = 10.0**(options.snr / 10.0)
frequency_offset = options.frequency_offset
time_offset = options.time_offset
- phase_offset = options.phase_offset*(math.pi/180.0)
+ phase_offset = options.phase_offset*(math.pi / 180.0)
# calculate noise voltage from SNR
power_in_signal = abs(options.tx_amplitude)**2
- noise_power = power_in_signal/SNR
+ noise_power = power_in_signal / SNR
noise_voltage = math.sqrt(noise_power)
self.src = blocks.file_source(gr.sizeof_gr_complex, ifile)
@@ -52,7 +56,7 @@ class my_top_block(gr.top_block):
self.snk = blocks.file_sink(gr.sizeof_gr_complex, ofile)
self.connect(self.src, self.channel, self.phase, self.snk)
-
+
# /////////////////////////////////////////////////////////////////////////////
# main
@@ -86,13 +90,13 @@ def main():
ifile = args[0]
ofile = args[1]
-
+
# build the graph
tb = my_top_block(ifile, ofile, options)
r = gr.enable_realtime_scheduling()
if r != gr.RT_OK:
- print "Warning: Failed to enable realtime scheduling."
+ print("Warning: Failed to enable realtime scheduling.")
tb.start() # start flow graph
tb.wait() # wait for it to finish
diff --git a/gr-digital/examples/narrowband/benchmark_rx.py b/gr-digital/examples/narrowband/benchmark_rx.py
index 09d923fc6b..8467d376e7 100755..100644
--- a/gr-digital/examples/narrowband/benchmark_rx.py
+++ b/gr-digital/examples/narrowband/benchmark_rx.py
@@ -1,24 +1,28 @@
#!/usr/bin/env python
#
# Copyright 2010,2011,2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
from gnuradio import gr, gru
from gnuradio import blocks
@@ -37,7 +41,7 @@ import struct
import sys
#import os
-#print os.getpid()
+#print(os.getpid())
#raw_input('Attach and press enter: ')
class my_top_block(gr.top_block):
@@ -47,10 +51,10 @@ class my_top_block(gr.top_block):
if(options.rx_freq is not None):
# Work-around to get the modulation's bits_per_symbol
args = demodulator.extract_kwargs_from_options(options)
- symbol_rate = options.bitrate / demodulator(**args).bits_per_symbol()
+ symbol_rate = options.bitrate / demodulator(**args.bits_per_symbol())
self.source = uhd_receiver(options.args, symbol_rate,
- options.samples_per_symbol, options.rx_freq,
+ options.samples_per_symbol, options.rx_freq,
options.lo_offset, options.rx_gain,
options.spec, options.antenna,
options.clock_source, options.verbose)
@@ -66,7 +70,7 @@ class my_top_block(gr.top_block):
# Set up receive path
# do this after for any adjustments to the options that may
# occur in the sinks (specifically the UHD sink)
- self.rxpath = receive_path(demodulator, rx_callback, options)
+ self.rxpath = receive_path(demodulator, rx_callback, options)
self.connect(self.source, self.rxpath)
@@ -82,7 +86,7 @@ def main():
n_rcvd = 0
n_right = 0
-
+
def rx_callback(ok, payload):
global n_rcvd, n_right
(pktno,) = struct.unpack('!H', payload[0:2])
@@ -90,8 +94,8 @@ def main():
if ok:
n_right += 1
- print "ok = %5s pktno = %4d n_rcvd = %4d n_right = %4d" % (
- ok, pktno, n_rcvd, n_right)
+ print("ok = %5s pktno = %4d n_rcvd = %4d n_right = %4d" % (
+ ok, pktno, n_rcvd, n_right))
demods = digital.modulation_utils.type_1_demods()
@@ -99,17 +103,17 @@ def main():
parser = OptionParser (option_class=eng_option, conflict_handler="resolve")
expert_grp = parser.add_option_group("Expert")
- parser.add_option("-m", "--modulation", type="choice", choices=demods.keys(),
+ parser.add_option("-m", "--modulation", type="choice", choices=list(demods.keys()),
default='psk',
help="Select modulation from: %s [default=%%default]"
- % (', '.join(demods.keys()),))
+ % (', '.join(list(demods.keys())),))
parser.add_option("","--from-file", default=None,
help="input file of samples to demod")
receive_path.add_options(parser, expert_grp)
uhd_receiver.add_options(parser)
- for mod in demods.values():
+ for mod in list(demods.values()):
mod.add_options(expert_grp)
(options, args) = parser.parse_args ()
@@ -130,7 +134,7 @@ def main():
r = gr.enable_realtime_scheduling()
if r != gr.RT_OK:
- print "Warning: Failed to enable realtime scheduling."
+ print("Warning: Failed to enable realtime scheduling.")
tb.start() # start flow graph
tb.wait() # wait for it to finish
diff --git a/gr-digital/examples/narrowband/benchmark_tx.py b/gr-digital/examples/narrowband/benchmark_tx.py
index e0744e79a7..119932aebb 100755..100644
--- a/gr-digital/examples/narrowband/benchmark_tx.py
+++ b/gr-digital/examples/narrowband/benchmark_tx.py
@@ -1,24 +1,28 @@
#!/usr/bin/env python
#
# Copyright 2010,2011,2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
from gnuradio import gr
from gnuradio import blocks
@@ -35,8 +39,8 @@ from uhd_interface import uhd_transmitter
import time, struct, sys
-#import os
-#print os.getpid()
+#import os
+#print(os.getpid())
#raw_input('Attach and press enter')
class my_top_block(gr.top_block):
@@ -46,7 +50,7 @@ class my_top_block(gr.top_block):
if(options.tx_freq is not None):
# Work-around to get the modulation's bits_per_symbol
args = modulator.extract_kwargs_from_options(options)
- symbol_rate = options.bitrate / modulator(**args).bits_per_symbol()
+ symbol_rate = options.bitrate / modulator(**args.bits_per_symbol())
self.sink = uhd_transmitter(options.args, symbol_rate,
options.samples_per_symbol, options.tx_freq,
@@ -54,7 +58,7 @@ class my_top_block(gr.top_block):
options.spec, options.antenna,
options.clock_source, options.verbose)
options.samples_per_symbol = self.sink._sps
-
+
elif(options.to_file is not None):
sys.stderr.write(("Saving samples to '%s'.\n\n" % (options.to_file)))
self.sink = blocks.file_sink(gr.sizeof_gr_complex, options.to_file)
@@ -82,10 +86,10 @@ def main():
parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
expert_grp = parser.add_option_group("Expert")
- parser.add_option("-m", "--modulation", type="choice", choices=mods.keys(),
+ parser.add_option("-m", "--modulation", type="choice", choices=list(mods.keys()),
default='psk',
help="Select modulation from: %s [default=%%default]"
- % (', '.join(mods.keys()),))
+ % (', '.join(list(mods.keys())),))
parser.add_option("-s", "--size", type="eng_float", default=1500,
help="set packet size [default=%default]")
@@ -101,7 +105,7 @@ def main():
transmit_path.add_options(parser, expert_grp)
uhd_transmitter.add_options(parser)
- for mod in mods.values():
+ for mod in list(mods.values()):
mod.add_options(expert_grp)
(options, args) = parser.parse_args ()
@@ -109,7 +113,7 @@ def main():
if len(args) != 0:
parser.print_help()
sys.exit(1)
-
+
if options.from_file is not None:
source_file = open(options.from_file, 'r')
@@ -118,10 +122,10 @@ def main():
r = gr.enable_realtime_scheduling()
if r != gr.RT_OK:
- print "Warning: failed to enable realtime scheduling"
+ print("Warning: failed to enable realtime scheduling")
tb.start() # start flow graph
-
+
# generate and send packets
nbytes = int(1e6 * options.megabytes)
n = 0
@@ -130,7 +134,7 @@ def main():
while n < nbytes:
if options.from_file is None:
- data = (pkt_size - 2) * chr(pktno & 0xff)
+ data = (pkt_size - 2) * chr(pktno & 0xff)
else:
data = source_file.read(pkt_size - 2)
if data == '':
@@ -143,7 +147,7 @@ def main():
if options.discontinuous and pktno % 5 == 4:
time.sleep(1)
pktno += 1
-
+
send_pkt(eof=True)
tb.wait() # wait for it to finish
diff --git a/gr-digital/examples/narrowband/digital_bert_rx.py b/gr-digital/examples/narrowband/digital_bert_rx.py
index c04c76762f..aaa8b3e9ea 100755..100644
--- a/gr-digital/examples/narrowband/digital_bert_rx.py
+++ b/gr-digital/examples/narrowband/digital_bert_rx.py
@@ -20,6 +20,10 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
+
from gnuradio import gr, eng_notation
from optparse import OptionParser
from gnuradio.eng_option import eng_option
@@ -44,8 +48,8 @@ class status_thread(_threading.Thread):
def run(self):
while not self.done:
- print "Freq. Offset: {0:5.0f} Hz Timing Offset: {1:10.1f} ppm Estimated SNR: {2:4.1f} dB BER: {3:g}".format(
- tb.frequency_offset(), tb.timing_offset()*1e6, tb.snr(), tb.ber())
+ print("Freq. Offset: {0:5.0f} Hz Timing Offset: {1:10.1f} ppm Estimated SNR: {2:4.1f} dB BER: {3:g}".format(
+ tb.frequency_offset(), tb.timing_offset()*1e6, tb.snr(), tb.ber()))
try:
time.sleep(1.0)
except KeyboardInterrupt:
@@ -63,10 +67,10 @@ class bert_receiver(gr.hier_block2):
gr.hier_block2.__init__(self, "bert_receive",
gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
gr.io_signature(0, 0, 0)) # Output signature
-
+
self._bitrate = bitrate
- self._demod = digital.generic_demod(constellation, differential,
+ self._demod = digital.generic_demod(constellation, differential,
samples_per_symbol,
gray_coded, excess_bw,
freq_bw, timing_bw, phase_bw,
@@ -77,15 +81,15 @@ class bert_receiver(gr.hier_block2):
# Add an SNR probe on the demodulated constellation
self._snr_probe = digital.probe_mpsk_snr_est_c(digital.SNR_EST_M2M4, 1000,
- alpha=10.0/self._symbol_rate)
+ alpha=10.0 / self._symbol_rate)
self.connect(self._demod.time_recov, self._snr_probe)
-
+
# Descramble BERT sequence. A channel error will create 3 incorrect bits
self._descrambler = digital.descrambler_bb(0x8A, 0x7F, 7) # CCSDS 7-bit descrambler
# Measure BER by the density of 0s in the stream
- self._ber = digital.probe_density_b(1.0/self._symbol_rate)
-
+ self._ber = digital.probe_density_b(1.0 / self._symbol_rate)
+
self.connect(self, self._demod, self._descrambler, self._ber)
def frequency_offset(self):
@@ -98,22 +102,22 @@ class bert_receiver(gr.hier_block2):
return self._snr_probe.snr()
def ber(self):
- return (1.0-self._ber.density())/3.0
+ return (1.0-self._ber.density()) / 3.0
class rx_psk_block(gr.top_block):
def __init__(self, demod, options):
- gr.top_block.__init__(self, "rx_mpsk")
+ gr.top_block.__init__(self, "rx_mpsk")
self._demodulator_class = demod
# Get demod_kwargs
demod_kwargs = self._demodulator_class.extract_kwargs_from_options(options)
-
+
# demodulator
- self._demodulator = self._demodulator_class(**demod_kwargs)
+ self._demodulator = self._demodulator_class(**demod_kwargs)
if(options.rx_freq is not None):
symbol_rate = options.bitrate / self._demodulator.bits_per_symbol()
@@ -131,17 +135,17 @@ class rx_psk_block(gr.top_block):
# Create the BERT receiver
self._receiver = bert_receiver(options.bitrate,
- self._demodulator._constellation,
+ self._demodulator._constellation,
options.samples_per_symbol,
- options.differential,
- options.excess_bw,
+ options.differential,
+ options.excess_bw,
gray_coded=True,
freq_bw=options.freq_bw,
timing_bw=options.timing_bw,
phase_bw=options.phase_bw,
verbose=options.verbose,
log=options.log)
-
+
self.connect(self._source, self._receiver)
def snr(self):
@@ -149,7 +153,7 @@ class rx_psk_block(gr.top_block):
def mag(self):
return self._receiver.signal_mean()
-
+
def var(self):
return self._receiver.noise_variance()
@@ -158,19 +162,19 @@ class rx_psk_block(gr.top_block):
def frequency_offset(self):
return self._receiver.frequency_offset()
-
+
def timing_offset(self):
return self._receiver.timing_offset()
-
+
def get_options(demods):
parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
parser.add_option("","--from-file", default=None,
help="input file of samples to demod")
- parser.add_option("-m", "--modulation", type="choice", choices=demods.keys(),
+ parser.add_option("-m", "--modulation", type="choice", choices=list(demods.keys()),
default='psk',
help="Select modulation from: %s [default=%%default]"
- % (', '.join(demods.keys()),))
+ % (', '.join(list(demods.keys())),))
parser.add_option("-r", "--bitrate", type="eng_float", default=250e3,
help="Select modulation bit rate (default=%default)")
parser.add_option("-S", "--samples-per-symbol", type="float", default=2,
@@ -184,14 +188,14 @@ def get_options(demods):
uhd_receiver.add_options(parser)
demods = digital.modulation_utils.type_1_demods()
- for mod in demods.values():
+ for mod in list(demods.values()):
mod.add_options(parser)
-
+
(options, args) = parser.parse_args()
if len(args) != 0:
parser.print_help()
sys.exit(1)
-
+
return (options, args)
@@ -203,8 +207,8 @@ if __name__ == "__main__":
demod = demods[options.modulation]
tb = rx_psk_block(demod, options)
- print "\n*** SNR estimator is inaccurate below about 7dB"
- print "*** BER estimator is inaccurate above about 10%\n"
+ print("\n*** SNR estimator is inaccurate below about 7dB")
+ print("*** BER estimator is inaccurate above about 10%\n")
updater = status_thread(tb)
try:
diff --git a/gr-digital/examples/narrowband/digital_bert_tx.py b/gr-digital/examples/narrowband/digital_bert_tx.py
index 6859d2e7af..acc81b4492 100755..100644
--- a/gr-digital/examples/narrowband/digital_bert_tx.py
+++ b/gr-digital/examples/narrowband/digital_bert_tx.py
@@ -20,6 +20,8 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import division
+from __future__ import unicode_literals
from gnuradio import gr, eng_notation
from gnuradio.eng_option import eng_option
from optparse import OptionParser
@@ -97,10 +99,10 @@ class tx_psk_block(gr.top_block):
def get_options(mods):
parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
- parser.add_option("-m", "--modulation", type="choice", choices=mods.keys(),
+ parser.add_option("-m", "--modulation", type="choice", choices=list(mods.keys()),
default='psk',
help="Select modulation from: %s [default=%%default]"
- % (', '.join(mods.keys()),))
+ % (', '.join(list(mods.keys())),))
parser.add_option("", "--amplitude", type="eng_float", default=0.2,
help="set Tx amplitude (0-1) (default=%default)")
parser.add_option("-r", "--bitrate", type="eng_float", default=250e3,
@@ -116,7 +118,7 @@ def get_options(mods):
uhd_transmitter.add_options(parser)
- for mod in mods.values():
+ for mod in list(mods.values()):
mod.add_options(parser)
(options, args) = parser.parse_args()
diff --git a/gr-digital/examples/narrowband/receive_path.py b/gr-digital/examples/narrowband/receive_path.py
index 9b44ae3f75..57a3f09141 100644
--- a/gr-digital/examples/narrowband/receive_path.py
+++ b/gr-digital/examples/narrowband/receive_path.py
@@ -1,24 +1,28 @@
#!/usr/bin/env python
#
# Copyright 2005-2007,2011 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
from gnuradio import gr, gru, filter
from gnuradio import eng_notation
@@ -34,10 +38,10 @@ import sys
class receive_path(gr.hier_block2):
def __init__(self, demod_class, rx_callback, options):
- gr.hier_block2.__init__(self, "receive_path",
- gr.io_signature(1, 1, gr.sizeof_gr_complex),
- gr.io_signature(0, 0, 0))
-
+ gr.hier_block2.__init__(self, "receive_path",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex),
+ gr.io_signature(0, 0, 0))
+
options = copy.copy(options) # make a copy so we can destructively modify
self._verbose = options.verbose
@@ -56,10 +60,10 @@ class receive_path(gr.hier_block2):
# Make sure the channel BW factor is between 1 and sps/2
# or the filter won't work.
- if(self._chbw_factor < 1.0 or self._chbw_factor > self.samples_per_symbol()/2):
- sys.stderr.write("Channel bandwidth factor ({0}) must be within the range [1.0, {1}].\n".format(self._chbw_factor, self.samples_per_symbol()/2))
+ if(self._chbw_factor < 1.0 or self._chbw_factor > self.samples_per_symbol() / 2):
+ sys.stderr.write("Channel bandwidth factor ({0}) must be within the range [1.0, {1}].\n".format(self._chbw_factor, self.samples_per_symbol() / 2))
sys.exit(1)
-
+
# Design filter to get actual channel we want
sw_decim = 1
chan_coeffs = filter.firdes.low_pass(1.0, # gain
@@ -68,7 +72,7 @@ class receive_path(gr.hier_block2):
0.5, # width of trans. band
filter.firdes.WIN_HANN) # filter type
self.channel_filter = filter.fft_filter_ccc(sw_decim, chan_coeffs)
-
+
# receiver
self.packet_receiver = \
digital.demod_pkts(self.demodulator,
@@ -85,8 +89,8 @@ class receive_path(gr.hier_block2):
if self._verbose:
self._print_verbage()
- # connect block input to channel filter
- self.connect(self, self.channel_filter)
+ # connect block input to channel filter
+ self.connect(self, self.channel_filter)
# connect the channel input filter to the carrier power detector
self.connect(self.channel_filter, self.probe)
@@ -145,8 +149,8 @@ class receive_path(gr.hier_block2):
"""
Prints information about the receive path
"""
- print "\nReceive Path:"
- print "modulation: %s" % (self._demod_class.__name__)
- print "bitrate: %sb/s" % (eng_notation.num_to_str(self._bitrate))
- print "samples/symbol: %.4f" % (self.samples_per_symbol())
- print "Differential: %s" % (self.differential())
+ print("\nReceive Path:")
+ print("modulation: %s" % (self._demod_class.__name__))
+ print("bitrate: %sb/s" % (eng_notation.num_to_str(self._bitrate)))
+ print("samples/symbol: %.4f" % (self.samples_per_symbol()))
+ print("Differential: %s" % (self.differential()))
diff --git a/gr-digital/examples/narrowband/rx_voice.py b/gr-digital/examples/narrowband/rx_voice.py
index 8a0e9844be..16e4eb20ad 100755..100644
--- a/gr-digital/examples/narrowband/rx_voice.py
+++ b/gr-digital/examples/narrowband/rx_voice.py
@@ -1,24 +1,28 @@
#!/usr/bin/env python
#
# Copyright 2005,2006,2009,2011,2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
from gnuradio import gr, audio, uhd
from gnuradio import blocks
@@ -40,24 +44,24 @@ from receive_path import receive_path
from uhd_interface import uhd_receiver
#import os
-#print os.getpid()
+#print(os.getpid())
#raw_input('Attach and press enter')
class audio_tx(gr.hier_block2):
def __init__(self, audio_output_dev):
- gr.hier_block2.__init__(self, "audio_tx",
- gr.io_signature(0, 0, 0), # Input signature
- gr.io_signature(0, 0, 0)) # Output signature
-
+ gr.hier_block2.__init__(self, "audio_tx",
+ gr.io_signature(0, 0, 0), # Input signature
+ gr.io_signature(0, 0, 0)) # Output signature
+
self.sample_rate = sample_rate = 8000
self.packet_src = blocks.message_source(33)
voice_decoder = vocoder.gsm_fr_decode_ps()
s2f = blocks.short_to_float()
- sink_scale = blocks.multiply_const_ff(1.0/32767.)
+ sink_scale = blocks.multiply_const_ff(1.0 / 32767.)
audio_sink = audio.sink(sample_rate, audio_output_dev)
self.connect(self.packet_src, voice_decoder, s2f, sink_scale, audio_sink)
-
+
def msgq(self):
return self.packet_src.msgq()
@@ -79,7 +83,7 @@ class my_top_block(gr.top_block):
usrp_rate = self.source.get_sample_rate()
rrate = audio_rate / usrp_rate
self.resampler = filter.pfb.arb_resampler_ccf(rrate)
-
+
self.connect(self.source, self.resampler, self.rxpath)
elif(options.from_file is not None):
@@ -92,7 +96,7 @@ class my_top_block(gr.top_block):
self.source = blocks.null_source(gr.sizeof_gr_complex)
self.connect(self.source, self.thr, self.rxpath)
- self.connect(self.audio_tx)
+ self.connect(self.audio_tx)
# /////////////////////////////////////////////////////////////////////////////
# main
@@ -105,7 +109,7 @@ def main():
n_rcvd = 0
n_right = 0
-
+
def rx_callback(ok, payload):
global n_rcvd, n_right
n_rcvd += 1
@@ -113,9 +117,8 @@ def main():
n_right += 1
tb.audio_tx.msgq().insert_tail(gr.message_from_string(payload))
-
- print "ok = %r n_rcvd = %4d n_right = %4d" % (
- ok, n_rcvd, n_right)
+
+ print("ok = %r n_rcvd = %4d n_right = %4d" % (ok, n_rcvd, n_right))
demods = digital.modulation_utils.type_1_demods()
@@ -123,10 +126,10 @@ def main():
parser = OptionParser (option_class=eng_option, conflict_handler="resolve")
expert_grp = parser.add_option_group("Expert")
- parser.add_option("-m", "--modulation", type="choice", choices=demods.keys(),
+ parser.add_option("-m", "--modulation", type="choice", choices=list(demods.keys()),
default='gmsk',
help="Select modulation from: %s [default=%%default]"
- % (', '.join(demods.keys()),))
+ % (', '.join(list(demods.keys())),))
parser.add_option("-O", "--audio-output", type="string", default="",
help="pcm output device name. E.g., hw:0,0 or /dev/dsp")
parser.add_option("","--from-file", default=None,
@@ -134,7 +137,7 @@ def main():
receive_path.add_options(parser, expert_grp)
uhd_receiver.add_options(parser)
- for mod in demods.values():
+ for mod in list(demods.values()):
mod.add_options(expert_grp)
parser.set_defaults(bitrate=50e3) # override default bitrate default
@@ -156,7 +159,7 @@ def main():
r = gr.enable_realtime_scheduling()
if r != gr.RT_OK:
- print "Warning: Failed to enable realtime scheduling."
+ print("Warning: Failed to enable realtime scheduling.")
tb.run()
diff --git a/gr-digital/examples/narrowband/transmit_path.py b/gr-digital/examples/narrowband/transmit_path.py
index 70b4044e52..c451f64365 100644
--- a/gr-digital/examples/narrowband/transmit_path.py
+++ b/gr-digital/examples/narrowband/transmit_path.py
@@ -1,23 +1,26 @@
#
# Copyright 2005-2007,2011 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import unicode_literals
from gnuradio import gr
from gnuradio import eng_notation
@@ -36,10 +39,10 @@ class transmit_path(gr.hier_block2):
'''
See below for what options should hold
'''
- gr.hier_block2.__init__(self, "transmit_path",
- gr.io_signature(0,0,0),
- gr.io_signature(1,1,gr.sizeof_gr_complex))
-
+ gr.hier_block2.__init__(self, "transmit_path",
+ gr.io_signature(0,0,0),
+ gr.io_signature(1,1,gr.sizeof_gr_complex))
+
options = copy.copy(options) # make a copy so we can destructively modify
self._verbose = options.verbose
@@ -49,10 +52,10 @@ class transmit_path(gr.hier_block2):
# Get mod_kwargs
mod_kwargs = self._modulator_class.extract_kwargs_from_options(options)
-
+
# transmitter
- self.modulator = self._modulator_class(**mod_kwargs)
-
+ self.modulator = self._modulator_class(**mod_kwargs)
+
self.packet_transmitter = \
digital.mod_pkts(self.modulator,
access_code=None,
@@ -72,19 +75,19 @@ class transmit_path(gr.hier_block2):
def set_tx_amplitude(self, ampl):
"""
Sets the transmit amplitude sent to the USRP in volts
-
+
Args:
: ampl 0 <= ampl < 1.
"""
self._tx_amplitude = max(0.0, min(ampl, 1))
self.amp.set_k(self._tx_amplitude)
-
+
def send_pkt(self, payload='', eof=False):
"""
Calls the transmitter method to send a packet
"""
return self.packet_transmitter.send_pkt(payload, eof)
-
+
def bitrate(self):
return self._bitrate
@@ -120,8 +123,8 @@ class transmit_path(gr.hier_block2):
"""
Prints information about the transmit path
"""
- print "Tx amplitude %s" % (self._tx_amplitude)
- print "modulation: %s" % (self._modulator_class.__name__)
- print "bitrate: %sb/s" % (eng_notation.num_to_str(self._bitrate))
- print "samples/symbol: %.4f" % (self.samples_per_symbol())
- print "Differential: %s" % (self.differential())
+ print("Tx amplitude %s" % (self._tx_amplitude))
+ print("modulation: %s" % (self._modulator_class.__name__))
+ print("bitrate: %sb/s" % (eng_notation.num_to_str(self._bitrate)))
+ print("samples/symbol: %.4f" % (self.samples_per_symbol()))
+ print("Differential: %s" % (self.differential()))
diff --git a/gr-digital/examples/narrowband/tunnel.py b/gr-digital/examples/narrowband/tunnel.py
index 7b9b69cc8a..da00baa900 100755..100644
--- a/gr-digital/examples/narrowband/tunnel.py
+++ b/gr-digital/examples/narrowband/tunnel.py
@@ -1,24 +1,28 @@
#!/usr/bin/env python
#
# Copyright 2005,2006,2009,2011 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
# ////////////////////////////////////////////////////////////////////
@@ -49,7 +53,7 @@ from uhd_interface import uhd_receiver
import os, sys
import random, time, struct
-#print os.getpid()
+#print(os.getpid())
#raw_input('Attach and press enter')
# ////////////////////////////////////////////////////////////////////
@@ -71,7 +75,7 @@ IFF_ONE_QUEUE = 0x2000 # beats me ;)
def open_tun_interface(tun_device_filename):
from fcntl import ioctl
-
+
mode = IFF_TAP | IFF_NO_PI
TUNSETIFF = 0x400454ca
@@ -79,7 +83,7 @@ def open_tun_interface(tun_device_filename):
ifs = ioctl(tun, TUNSETIFF, struct.pack("16sH", "gr%d", mode))
ifname = ifs[:16].strip("\x00")
return (tun, ifname)
-
+
# ////////////////////////////////////////////////////////////////////
# the flow graph
@@ -94,20 +98,20 @@ class my_top_block(gr.top_block):
# Get the modulation's bits_per_symbol
args = mod_class.extract_kwargs_from_options(options)
- symbol_rate = options.bitrate / mod_class(**args).bits_per_symbol()
+ symbol_rate = options.bitrate / mod_class(**args.bits_per_symbol())
self.source = uhd_receiver(options.args, symbol_rate,
options.samples_per_symbol,
options.rx_freq, options.rx_gain,
options.spec, options.antenna,
options.verbose)
-
+
self.sink = uhd_transmitter(options.args, symbol_rate,
options.samples_per_symbol,
options.tx_freq, options.tx_gain,
options.spec, options.antenna,
options.verbose)
-
+
options.samples_per_symbol = self.source._sps
self.txpath = transmit_path(mod_class, options)
@@ -131,7 +135,7 @@ class my_top_block(gr.top_block):
self.sink.set_freq(target_freq)
self.source.set_freq(target_freq)
-
+
# ////////////////////////////////////////////////////////////////////
# Carrier Sense MAC
@@ -166,7 +170,7 @@ class cs_mac(object):
payload: contents of the packet (string)
"""
if self.verbose:
- print "Rx: ok = %r len(payload) = %4d" % (ok, len(payload))
+ print("Rx: ok = %r len(payload) = %4d" % (ok, len(payload)))
if ok:
os.write(self.tun_fd, payload)
@@ -186,7 +190,7 @@ class cs_mac(object):
break
if self.verbose:
- print "Tx: len(payload) = %4d" % (len(payload),)
+ print("Tx: len(payload) = %4d" % (len(payload),))
delay = min_delay
while self.tb.carrier_sensed():
@@ -209,10 +213,10 @@ def main():
parser = OptionParser (option_class=eng_option, conflict_handler="resolve")
expert_grp = parser.add_option_group("Expert")
- parser.add_option("-m", "--modulation", type="choice", choices=mods.keys(),
+ parser.add_option("-m", "--modulation", type="choice", choices=list(mods.keys()),
default='gmsk',
help="Select modulation from: %s [default=%%default]"
- % (', '.join(mods.keys()),))
+ % (', '.join(list(mods.keys())),))
parser.add_option("-s", "--size", type="eng_float", default=1500,
help="set packet size [default=%default]")
@@ -227,10 +231,10 @@ def main():
uhd_receiver.add_options(parser)
uhd_transmitter.add_options(parser)
- for mod in mods.values():
+ for mod in list(mods.values()):
mod.add_options(expert_grp)
- for demod in demods.values():
+ for demod in list(demods.values()):
demod.add_options(expert_grp)
(options, args) = parser.parse_args ()
@@ -247,7 +251,7 @@ def main():
realtime = True
else:
realtime = False
- print "Note: failed to enable realtime scheduling"
+ print("Note: failed to enable realtime scheduling")
# instantiate the MAC
mac = cs_mac(tun_fd, verbose=True)
@@ -261,26 +265,26 @@ def main():
mac.set_top_block(tb) # give the MAC a handle for the PHY
if tb.txpath.bitrate() != tb.rxpath.bitrate():
- print "WARNING: Transmit bitrate = %sb/sec, Receive bitrate = %sb/sec" % (
+ print("WARNING: Transmit bitrate = %sb/sec, Receive bitrate = %sb/sec" % (
eng_notation.num_to_str(tb.txpath.bitrate()),
- eng_notation.num_to_str(tb.rxpath.bitrate()))
-
- print "modulation: %s" % (options.modulation,)
- print "freq: %s" % (eng_notation.num_to_str(options.tx_freq))
- print "bitrate: %sb/sec" % (eng_notation.num_to_str(tb.txpath.bitrate()),)
- print "samples/symbol: %3d" % (tb.txpath.samples_per_symbol(),)
+ eng_notation.num_to_str(tb.rxpath.bitrate())))
+
+ print("modulation: %s" % (options.modulation,))
+ print("freq: %s" % (eng_notation.num_to_str(options.tx_freq)))
+ print("bitrate: %sb/sec" % (eng_notation.num_to_str(tb.txpath.bitrate()),))
+ print("samples/symbol: %3d" % (tb.txpath.samples_per_symbol(),))
tb.rxpath.set_carrier_threshold(options.carrier_threshold)
- print "Carrier sense threshold:", options.carrier_threshold, "dB"
-
- print
- print "Allocated virtual ethernet interface: %s" % (tun_ifname,)
- print "You must now use ifconfig to set its IP address. E.g.,"
- print
- print " $ sudo ifconfig %s 192.168.200.1" % (tun_ifname,)
- print
- print "Be sure to use a different address in the same subnet for each machine."
- print
+ print("Carrier sense threshold:", options.carrier_threshold, "dB")
+
+ print()
+ print("Allocated virtual ethernet interface: %s" % (tun_ifname,))
+ print("You must now use ifconfig to set its IP address. E.g.,")
+ print()
+ print(" $ sudo ifconfig %s 192.168.200.1" % (tun_ifname,))
+ print()
+ print("Be sure to use a different address in the same subnet for each machine.")
+ print()
tb.start() # Start executing the flow graph (runs in separate threads)
@@ -289,7 +293,7 @@ def main():
tb.stop() # but if it does, tell flow graph to stop.
tb.wait() # wait for it to finish
-
+
if __name__ == '__main__':
try:
diff --git a/gr-digital/examples/narrowband/tx_voice.py b/gr-digital/examples/narrowband/tx_voice.py
index afdb4406e6..e65df64d25 100755..100644
--- a/gr-digital/examples/narrowband/tx_voice.py
+++ b/gr-digital/examples/narrowband/tx_voice.py
@@ -1,24 +1,28 @@
#!/usr/bin/env python
#
# Copyright 2005-2007,2009,2011,2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
from gnuradio import gr, audio, uhd
from gnuradio import eng_notation
@@ -40,15 +44,15 @@ from transmit_path import transmit_path
from uhd_interface import uhd_transmitter
#import os
-#print os.getpid()
+#print(os.getpid())
#raw_input('Attach and press enter')
class audio_rx(gr.hier_block2):
def __init__(self, audio_input_dev):
- gr.hier_block2.__init__(self, "audio_rx",
- gr.io_signature(0, 0, 0), # Input signature
- gr.io_signature(0, 0, 0)) # Output signature
+ gr.hier_block2.__init__(self, "audio_rx",
+ gr.io_signature(0, 0, 0), # Input signature
+ gr.io_signature(0, 0, 0)) # Output signature
self.sample_rate = sample_rate = 8000
src = audio.source(sample_rate, audio_input_dev)
src_scale = blocks.multiply_const_ff(32767)
@@ -60,7 +64,7 @@ class audio_rx(gr.hier_block2):
def get_encoded_voice_packet(self):
return self.packets_from_encoder.delete_head()
-
+
class my_top_block(gr.top_block):
@@ -78,7 +82,7 @@ class my_top_block(gr.top_block):
audio_rate = self.audio_rx.sample_rate
usrp_rate = self.sink.get_sample_rate()
rrate = usrp_rate / audio_rate
-
+
elif(options.to_file is not None):
self.sink = blocks.file_sink(gr.sizeof_gr_complex, options.to_file)
rrate = 1
@@ -87,10 +91,10 @@ class my_top_block(gr.top_block):
rrate = 1
self.resampler = filter.pfb.arb_resampler_ccf(rrate)
-
- self.connect(self.audio_rx)
- self.connect(self.txpath, self.resampler, self.sink)
-
+
+ self.connect(self.audio_rx)
+ self.connect(self.txpath, self.resampler, self.sink)
+
# /////////////////////////////////////////////////////////////////////////////
# main
@@ -102,17 +106,17 @@ def main():
return tb.txpath.send_pkt(payload, eof)
def rx_callback(ok, payload):
- print "ok = %r, payload = '%s'" % (ok, payload)
+ print("ok = %r, payload = '%s'" % (ok, payload))
mods = digital.modulation_utils.type_1_mods()
parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
expert_grp = parser.add_option_group("Expert")
- parser.add_option("-m", "--modulation", type="choice", choices=mods.keys(),
+ parser.add_option("-m", "--modulation", type="choice", choices=list(mods.keys()),
default='gmsk',
help="Select modulation from: %s [default=%%default]"
- % (', '.join(mods.keys()),))
+ % (', '.join(list(mods.keys())),))
parser.add_option("-M", "--megabytes", type="eng_float", default=0,
help="set megabytes to transmit [default=inf]")
parser.add_option("-I", "--audio-input", type="string", default="",
@@ -123,7 +127,7 @@ def main():
transmit_path.add_options(parser, expert_grp)
uhd_transmitter.add_options(parser)
- for mod in mods.values():
+ for mod in list(mods.values()):
mod.add_options(expert_grp)
parser.set_defaults(bitrate=50e3) # override default bitrate default
@@ -144,7 +148,7 @@ def main():
r = gr.enable_realtime_scheduling()
if r != gr.RT_OK:
- print "Warning: failed to enable realtime scheduling"
+ print("Warning: failed to enable realtime scheduling")
tb.start() # start flow graph
@@ -161,7 +165,7 @@ def main():
n += len(s)
sys.stderr.write('.')
pktno += 1
-
+
send_pkt(eof=True)
tb.wait() # wait for it to finish
@@ -170,4 +174,4 @@ if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
- pass
+ pass
diff --git a/gr-digital/examples/narrowband/uhd_interface.py b/gr-digital/examples/narrowband/uhd_interface.py
index e7c7fe3af0..1da2bbb1bf 100644
--- a/gr-digital/examples/narrowband/uhd_interface.py
+++ b/gr-digital/examples/narrowband/uhd_interface.py
@@ -1,24 +1,28 @@
#!/usr/bin/env python
#
# Copyright 2010,2011 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
from gnuradio import gr, uhd
from gnuradio import eng_notation
@@ -41,10 +45,10 @@ def add_freq_option(parser):
help="set Tx and/or Rx frequency to FREQ [default=%default]",
metavar="FREQ")
-class uhd_interface:
+class uhd_interface(object):
def __init__(self, istx, args, sym_rate, sps, freq=None, lo_offset=None,
gain=None, spec=None, antenna=None, clock_source=None):
-
+
if(istx):
self.u = uhd.usrp_sink(device_addr=args, stream_args=uhd.stream_args('fc32'))
else:
@@ -61,15 +65,15 @@ class uhd_interface:
# Set the antenna
if(antenna):
self.u.set_antenna(antenna, 0)
-
+
self._args = args
self._ant = antenna
self._spec = spec
self._gain = self.set_gain(gain)
- self._lo_offset = lo_offset
- self._freq = self.set_freq(freq, lo_offset)
+ self._lo_offset = lo_offset
+ self._freq = self.set_freq(freq, lo_offset)
self._rate, self._sps = self.set_sample_rate(sym_rate, sps)
- self._clock_source = clock_source
+ self._clock_source = clock_source
def set_sample_rate(self, sym_rate, req_sps):
start_sps = req_sps
@@ -78,37 +82,37 @@ class uhd_interface:
self.u.set_samp_rate(asked_samp_rate)
actual_samp_rate = self.u.get_samp_rate()
- sps = actual_samp_rate/sym_rate
+ sps = actual_samp_rate / sym_rate
if(sps < 2):
req_sps +=1
else:
actual_sps = sps
break
-
+
if(sps != req_sps):
- print "\nSymbol Rate: %f" % (sym_rate)
- print "Requested sps: %f" % (start_sps)
- print "Given sample rate: %f" % (actual_samp_rate)
- print "Actual sps for rate: %f" % (actual_sps)
+ print("\nSymbol Rate: %f" % (sym_rate))
+ print("Requested sps: %f" % (start_sps))
+ print("Given sample rate: %f" % (actual_samp_rate))
+ print("Actual sps for rate: %f" % (actual_sps))
if(actual_samp_rate != asked_samp_rate):
- print "\nRequested sample rate: %f" % (asked_samp_rate)
- print "Actual sample rate: %f" % (actual_samp_rate)
+ print("\nRequested sample rate: %f" % (asked_samp_rate))
+ print("Actual sample rate: %f" % (actual_samp_rate))
return (actual_samp_rate, actual_sps)
def get_sample_rate(self):
return self.u.get_samp_rate()
-
+
def set_gain(self, gain=None):
if gain is None:
# if no gain was specified, use the mid-point in dB
g = self.u.get_gain_range()
- gain = float(g.start()+g.stop())/2
- print "\nNo gain specified."
- print "Setting gain to %f (from [%f, %f])" % \
- (gain, g.start(), g.stop())
-
+ gain = float(g.start()+g.stop()) / 2
+ print("\nNo gain specified.")
+ print("Setting gain to %f (from [%f, %f])" %
+ (gain, g.start(), g.stop()))
+
self.u.set_gain(gain, 0)
return gain
@@ -116,7 +120,7 @@ class uhd_interface:
if(freq is None):
sys.stderr.write("You must specify -f FREQ or --freq FREQ\n")
sys.exit(1)
-
+
r = self.u.set_center_freq(uhd.tune_request(freq, lo_offset))
if r:
return freq
@@ -163,22 +167,22 @@ class uhd_transmitter(uhd_interface, gr.hier_block2):
parser.add_option("", "--tx-gain", type="eng_float", default=None,
help="set transmit gain in dB (default is midpoint)")
parser.add_option("-C", "--clock-source", type="string", default=None,
- help="select clock source (e.g. 'external') [default=%default]")
+ help="select clock source (e.g. 'external') [default=%default]")
parser.add_option("-v", "--verbose", action="store_true", default=False)
def _print_verbage(self):
"""
Prints information about the UHD transmitter
"""
- print "\nUHD Transmitter:"
- print "Args: %s" % (self._args)
- print "Freq: %sHz" % (eng_notation.num_to_str(self._freq))
- print "LO Offset: %sHz" % (eng_notation.num_to_str(self._lo_offset))
- print "Gain: %f dB" % (self._gain)
- print "Sample Rate: %ssps" % (eng_notation.num_to_str(self._rate))
- print "Antenna: %s" % (self._ant)
- print "Subdev Spec: %s" % (self._spec)
- print "Clock Source: %s" % (self._clock_source)
+ print("\nUHD Transmitter:")
+ print("Args: %s" % (self._args))
+ print("Freq: %sHz" % (eng_notation.num_to_str(self._freq)))
+ print("LO Offset: %sHz" % (eng_notation.num_to_str(self._lo_offset)) )
+ print("Gain: %f dB" % (self._gain))
+ print("Sample Rate: %ssps" % (eng_notation.num_to_str(self._rate)))
+ print("Antenna: %s" % (self._ant))
+ print("Subdev Spec: %s" % (self._spec))
+ print("Clock Source: %s" % (self._clock_source))
#-------------------------------------------------------------------#
# RECEIVER
@@ -191,7 +195,7 @@ class uhd_receiver(uhd_interface, gr.hier_block2):
gr.hier_block2.__init__(self, "uhd_receiver",
gr.io_signature(0,0,0),
gr.io_signature(1,1,gr.sizeof_gr_complex))
-
+
# Set up the UHD interface as a receiver
uhd_interface.__init__(self, False, args, sym_rate, sps,
freq, lo_offset, gain, spec, antenna, clock_source)
@@ -214,11 +218,11 @@ class uhd_receiver(uhd_interface, gr.hier_block2):
help="set receive frequency to FREQ [default=%default]",
metavar="FREQ")
parser.add_option("", "--lo-offset", type="eng_float", default=0,
- help="set local oscillator offset in Hz (default is 0)")
+ help="set local oscillator offset in Hz (default is 0)")
parser.add_option("", "--rx-gain", type="eng_float", default=None,
help="set receive gain in dB (default is midpoint)")
parser.add_option("-C", "--clock-source", type="string", default=None,
- help="select clock source (e.g. 'external') [default=%default]")
+ help="select clock source (e.g. 'external') [default=%default]")
if not parser.has_option("--verbose"):
parser.add_option("-v", "--verbose", action="store_true", default=False)
@@ -226,13 +230,13 @@ class uhd_receiver(uhd_interface, gr.hier_block2):
"""
Prints information about the UHD transmitter
"""
- print "\nUHD Receiver:"
- print "UHD Args: %s" % (self._args)
- print "Freq: %sHz" % (eng_notation.num_to_str(self._freq))
- print "LO Offset: %sHz" % (eng_notation.num_to_str(self._lo_offset))
- print "Gain: %f dB" % (self._gain)
- print "Sample Rate: %ssps" % (eng_notation.num_to_str(self._rate))
- print "Antenna: %s" % (self._ant)
- print "Spec: %s" % (self._spec)
- print "Clock Source: %s" % (self._clock_source)
+ print("\nUHD Receiver:")
+ print("UHD Args: %s" % (self._args))
+ print("Freq: %sHz" % (eng_notation.num_to_str(self._freq)))
+ print("LO Offset: %sHz" % (eng_notation.num_to_str(self._lo_offset)) )
+ print("Gain: %f dB" % (self._gain))
+ print("Sample Rate: %ssps" % (eng_notation.num_to_str(self._rate)))
+ print("Antenna: %s" % (self._ant))
+ print("Spec: %s" % (self._spec))
+ print("Clock Source: %s" % (self._clock_source))
diff --git a/gr-digital/examples/ofdm/benchmark_add_channel.py b/gr-digital/examples/ofdm/benchmark_add_channel.py
index 0ac46985a7..6fc7056dfb 100755..100644
--- a/gr-digital/examples/ofdm/benchmark_add_channel.py
+++ b/gr-digital/examples/ofdm/benchmark_add_channel.py
@@ -1,24 +1,28 @@
#!/usr/bin/env python
#
# Copyright 2010,2011 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
from gnuradio import gr, channels
from gnuradio import blocks
@@ -32,15 +36,15 @@ class my_top_block(gr.top_block):
def __init__(self, ifile, ofile, options):
gr.top_block.__init__(self)
- SNR = 10.0**(options.snr/10.0)
+ SNR = 10.0**(options.snr / 10.0)
time_offset = options.time_offset
- phase_offset = options.phase_offset*(math.pi/180.0)
+ phase_offset = options.phase_offset*(math.pi / 180.0)
# calculate noise voltage from SNR
power_in_signal = abs(options.tx_amplitude)**2
- noise_power = power_in_signal/SNR
+ noise_power = power_in_signal / SNR
noise_voltage = math.sqrt(noise_power)
- print "Noise voltage: ", noise_voltage
+ print("Noise voltage: ", noise_voltage)
frequency_offset = options.frequency_offset / options.fft_length
@@ -54,7 +58,7 @@ class my_top_block(gr.top_block):
self.snk = blocks.file_sink(gr.sizeof_gr_complex, ofile)
self.connect(self.src, self.channel, self.phase, self.snk)
-
+
# /////////////////////////////////////////////////////////////////////////////
# main
@@ -94,13 +98,13 @@ def main():
ifile = args[0]
ofile = args[1]
-
+
# build the graph
tb = my_top_block(ifile, ofile, options)
r = gr.enable_realtime_scheduling()
if r != gr.RT_OK:
- print "Warning: Failed to enable realtime scheduling."
+ print("Warning: Failed to enable realtime scheduling.")
tb.start() # start flow graph
tb.wait() # wait for it to finish
diff --git a/gr-digital/examples/ofdm/receive_path.py b/gr-digital/examples/ofdm/receive_path.py
index 0cb4479a2e..b9abe8cebc 100644
--- a/gr-digital/examples/ofdm/receive_path.py
+++ b/gr-digital/examples/ofdm/receive_path.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
#
# Copyright 2005,2006,2011 Free Software Foundation, Inc.
#
diff --git a/gr-digital/examples/ofdm/transmit_path.py b/gr-digital/examples/ofdm/transmit_path.py
index 98a81f3c1a..17adffab44 100644
--- a/gr-digital/examples/ofdm/transmit_path.py
+++ b/gr-digital/examples/ofdm/transmit_path.py
@@ -1,23 +1,26 @@
#
# Copyright 2005,2006,2011 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import unicode_literals
from gnuradio import gr
from gnuradio import eng_notation
@@ -31,15 +34,15 @@ import sys
# transmit path
# /////////////////////////////////////////////////////////////////////////////
-class transmit_path(gr.hier_block2):
+class transmit_path(gr.hier_block2):
def __init__(self, options):
'''
See below for what options should hold
'''
- gr.hier_block2.__init__(self, "transmit_path",
- gr.io_signature(0, 0, 0),
- gr.io_signature(1, 1, gr.sizeof_gr_complex))
+ gr.hier_block2.__init__(self, "transmit_path",
+ gr.io_signature(0, 0, 0),
+ gr.io_signature(1, 1, gr.sizeof_gr_complex))
options = copy.copy(options) # make a copy so we can destructively modify
@@ -63,13 +66,13 @@ class transmit_path(gr.hier_block2):
def set_tx_amplitude(self, ampl):
"""
Sets the transmit amplitude sent to the USRP
-
+
Args:
: ampl 0 <= ampl < 1.0. Try 0.10
"""
self._tx_amplitude = max(0.0, min(ampl, 1))
self.amp.set_k(self._tx_amplitude)
-
+
def send_pkt(self, payload='', eof=False):
"""
Calls the transmitter method to send a packet
@@ -97,5 +100,5 @@ class transmit_path(gr.hier_block2):
"""
Prints information about the transmit path
"""
- print "Tx amplitude %s" % (self._tx_amplitude)
-
+ print("Tx amplitude %s" % (self._tx_amplitude))
+
diff --git a/gr-digital/examples/ofdm/uhd_interface.py b/gr-digital/examples/ofdm/uhd_interface.py
index ac34d956ae..df5be60f30 100644
--- a/gr-digital/examples/ofdm/uhd_interface.py
+++ b/gr-digital/examples/ofdm/uhd_interface.py
@@ -1,24 +1,28 @@
#!/usr/bin/env python
#
# Copyright 2010,2011 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
from gnuradio import gr, uhd
from gnuradio import eng_notation
@@ -41,17 +45,17 @@ def add_freq_option(parser):
help="set Tx and/or Rx frequency to FREQ [default=%default]",
metavar="FREQ")
-class uhd_interface:
+class uhd_interface(object):
def __init__(self, istx, args, bandwidth, freq=None, lo_offset=None,
gain=None, spec=None, antenna=None, clock_source=None):
-
+
if(istx):
self.u = uhd.usrp_sink(device_addr=args, stream_args=uhd.stream_args('fc32'))
else:
self.u = uhd.usrp_source(device_addr=args, stream_args=uhd.stream_args('fc32'))
# Set clock source to external.
- if(clock_source):
+ if(clock_source):
self.u.set_clock_source(clock_source, 0)
# Set the subdevice spec
@@ -61,7 +65,7 @@ class uhd_interface:
# Set the antenna
if(antenna):
self.u.set_antenna(antenna, 0)
-
+
self._args = args
self._ant = antenna
self._spec = spec
@@ -74,21 +78,21 @@ class uhd_interface:
def set_sample_rate(self, bandwidth):
self.u.set_samp_rate(bandwidth)
actual_bw = self.u.get_samp_rate()
-
+
return actual_bw
def get_sample_rate(self):
return self.u.get_samp_rate()
-
+
def set_gain(self, gain=None):
if gain is None:
# if no gain was specified, use the mid-point in dB
g = self.u.get_gain_range()
- gain = float(g.start()+g.stop())/2
- print "\nNo gain specified."
- print "Setting gain to %f (from [%f, %f])" % \
- (gain, g.start(), g.stop())
-
+ gain = float(g.start()+g.stop()) / 2
+ print("\nNo gain specified.")
+ print("Setting gain to %f (from [%f, %f])" %
+ (gain, g.start(), g.stop()))
+
self.u.set_gain(gain, 0)
return gain
@@ -96,7 +100,7 @@ class uhd_interface:
if(freq is None):
sys.stderr.write("You must specify -f FREQ or --freq FREQ\n")
sys.exit(1)
-
+
r = self.u.set_center_freq(uhd.tune_request(freq, lo_offset))
if r:
@@ -151,15 +155,15 @@ class uhd_transmitter(uhd_interface, gr.hier_block2):
"""
Prints information about the UHD transmitter
"""
- print "\nUHD Transmitter:"
- print "UHD Args: %s" % (self._args)
- print "Freq: %sHz" % (eng_notation.num_to_str(self._freq))
- print "LO Offset: %sHz" % (eng_notation.num_to_str(self._lo_offset))
- print "Gain: %f dB" % (self._gain)
- print "Sample Rate: %ssps" % (eng_notation.num_to_str(self._rate))
- print "Antenna: %s" % (self._ant)
- print "Subdev Sec: %s" % (self._spec)
- print "Clock Source: %s" % (self._clock_source)
+ print("\nUHD Transmitter:")
+ print("UHD Args: %s" % (self._args))
+ print("Freq: %sHz" % (eng_notation.num_to_str(self._freq)))
+ print("LO Offset: %sHz" % (eng_notation.num_to_str(self._lo_offset)))
+ print("Gain: %f dB" % (self._gain))
+ print("Sample Rate: %ssps" % (eng_notation.num_to_str(self._rate)))
+ print("Antenna: %s" % (self._ant))
+ print("Subdev Sec: %s" % (self._spec))
+ print("Clock Source: %s" % (self._clock_source))
@@ -174,7 +178,7 @@ class uhd_receiver(uhd_interface, gr.hier_block2):
gr.hier_block2.__init__(self, "uhd_receiver",
gr.io_signature(0,0,0),
gr.io_signature(1,1,gr.sizeof_gr_complex))
-
+
# Set up the UHD interface as a receiver
uhd_interface.__init__(self, False, args, bandwidth,
freq, lo_offset, gain, spec, antenna, clock_source)
@@ -209,13 +213,13 @@ class uhd_receiver(uhd_interface, gr.hier_block2):
"""
Prints information about the UHD transmitter
"""
- print "\nUHD Receiver:"
- print "UHD Args: %s" % (self._args)
- print "Freq: %sHz" % (eng_notation.num_to_str(self._freq))
- print "LO Offset: %sHz" % (eng_notation.num_to_str(self._lo_offset))
- print "Gain: %f dB" % (self._gain)
- print "Sample Rate: %ssps" % (eng_notation.num_to_str(self._rate))
- print "Antenna: %s" % (self._ant)
- print "Subdev Sec: %s" % (self._spec)
- print "Clock Source: %s" % (self._clock_source)
+ print("\nUHD Receiver:")
+ print("UHD Args: %s" % (self._args))
+ print("Freq: %sHz" % (eng_notation.num_to_str(self._freq)))
+ print("LO Offset: %sHz" % (eng_notation.num_to_str(self._lo_offset)))
+ print("Gain: %f dB" % (self._gain))
+ print("Sample Rate: %ssps" % (eng_notation.num_to_str(self._rate)))
+ print("Antenna: %s" % (self._ant))
+ print("Subdev Sec: %s" % (self._spec))
+ print("Clock Source: %s" % (self._clock_source))
diff --git a/gr-digital/examples/run_length.py b/gr-digital/examples/run_length.py
index 5020655dbb..a122a2b8eb 100755..100644
--- a/gr-digital/examples/run_length.py
+++ b/gr-digital/examples/run_length.py
@@ -1,24 +1,27 @@
#!/usr/bin/env python
#
# Copyright 2007 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import unicode_literals
from optparse import OptionParser
import sys
@@ -30,9 +33,9 @@ def main():
(options, args) = parser.parse_args()
if options.file == None:
- print "Must specify file to read from using '-f'."
+ print("Must specify file to read from using '-f'.")
sys.exit(1)
- print "Using", options.file, "for data."
+ print("Using", options.file, "for data.")
f = open(options.file, 'r')
runs = []
@@ -40,7 +43,7 @@ def main():
current = 0
bytes = 0
bits = 0
-
+
for ch in f.read():
x = ord(ch)
bytes = bytes + 1
@@ -66,18 +69,16 @@ def main():
runs[count-1] = runs[count-1] + 1
chk = 0
- print "Bytes read: ", bytes
- print "Bits read: ", bits
- print
+ print("Bytes read: ", bytes)
+ print("Bits read: ", bits)
+ print()
for i in range(len(runs)):
chk = chk + runs[i]*(i+1)
- print "Runs of length", i+1, ":", runs[i]
- print
- print "Sum of runs:", chk, "bits"
- print
- print "Maximum run length is", len(runs), "bits"
+ print("Runs of length", i+1, ":", runs[i])
+ print()
+ print("Sum of runs:", chk, "bits")
+ print()
+ print("Maximum run length is", len(runs), "bits")
if __name__ == "__main__":
main()
-
-
diff --git a/gr-digital/examples/snr_estimators.py b/gr-digital/examples/snr_estimators.py
index 31efe6b83e..b1decd84d8 100755..100644
--- a/gr-digital/examples/snr_estimators.py
+++ b/gr-digital/examples/snr_estimators.py
@@ -20,19 +20,23 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
+
import sys
try:
import scipy
from scipy import stats
except ImportError:
- print "Error: Program requires scipy (www.scipy.org)."
+ print("Error: Program requires scipy (www.scipy.org).")
sys.exit(1)
try:
import pylab
except ImportError:
- print "Error: Program requires Matplotlib (matplotlib.sourceforge.net)."
+ print("Error: Program requires Matplotlib (matplotlib.sourceforge.net).")
sys.exit(1)
from gnuradio import gr, digital, filter
@@ -55,7 +59,7 @@ def online_skewness(data):
M2 = 0
M3 = 0
- for n in xrange(len(data)):
+ for n in range(len(data)):
delta = data[n] - mean
delta_n = delta / (n+1)
term1 = delta * delta_n * n
@@ -63,12 +67,12 @@ def online_skewness(data):
M3 = M3 + term1 * delta_n * (n - 1) - 3 * delta_n * M2
M2 = M2 + term1
- return scipy.sqrt(len(data))*M3 / scipy.power(M2, 3.0/2.0);
+ return scipy.sqrt(len(data))*M3 / scipy.power(M2, 3.0 / 2.0);
def snr_est_simple(signal):
s = scipy.mean(abs(signal)**2)
n = 2*scipy.var(abs(signal))
- snr_rat = s/n
+ snr_rat = s / n
return 10.0*scipy.log10(snr_rat), snr_rat
def snr_est_skew(signal):
@@ -94,11 +98,11 @@ def snr_est_svr(signal):
N = len(signal)
ssum = 0
msum = 0
- for i in xrange(1, N):
+ for i in range(1, N):
ssum += (abs(signal[i])**2)*(abs(signal[i-1])**2)
msum += (abs(signal[i])**4)
- savg = (1.0/(float(N)-1.0))*ssum
- mavg = (1.0/(float(N)-1.0))*msum
+ savg = (1.0 / (float(N-1.0)))*ssum
+ mavg = (1.0 / (float(N-1.0)))*msum
beta = savg / (mavg - savg)
snr_rat = ((beta - 1) + scipy.sqrt(beta*(beta-1)))
@@ -126,9 +130,9 @@ def main():
parser.add_option("", "--snr-step", type="float", default=0.5,
help="SNR step amount [default=%default]")
parser.add_option("-t", "--type", type="choice",
- choices=gr_estimators.keys(), default="simple",
+ choices=list(gr_estimators.keys()), default="simple",
help="Estimator type {0} [default=%default]".format(
- gr_estimators.keys()))
+ list(gr_estimators.keys())))
(options, args) = parser.parse_args ()
N = options.nsamples
@@ -155,14 +159,14 @@ def main():
SNR_step = options.snr_step
SNR_dB = scipy.arange(SNR_min, SNR_max+SNR_step, SNR_step)
for snr in SNR_dB:
- SNR = 10.0**(snr/10.0)
+ SNR = 10.0**(snr / 10.0)
scale = scipy.sqrt(2*SNR)
- yy = bits + n_cpx/scale
- print "SNR: ", snr
+ yy = bits + n_cpx / scale
+ print("SNR: ", snr)
Sknown = scipy.mean(yy**2)
- Nknown = scipy.var(n_cpx/scale)
- snr0 = Sknown/Nknown
+ Nknown = scipy.var(n_cpx / scale)
+ snr0 = Sknown / Nknown
snr0dB = 10.0*scipy.log10(snr0)
snr_known.append(float(snr0dB))
@@ -171,7 +175,7 @@ def main():
gr_src = blocks.vector_source_c(bits.tolist(), False)
gr_snr = digital.mpsk_snr_est_cc(gr_est, ntag, 0.001)
- gr_chn = channels.channel_model(1.0/scale)
+ gr_chn = channels.channel_model(1.0 / scale)
gr_snk = blocks.null_sink(gr.sizeof_gr_complex)
tb = gr.top_block()
tb.connect(gr_src, gr_chn, gr_snr, gr_snk)
diff --git a/gr-digital/grc/CMakeLists.txt b/gr-digital/grc/CMakeLists.txt
index a3d0223290..78c8261525 100644
--- a/gr-digital/grc/CMakeLists.txt
+++ b/gr-digital/grc/CMakeLists.txt
@@ -17,7 +17,7 @@
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-file(GLOB xml_files "*.xml")
-install(FILES ${xml_files}
+file(GLOB yml_files "*.yml")
+install(FILES ${yml_files}
DESTINATION ${GRC_BLOCKS_DIR}
)
diff --git a/gr-digital/grc/digital.tree.yml b/gr-digital/grc/digital.tree.yml
new file mode 100644
index 0000000000..0e4c2463e8
--- /dev/null
+++ b/gr-digital/grc/digital.tree.yml
@@ -0,0 +1,85 @@
+'[Core]':
+- Coding:
+ - digital_additive_scrambler_bb
+ - digital_descrambler_bb
+ - digital_scrambler_bb
+- Equalizers:
+ - digital_cma_equalizer_cc
+ - digital_lms_dd_equalizer_cc
+ - digital_kurtotic_equalizer_cc
+- Measurement Tools:
+ - digital_mpsk_snr_est_cc
+ - digital_probe_density_b
+ - digital_probe_mpsk_snr_est_c
+- Modulators:
+ - digital_cpmmod_bc
+ - digital_gfsk_mod
+ - digital_gfsk_demod
+ - digital_gmskmod_bc
+ - digital_gmsk_mod
+ - digital_gmsk_demod
+ - digital_constellation_modulator
+ - digital_constellation_receiver_cb
+ - variable_constellation
+ - variable_constellation_rect
+ - variable_modulate_vector
+- Packet Operators:
+ - digital_correlate_access_code_tag_bb
+ - digital_correlate_access_code_xx_ts
+ - digital_crc32_bb
+ - digital_crc32_async_bb
+ - digital_framer_sink_1
+ - variable_header_format_default
+ - digital_protocol_formatter_async
+ - digital_protocol_formatter_bb
+ - digital_protocol_parser_b
+ - digital_header_payload_demux
+ - digital_packet_headergenerator_bb
+ - digital_packet_headergenerator_bb_default
+ - digital_packet_headerparser_b
+ - digital_packet_headerparser_b_default
+ - digital_packet_sink
+ - digital_hdlc_framer_pb
+ - digital_hdlc_deframer_bp
+ - digital_simple_framer
+ - digital_simple_correlator
+- OFDM:
+ - digital_ofdm_mod
+ - digital_ofdm_demod
+ - digital_ofdm_carrier_allocator_cvc
+ - digital_ofdm_chanest_vcvc
+ - digital_ofdm_cyclic_prefixer
+ - digital_ofdm_frame_acquisition
+ - digital_ofdm_frame_equalizer_vcvc
+ - digital_ofdm_frame_sink
+ - digital_ofdm_insert_preamble
+ - digital_ofdm_rx
+ - digital_ofdm_sampler
+ - digital_ofdm_serializer_vcc
+ - digital_ofdm_sync_pn
+ - digital_ofdm_sync_sc_cfb
+ - digital_ofdm_tx
+- Symbol Coding:
+ - digital_binary_slicer_fb
+ - digital_chunks_to_symbols_xx
+ - digital_constellation_decoder_cb
+ - digital_constellation_receiver_cb
+ - digital_constellation_soft_decoder_cf
+ - digital_diff_decoder_bb
+ - digital_diff_encoder_bb
+ - digital_diff_phasor_cc
+ - digital_map_bb
+- Synchronizers:
+ - digital_clock_recovery_mm_xx
+ - digital_costas_loop_cc
+ - digital_fll_band_edge_cc
+ - digital_pfb_clock_sync_xxx
+ - digital_pn_correlator_cc
+ - digital_symbol_sync_xx
+ - digital_corr_est_cc
+- Waveform Generators:
+ - digital_glfsr_source_x
+- Deprecated:
+ - digital_correlate_access_code_bb
+ - digital_simple_framer
+ - digital_simple_correlator
diff --git a/gr-digital/grc/digital_additive_scrambler_bb.block.yml b/gr-digital/grc/digital_additive_scrambler_bb.block.yml
new file mode 100644
index 0000000000..d447a2822d
--- /dev/null
+++ b/gr-digital/grc/digital_additive_scrambler_bb.block.yml
@@ -0,0 +1,43 @@
+id: digital_additive_scrambler_bb
+label: Additive Scrambler
+
+parameters:
+- id: mask
+ label: Mask
+ dtype: hex
+ default: '0x8A'
+- id: seed
+ label: Seed
+ dtype: hex
+ default: '0x7F'
+- id: len
+ label: Length
+ dtype: int
+ default: '7'
+- id: count
+ label: Count
+ dtype: int
+ default: '0'
+- id: bits_per_byte
+ label: Bits per byte
+ dtype: int
+ default: '1'
+- id: reset_tag_key
+ label: Reset tag key
+ dtype: string
+ default: '""'
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.additive_scrambler_bb(${mask}, ${seed}, ${len}, count=${count},
+ bits_per_byte=${bits_per_byte}, reset_tag_key=${reset_tag_key})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_additive_scrambler_bb.xml b/gr-digital/grc/digital_additive_scrambler_bb.xml
deleted file mode 100644
index 2bb06e48a3..0000000000
--- a/gr-digital/grc/digital_additive_scrambler_bb.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-## Additive Scrambler
-###################################################
- -->
-<block>
- <name>Additive Scrambler</name>
- <key>digital_additive_scrambler_bb</key>
- <import>from gnuradio import digital</import>
- <make>digital.additive_scrambler_bb($mask, $seed, $len, count=$count, bits_per_byte=$bits_per_byte, reset_tag_key=$reset_tag_key)</make>
- <param>
- <name>Mask</name>
- <key>mask</key>
- <value>0x8A</value>
- <type>hex</type>
- </param>
- <param>
- <name>Seed</name>
- <key>seed</key>
- <value>0x7F</value>
- <type>hex</type>
- </param>
- <param>
- <name>Length</name>
- <key>len</key>
- <value>7</value>
- <type>int</type>
- </param>
- <param>
- <name>Count</name>
- <key>count</key>
- <value>0</value>
- <type>int</type>
- </param>
- <param>
- <name>Bits per byte</name>
- <key>bits_per_byte</key>
- <value>1</value>
- <type>int</type>
- </param>
- <param>
- <name>Reset tag key</name>
- <key>reset_tag_key</key>
- <value>""</value>
- <type>string</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_binary_slicer_fb.block.yml b/gr-digital/grc/digital_binary_slicer_fb.block.yml
new file mode 100644
index 0000000000..143c97c0ed
--- /dev/null
+++ b/gr-digital/grc/digital_binary_slicer_fb.block.yml
@@ -0,0 +1,16 @@
+id: digital_binary_slicer_fb
+label: Binary Slicer
+
+inputs:
+- domain: stream
+ dtype: float
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.binary_slicer_fb()
+
+file_format: 1
diff --git a/gr-digital/grc/digital_binary_slicer_fb.xml b/gr-digital/grc/digital_binary_slicer_fb.xml
deleted file mode 100644
index 3187d13f92..0000000000
--- a/gr-digital/grc/digital_binary_slicer_fb.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Binary Slicer
-###################################################
- -->
-<block>
- <name>Binary Slicer</name>
- <key>digital_binary_slicer_fb</key>
- <import>from gnuradio import digital</import>
- <make>digital.binary_slicer_fb()</make>
- <sink>
- <name>in</name>
- <type>float</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_block_tree.xml b/gr-digital/grc/digital_block_tree.xml
deleted file mode 100644
index 10346cbcd0..0000000000
--- a/gr-digital/grc/digital_block_tree.xml
+++ /dev/null
@@ -1,134 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Copyright (C) 2011-2017 Free Software Foundation, Inc.
-
- This file is part of GNU Radio
-
- GNU Radio is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GNU Radio is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Radio; see the file COPYING. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street,
- Boston, MA 02110-1301, USA.
--->
-
-<!--
-###################################################
-##Block Tree for GR Digital blocks.
-###################################################
- -->
-<cat>
- <name>[Core]</name>
- <cat>
- <name>Coding</name>
- <block>digital_additive_scrambler_bb</block>
- <block>digital_descrambler_bb</block>
- <block>digital_scrambler_bb</block>
- </cat>
- <cat>
- <name>Equalizers</name>
- <block>digital_cma_equalizer_cc</block>
- <block>digital_lms_dd_equalizer_cc</block>
- <block>digital_kurtotic_equalizer_cc</block>
- </cat>
- <cat>
- <name>Measurement Tools</name>
- <block>digital_mpsk_snr_est_cc</block>
- <block>digital_probe_density_b</block>
- <block>digital_probe_mpsk_snr_est_c</block>
- </cat>
- <cat>
- <name>Modulators</name>
- <block>digital_cpmmod_bc</block>
- <block>digital_gfsk_mod</block>
- <block>digital_gfsk_demod</block>
- <block>digital_gmskmod_bc</block>
- <block>digital_gmsk_mod</block>
- <block>digital_gmsk_demod</block>
- <block>digital_constellation_modulator</block>
- <block>digital_constellation_receiver_cb</block>
- <block>variable_constellation</block>
- <block>variable_constellation_rect</block>
- <block>variable_modulate_vector</block>
- </cat>
- <cat>
- <name>Packet Operators</name>
- <block>digital_correlate_access_code_tag_bb</block>
- <block>digital_correlate_access_code_xx_ts</block>
- <block>digital_crc32_bb</block>
- <block>digital_crc32_async_bb</block>
- <block>digital_framer_sink_1</block>
- <block>variable_header_format_default</block>
- <block>digital_protocol_formatter_async</block>
- <block>digital_protocol_formatter_bb</block>
- <block>digital_protocol_parser_b</block>
- <block>digital_header_payload_demux</block>
- <block>digital_packet_headergenerator_bb</block>
- <block>digital_packet_headergenerator_bb_default</block>
- <block>digital_packet_headerparser_b</block>
- <block>digital_packet_headerparser_b_default</block>
- <block>digital_packet_sink</block>
- <block>digital_hdlc_framer_pb</block>
- <block>digital_hdlc_deframer_bp</block>
- <block>digital_simple_framer</block>
- <block>digital_simple_correlator</block>
- </cat>
- <cat>
- <name>OFDM</name>
- <block>digital_ofdm_mod</block>
- <block>digital_ofdm_demod</block>
- <block>digital_ofdm_carrier_allocator_cvc</block>
- <block>digital_ofdm_chanest_vcvc</block>
- <block>digital_ofdm_cyclic_prefixer</block>
- <block>digital_ofdm_frame_acquisition</block>
- <block>digital_ofdm_frame_equalizer_vcvc</block>
- <block>digital_ofdm_frame_sink</block>
- <block>digital_ofdm_insert_preamble</block>
- <block>digital_ofdm_rx</block>
- <block>digital_ofdm_sampler</block>
- <block>digital_ofdm_serializer_vcc</block>
- <block>digital_ofdm_sync_pn</block>
- <block>digital_ofdm_sync_sc_cfb</block>
- <block>digital_ofdm_tx</block>
- </cat>
- <cat>
- <name>Symbol Coding</name>
- <block>digital_binary_slicer_fb</block>
- <block>digital_chunks_to_symbols_xx</block>
- <block>digital_constellation_decoder_cb</block>
- <block>digital_constellation_receiver_cb</block>
- <block>digital_constellation_soft_decoder_cf</block>
- <block>digital_diff_decoder_bb</block>
- <block>digital_diff_encoder_bb</block>
- <block>digital_diff_phasor_cc</block>
- <block>digital_map_bb</block>
- </cat>
- <cat>
- <name>Synchronizers</name>
- <block>digital_clock_recovery_mm_xx</block>
- <block>digital_costas_loop_cc</block>
- <block>digital_fll_band_edge_cc</block>
- <block>digital_pfb_clock_sync_xxx</block>
- <block>digital_pn_correlator_cc</block>
- <block>digital_symbol_sync_xx</block>
- <block>digital_corr_est_cc</block>
- </cat>
- <cat>
- <name>Waveform Generators</name>
- <block>digital_glfsr_source_x</block>
- </cat>
- <cat>
- <name>Deprecated</name>
- <block>digital_correlate_access_code_bb</block>
- <block>digital_simple_framer</block>
- <block>digital_simple_correlator</block>
- </cat>
-</cat>
diff --git a/gr-digital/grc/digital_burst_shaper.block.yml b/gr-digital/grc/digital_burst_shaper.block.yml
new file mode 100644
index 0000000000..a6d7defb4b
--- /dev/null
+++ b/gr-digital/grc/digital_burst_shaper.block.yml
@@ -0,0 +1,50 @@
+id: digital_burst_shaper_xx
+label: Burst Shaper
+category: '[Core]/Packet Operators'
+
+parameters:
+- id: type
+ label: Type
+ dtype: enum
+ options: [float, complex]
+ option_attributes:
+ fcn: [ff, cc]
+ taps: [float_vector, complex_vector]
+ hide: part
+- id: window
+ label: Window Taps
+ dtype: ${ type.taps }
+ default: ([])
+- id: pre_padding
+ label: Pre-padding Length
+ dtype: int
+ default: '0'
+- id: post_padding
+ label: Post-padding Length
+ dtype: int
+ default: '0'
+- id: insert_phasing
+ label: Insert phasing symbols
+ dtype: enum
+ default: 'False'
+ options: ['False', 'True']
+ option_labels: ['No', 'Yes']
+- id: length_tag_name
+ label: Length Tag Name
+ dtype: string
+ default: '"packet_len"'
+
+inputs:
+- domain: stream
+ dtype: ${ type }
+
+outputs:
+- domain: stream
+ dtype: ${ type }
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.burst_shaper_${type.fcn}(${window}, ${pre_padding}, ${post_padding},
+ ${insert_phasing}, ${length_tag_name})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_burst_shaper.xml b/gr-digital/grc/digital_burst_shaper.xml
deleted file mode 100644
index 95e1bcbc77..0000000000
--- a/gr-digital/grc/digital_burst_shaper.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0"?>
-<block>
- <name>Burst Shaper</name>
- <key>digital_burst_shaper_xx</key>
- <category>[Core]/Packet Operators</category>
- <import>from gnuradio import digital</import>
- <make>digital.burst_shaper_$(type.fcn)($window, $pre_padding, $post_padding, $insert_phasing, $length_tag_name)</make>
- <param>
- <name>Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Float</name>
- <key>float</key>
- <opt>fcn:ff</opt>
- <opt>taps:float_vector</opt>
- </option>
- <option>
- <name>Complex</name>
- <key>complex</key>
- <opt>fcn:cc</opt>
- <opt>taps:complex_vector</opt>
- </option>
- </param>
- <param>
- <name>Window Taps</name>
- <key>window</key>
- <value>([])</value>
- <type>$(type.taps)</type>
- </param>
- <param>
- <name>Pre-padding Length</name>
- <key>pre_padding</key>
- <value>0</value>
- <type>int</type>
- </param>
- <param>
- <name>Post-padding Length</name>
- <key>post_padding</key>
- <value>0</value>
- <type>int</type>
- </param>
- <param>
- <name>Insert phasing symbols</name>
- <key>insert_phasing</key>
- <value>False</value>
- <type>enum</type>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- </param>
- <param>
- <name>Length Tag Name</name>
- <key>length_tag_name</key>
- <value>"packet_len"</value>
- <type>string</type>
- </param>
- <sink>
- <name>in</name>
- <type>$type</type>
- </sink>
- <source>
- <name>out</name>
- <type>$type</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_chunks_to_symbols.block.yml b/gr-digital/grc/digital_chunks_to_symbols.block.yml
new file mode 100644
index 0000000000..35b5ee94c6
--- /dev/null
+++ b/gr-digital/grc/digital_chunks_to_symbols.block.yml
@@ -0,0 +1,53 @@
+id: digital_chunks_to_symbols_xx
+label: Chunks to Symbols
+
+parameters:
+- id: in_type
+ label: Input Type
+ dtype: enum
+ options: [int, short, byte]
+ option_attributes:
+ fcn: [i, s, b]
+ hide: part
+- id: out_type
+ label: Output Type
+ dtype: enum
+ options: [complex, float]
+ option_attributes:
+ fcn: [c, f]
+ table: [complex_vector, real_vector]
+ hide: part
+- id: symbol_table
+ label: Symbol Table
+ dtype: ${ out_type.table }
+- id: dimension
+ label: Dimension
+ dtype: int
+ default: '2'
+- id: num_ports
+ label: Num Ports
+ dtype: int
+ default: '1'
+ hide: part
+
+inputs:
+- domain: stream
+ dtype: ${ in_type }
+ multiplicity: ${ num_ports }
+
+outputs:
+- domain: stream
+ dtype: ${ out_type }
+ multiplicity: ${ num_ports }
+
+asserts:
+- ${ num_ports > 0 }
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.chunks_to_symbols_${in_type.fcn}${out_type.fcn}(${symbol_table},
+ ${dimension})
+ callbacks:
+ - set_symbol_table(${symbol_table})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_chunks_to_symbols.xml b/gr-digital/grc/digital_chunks_to_symbols.xml
deleted file mode 100644
index 9c6f952ec0..0000000000
--- a/gr-digital/grc/digital_chunks_to_symbols.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Chunks to Symbols
-###################################################
- -->
-<block>
- <name>Chunks to Symbols</name>
- <key>digital_chunks_to_symbols_xx</key>
- <import>from gnuradio import digital</import>
- <make>digital.chunks_to_symbols_$(in_type.fcn)$(out_type.fcn)($symbol_table, $dimension)</make>
- <callback>set_symbol_table($symbol_table)</callback>
- <param>
- <name>Input Type</name>
- <key>in_type</key>
- <type>enum</type>
- <option>
- <name>Int</name>
- <key>int</key>
- <opt>fcn:i</opt>
- </option>
- <option>
- <name>Short</name>
- <key>short</key>
- <opt>fcn:s</opt>
- </option>
- <option>
- <name>Byte</name>
- <key>byte</key>
- <opt>fcn:b</opt>
- </option>
- </param>
- <param>
- <name>Output Type</name>
- <key>out_type</key>
- <type>enum</type>
- <option>
- <name>Complex</name>
- <key>complex</key>
- <opt>fcn:c</opt>
- <opt>table:complex_vector</opt>
- </option>
- <option>
- <name>Float</name>
- <key>float</key>
- <opt>fcn:f</opt>
- <opt>table:real_vector</opt>
- </option>
- </param>
- <param>
- <name>Symbol Table</name>
- <key>symbol_table</key>
- <type>$out_type.table</type>
- </param>
- <param>
- <name>Dimension</name>
- <key>dimension</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>Num Ports</name>
- <key>num_ports</key>
- <value>1</value>
- <type>int</type>
- </param>
- <check>$num_ports &gt; 0</check>
- <sink>
- <name>in</name>
- <type>$in_type</type>
- <nports>$num_ports</nports>
- </sink>
- <source>
- <name>out</name>
- <type>$out_type</type>
- <nports>$num_ports</nports>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_clock_recovery_mm_xx.block.yml b/gr-digital/grc/digital_clock_recovery_mm_xx.block.yml
new file mode 100644
index 0000000000..f4b8a9439d
--- /dev/null
+++ b/gr-digital/grc/digital_clock_recovery_mm_xx.block.yml
@@ -0,0 +1,51 @@
+id: digital_clock_recovery_mm_xx
+label: Clock Recovery MM
+
+parameters:
+- id: type
+ label: Type
+ dtype: enum
+ options: [complex, float]
+ option_attributes:
+ fcn: [cc, ff]
+ hide: part
+- id: omega
+ label: Omega
+ dtype: real
+ default: samp_per_sym*(1+0.0)
+- id: gain_omega
+ label: Gain Omega
+ dtype: real
+ default: 0.25*0.175*0.175
+- id: mu
+ label: Mu
+ dtype: real
+ default: '0.5'
+- id: gain_mu
+ label: Gain Mu
+ dtype: real
+ default: '0.175'
+- id: omega_relative_limit
+ label: Omega Relative Limit
+ dtype: real
+ default: '0.005'
+
+inputs:
+- domain: stream
+ dtype: ${ type }
+
+outputs:
+- domain: stream
+ dtype: ${ type }
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.clock_recovery_mm_${type.fcn}(${omega}, ${gain_omega}, ${mu}, ${gain_mu},
+ ${omega_relative_limit})
+ callbacks:
+ - set_omega(${omega})
+ - set_gain_omega(${gain_omega})
+ - set_mu(${mu})
+ - set_gain_mu(${gain_mu})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_clock_recovery_mm_xx.xml b/gr-digital/grc/digital_clock_recovery_mm_xx.xml
deleted file mode 100644
index a0857686be..0000000000
--- a/gr-digital/grc/digital_clock_recovery_mm_xx.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Clock Recovery MM
-###################################################
- -->
-<block>
- <name>Clock Recovery MM</name>
- <key>digital_clock_recovery_mm_xx</key>
- <import>from gnuradio import digital</import>
- <make>digital.clock_recovery_mm_$(type.fcn)($omega, $gain_omega, $mu, $gain_mu, $omega_relative_limit)</make>
- <callback>set_omega($omega)</callback>
- <callback>set_gain_omega($gain_omega)</callback>
- <callback>set_mu($mu)</callback>
- <callback>set_gain_mu($gain_mu)</callback>
- <param>
- <name>Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Complex</name>
- <key>complex</key>
- <opt>fcn:cc</opt>
- </option>
- <option>
- <name>Float</name>
- <key>float</key>
- <opt>fcn:ff</opt>
- </option>
- </param>
- <param>
- <name>Omega</name>
- <key>omega</key>
- <value>samp_per_sym*(1+0.0)</value>
- <type>real</type>
- </param>
- <param>
- <name>Gain Omega</name>
- <key>gain_omega</key>
- <value>0.25*0.175*0.175</value>
- <type>real</type>
- </param>
- <param>
- <name>Mu</name>
- <key>mu</key>
- <value>0.5</value>
- <type>real</type>
- </param>
- <param>
- <name>Gain Mu</name>
- <key>gain_mu</key>
- <value>0.175</value>
- <type>real</type>
- </param>
- <param>
- <name>Omega Relative Limit</name>
- <key>omega_relative_limit</key>
- <value>0.005</value>
- <type>real</type>
- </param>
- <sink>
- <name>in</name>
- <type>$type</type>
- </sink>
- <source>
- <name>out</name>
- <type>$type</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_cma_equalizer_cc.block.yml b/gr-digital/grc/digital_cma_equalizer_cc.block.yml
new file mode 100644
index 0000000000..64e83390d5
--- /dev/null
+++ b/gr-digital/grc/digital_cma_equalizer_cc.block.yml
@@ -0,0 +1,33 @@
+id: digital_cma_equalizer_cc
+label: CMA Equalizer
+
+parameters:
+- id: num_taps
+ label: Num. Taps
+ dtype: int
+- id: modulus
+ label: Modulus
+ dtype: real
+- id: mu
+ label: Gain
+ dtype: real
+- id: sps
+ label: Samples per Symbol
+ dtype: int
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: stream
+ dtype: complex
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.cma_equalizer_cc(${num_taps}, ${modulus}, ${mu}, ${sps})
+ callbacks:
+ - set_gain(${mu})
+ - set_modulus(${modulus})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_cma_equalizer_cc.xml b/gr-digital/grc/digital_cma_equalizer_cc.xml
deleted file mode 100644
index 118c18e294..0000000000
--- a/gr-digital/grc/digital_cma_equalizer_cc.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-## CMA Equalizer
-###################################################
- -->
-<block>
- <name>CMA Equalizer</name>
- <key>digital_cma_equalizer_cc</key>
- <import>from gnuradio import digital</import>
- <make>digital.cma_equalizer_cc($num_taps, $modulus, $mu, $sps)</make>
- <callback>set_gain($mu)</callback>
- <callback>set_modulus($modulus)</callback>
- <param>
- <name>Num. Taps</name>
- <key>num_taps</key>
- <type>int</type>
- </param>
- <param>
- <name>Modulus</name>
- <key>modulus</key>
- <type>real</type>
- </param>
- <param>
- <name>Gain</name>
- <key>mu</key>
- <type>real</type>
- </param>
- <param>
- <name>Samples per Symbol</name>
- <key>sps</key>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_constellation.block.yml b/gr-digital/grc/digital_constellation.block.yml
new file mode 100644
index 0000000000..b604140888
--- /dev/null
+++ b/gr-digital/grc/digital_constellation.block.yml
@@ -0,0 +1,72 @@
+id: variable_constellation
+label: Constellation Object
+category: Modulators
+
+parameters:
+- id: type
+ label: Constellation Type
+ dtype: enum
+ options: [calcdist, bpsk, qpsk, dqpsk, 8psk, 16qam]
+ option_labels: [Variable Constellation, BPSK, QPSK, DQPSK, 8PSK, 16QAM]
+- id: sym_map
+ label: Symbol Map
+ dtype: int_vector
+ default: '[0, 1, 3, 2]'
+ hide: ${ ( 'none' if str(type) == "calcdist" else 'all') }
+- id: const_points
+ label: Constellation Points
+ dtype: complex_vector
+ default: '[-1-1j, -1+1j, 1+1j, 1-1j]'
+ hide: ${ ( 'none' if str(type) == "calcdist" else 'all') }
+- id: rot_sym
+ label: Rotational Symmetry
+ dtype: int
+ default: '4'
+ hide: ${ ( 'none' if str(type) == "calcdist" else 'all') }
+- id: dims
+ label: Dimensionality
+ dtype: int
+ default: '1'
+ hide: ${ ( 'none' if str(type) == "calcdist" else 'all') }
+- id: precision
+ label: Soft Decisions Precision
+ dtype: int
+ default: '8'
+ hide: part
+- id: soft_dec_lut
+ label: Soft Decisions LUT
+ dtype: raw
+ default: None
+ hide: ${ ('part' if str(soft_dec_lut) == 'None' else 'none') }
+value: ${ digital.constellation_calcdist(const_points, sym_map, rot_sym, dims) if (str(type) == "calcdist") else digital.constellation_type}
+
+templates:
+ imports: from gnuradio import digital
+ var_make: '
+
+ % if str(type) == "calcdist":
+
+ self.${id} = ${id} = digital.constellation_calcdist(${const_points}, ${sym_map},
+ ${rot_sym}, ${dims}).base()
+
+ % else:
+
+ self.${id} = ${id} = digital.constellation_${type}().base()
+
+ % endif
+
+
+ % if str(soft_dec_lut).lower() == ''"auto"'' or str(soft_dec_lut).lower()
+ == "''auto''":
+
+ self.${id}.gen_soft_dec_lut(${precision})
+
+ % elif str(soft_dec_lut) != ''None'':
+
+ self.${id}.set_soft_dec_lut(${soft_dec_lut}, ${precision})
+
+ % endif
+
+ '
+
+file_format: 1
diff --git a/gr-digital/grc/digital_constellation.xml b/gr-digital/grc/digital_constellation.xml
deleted file mode 100644
index ef5364d248..0000000000
--- a/gr-digital/grc/digital_constellation.xml
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-## Create a Constellation Object
-###################################################
- -->
-<block>
- <name>Constellation Object</name>
- <key>variable_constellation</key>
- <category>Modulators</category>
- <import>from gnuradio import digital</import>
- <var_make>
-#if str($type) == "calcdist"
-self.$(id) = $(id) = digital.constellation_calcdist($const_points, $sym_map, $rot_sym, $dims).base()
-#else
-self.$(id) = $(id) = digital.constellation_$(type)().base()
-#end if
-
-#if str($soft_dec_lut).lower() == '"auto"' or str($soft_dec_lut).lower() == "'auto'"
-self.$(id).gen_soft_dec_lut($precision)
-#else if str($soft_dec_lut) != 'None'
-self.$(id).set_soft_dec_lut($soft_dec_lut, $precision)
-#end if
-</var_make>
-
-<var_value>
-#if str($type) == "calcdist"
-digital.constellation_calcdist($const_points, $sym_map, $rot_sym, $dims)
-#else
-digital.constellation_$(type)()
-#end if
-</var_value>
-
- <make></make>
- <!--<callback></callback>-->
-
- <param>
- <name>Constellation Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Variable Constellation</name>
- <key>calcdist</key>
- </option>
- <option>
- <name>BPSK</name>
- <key>bpsk</key>
- </option>
- <option>
- <name>QPSK</name>
- <key>qpsk</key>
- </option>
- <option>
- <name>DQPSK</name>
- <key>dqpsk</key>
- </option>
- <option>
- <name>8PSK</name>
- <key>8psk</key>
- </option>
- <option>
- <name>16QAM</name>
- <key>16qam</key>
- </option>
-
- </param>
- <param>
- <name>Symbol Map</name>
- <key>sym_map</key>
- <value>[0, 1, 3, 2]</value>
- <type>int_vector</type>
- <hide> #if str($type) == "calcdist" then 'none' else 'all' #</hide>
- </param>
-
- <param>
- <name>Constellation Points</name>
- <key>const_points</key>
- <value>[-1-1j, -1+1j, 1+1j, 1-1j]</value>
- <type>complex_vector</type>
- <hide> #if str($type) == "calcdist" then 'none' else 'all' #</hide>
- </param>
-
- <param>
- <name>Rotational Symmetry</name>
- <key>rot_sym</key>
- <value>4</value>
- <type>int</type>
- <hide> #if str($type) == "calcdist" then 'none' else 'all' #</hide>
- </param>
-
- <param>
- <name>Dimensionality</name>
- <key>dims</key>
- <value>1</value>
- <type>int</type>
- <hide> #if str($type) == "calcdist" then 'none' else 'all' #</hide>
- </param>
- <param>
- <name>Soft Decisions Precision</name>
- <key>precision</key>
- <value>8</value>
- <type>int</type>
- <hide>part</hide>
- </param>
-
- <param>
- <name>Soft Decisions LUT</name>
- <key>soft_dec_lut</key>
- <value>None</value>
- <type>raw</type>
- <hide>#if str($soft_dec_lut) == 'None' then 'part' else 'none'#</hide>
- </param>
-</block>
diff --git a/gr-digital/grc/digital_constellation_decoder_cb.block.yml b/gr-digital/grc/digital_constellation_decoder_cb.block.yml
new file mode 100644
index 0000000000..59d312d89a
--- /dev/null
+++ b/gr-digital/grc/digital_constellation_decoder_cb.block.yml
@@ -0,0 +1,21 @@
+id: digital_constellation_decoder_cb
+label: Constellation Decoder
+
+parameters:
+- id: constellation
+ label: Constellation Object
+ dtype: raw
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.constellation_decoder_cb(${constellation})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_constellation_decoder_cb.xml b/gr-digital/grc/digital_constellation_decoder_cb.xml
deleted file mode 100644
index c7353e2888..0000000000
--- a/gr-digital/grc/digital_constellation_decoder_cb.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Constellation Decoder
-###################################################
- -->
-<block>
- <name>Constellation Decoder</name>
- <key>digital_constellation_decoder_cb</key>
- <import>from gnuradio import digital</import>
- <make>digital.constellation_decoder_cb($constellation)</make>
- <param>
- <name>Constellation Object</name>
- <key>constellation</key>
- <type>raw</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_constellation_modulator.block.yml b/gr-digital/grc/digital_constellation_modulator.block.yml
new file mode 100644
index 0000000000..8be84449ad
--- /dev/null
+++ b/gr-digital/grc/digital_constellation_modulator.block.yml
@@ -0,0 +1,58 @@
+id: digital_constellation_modulator
+label: Constellation Modulator
+
+parameters:
+- id: constellation
+ label: Constellation
+ dtype: raw
+- id: differential
+ label: Differential Encoding
+ dtype: bool
+ default: 'True'
+ options: ['True', 'False']
+ option_labels: ['Yes', 'No']
+- id: samples_per_symbol
+ label: Samples/Symbol
+ dtype: int
+ default: '2'
+- id: excess_bw
+ label: Excess BW
+ dtype: real
+ default: '0.35'
+- id: verbose
+ label: Verbose
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(verbose) == 'False' else 'none') }
+- id: log
+ label: Log
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(log) == 'False' else 'none') }
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: complex
+
+templates:
+ imports: from gnuradio import digital
+ make: |-
+ digital.generic_mod(
+ constellation=${constellation},
+ differential=${differential},
+ samples_per_symbol=${samples_per_symbol},
+ pre_diff_code=True,
+ excess_bw=${excess_bw},
+ verbose=${verbose},
+ log=${log},
+ )
+
+file_format: 1
diff --git a/gr-digital/grc/digital_constellation_modulator.xml b/gr-digital/grc/digital_constellation_modulator.xml
deleted file mode 100644
index 9905197f93..0000000000
--- a/gr-digital/grc/digital_constellation_modulator.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- Copyright 2013 Free Software Foundation, Inc.
-
- This file is part of GNU Radio
-
- GNU Radio is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GNU Radio is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Radio; see the file COPYING. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street,
- Boston, MA 02110-1301, USA.
--->
-
-<!--
-###################################################
-## Modulates any given constellation object
-###################################################
- -->
-<block>
- <name>Constellation Modulator</name>
- <key>digital_constellation_modulator</key>
- <import>from gnuradio import digital</import>
- <make>digital.generic_mod(
- constellation=$constellation,
- differential=$differential,
- samples_per_symbol=$samples_per_symbol,
- pre_diff_code=True,
- excess_bw=$excess_bw,
- verbose=$verbose,
- log=$log,
- )</make>
- <param>
- <name>Constellation</name>
- <key>constellation</key>
- <type>raw</type>
- </param>
- <param>
- <name>Differential Encoding</name>
- <key>differential</key>
- <value>True</value>
- <type>bool</type>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Samples/Symbol</name>
- <key>samples_per_symbol</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>Excess BW</name>
- <key>excess_bw</key>
- <value>0.35</value>
- <type>real</type>
- </param>
- <param>
- <name>Verbose</name>
- <key>verbose</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Log</name>
- <key>log</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_constellation_receiver_cb.block.yml b/gr-digital/grc/digital_constellation_receiver_cb.block.yml
new file mode 100644
index 0000000000..6221348805
--- /dev/null
+++ b/gr-digital/grc/digital_constellation_receiver_cb.block.yml
@@ -0,0 +1,62 @@
+id: digital_constellation_receiver_cb
+label: Constellation Receiver
+
+parameters:
+- id: constellation
+ label: Constellation Object
+ dtype: raw
+- id: loop_bw
+ label: Loop Bandwidth
+ dtype: real
+- id: fmin
+ label: Minimum Freq Deviation
+ dtype: real
+- id: fmax
+ label: Maximum Freq Deviation
+ dtype: real
+- id: showports
+ label: Show Msg Ports
+ dtype: enum
+ default: 'True'
+ options: ['False', 'True']
+ option_labels: ['Yes', 'No']
+ hide: part
+
+inputs:
+- domain: stream
+ dtype: complex
+- domain: message
+ id: set_constellation
+ optional: true
+ hide: ${ showports }
+- domain: message
+ id: rotate_phase
+ optional: true
+ hide: ${ showports }
+
+outputs:
+- domain: stream
+ dtype: byte
+- label: error
+ domain: stream
+ dtype: float
+ optional: true
+- label: phase
+ domain: stream
+ dtype: float
+ optional: true
+- label: frequency
+ domain: stream
+ dtype: float
+ optional: true
+- label: symbol
+ domain: stream
+ dtype: complex
+ optional: true
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.constellation_receiver_cb(${constellation}, ${loop_bw}, ${fmin},
+ ${fmax})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_constellation_receiver_cb.xml b/gr-digital/grc/digital_constellation_receiver_cb.xml
deleted file mode 100644
index 06155ecae9..0000000000
--- a/gr-digital/grc/digital_constellation_receiver_cb.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Constellation Receiver
-###################################################
- -->
-<block>
- <name>Constellation Receiver</name>
- <key>digital_constellation_receiver_cb</key>
- <import>from gnuradio import digital</import>
- <make>digital.constellation_receiver_cb($constellation, $loop_bw, $fmin, $fmax)</make>
- <param>
- <name>Constellation Object</name>
- <key>constellation</key>
- <type>raw</type>
- </param>
- <param>
- <name>Loop Bandwidth</name>
- <key>loop_bw</key>
- <type>real</type>
- </param>
- <param>
- <name>Minimum Freq Deviation</name>
- <key>fmin</key>
- <type>real</type>
- </param>
- <param>
- <name>Maximum Freq Deviation</name>
- <key>fmax</key>
- <type>real</type>
- </param>
-
- <param>
- <name>Show Msg Ports</name>
- <key>showports</key>
- <value>True</value>
- <type>enum</type>
- <hide>part</hide>
- <option>
- <name>Yes</name>
- <key>False</key>
- </option>
- <option>
- <name>No</name>
- <key>True</key>
- </option>
- </param>
-
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
-
- <sink>
- <name>set_constellation</name>
- <type>message</type>
- <optional>1</optional>
- <hide>$showports</hide>
- </sink>
-
- <sink>
- <name>rotate_phase</name>
- <type>message</type>
- <optional>1</optional>
- <hide>$showports</hide>
- </sink>
-
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
- <source>
- <name>error</name>
- <type>float</type>
- <optional>1</optional>
- </source>
- <source>
- <name>phase</name>
- <type>float</type>
- <optional>1</optional>
- </source>
- <source>
- <name>frequency</name>
- <type>float</type>
- <optional>1</optional>
- </source>
- <source>
- <name>symbol</name>
- <type>complex</type>
- <optional>1</optional>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_constellation_rect.block.yml b/gr-digital/grc/digital_constellation_rect.block.yml
new file mode 100644
index 0000000000..e9e58001c2
--- /dev/null
+++ b/gr-digital/grc/digital_constellation_rect.block.yml
@@ -0,0 +1,65 @@
+id: variable_constellation_rect
+label: Constellation Rect. Object
+category: Modulators
+
+parameters:
+- id: sym_map
+ label: Symbol Map
+ dtype: int_vector
+ default: '[0, 1, 3, 2]'
+- id: const_points
+ label: Constellation Points
+ dtype: complex_vector
+ default: '[-1-1j, -1+1j, 1+1j, 1-1j]'
+- id: rot_sym
+ label: Rotational Symmetry
+ dtype: int
+ default: '4'
+- id: real_sect
+ label: Real Sectors
+ dtype: int
+ default: '2'
+- id: imag_sect
+ label: Imaginary Sectors
+ dtype: int
+ default: '2'
+- id: w_real_sect
+ label: Width Real Sectors
+ dtype: int
+ default: '1'
+- id: w_imag_sect
+ label: Width Imaginary Sectors
+ dtype: int
+ default: '1'
+- id: precision
+ label: Soft bits precision
+ dtype: int
+ default: '8'
+ hide: part
+- id: soft_dec_lut
+ label: Soft Decisions LUT
+ dtype: raw
+ default: None
+ hide: ${ ('part' if str(soft_dec_lut) == 'None' else 'none') }
+value: ${ digital.constellation_rect(const_points, sym_map, rot_sym, real_sect, imag_sect,
+ w_real_sect, w_imag_sect) }
+
+templates:
+ imports: from gnuradio import digital
+ var_make: 'self.${id} = ${id} = digital.constellation_rect(${const_points}, ${sym_map},
+ ${rot_sym}, ${real_sect}, ${imag_sect}, ${w_real_sect}, ${w_imag_sect}).base()
+
+ % if str(soft_dec_lut).lower() == ''"auto"'' or str(soft_dec_lut).lower()
+ == "''auto''":
+
+ self.${id}.gen_soft_dec_lut(${precision})
+
+ % elif str(soft_dec_lut) != ''None'':
+
+ self.${id}.set_soft_dec_lut(${soft_dec_lut}, ${precision})
+
+ % endif
+
+ '
+
+file_format: 1
diff --git a/gr-digital/grc/digital_constellation_rect.xml b/gr-digital/grc/digital_constellation_rect.xml
deleted file mode 100644
index 9e50fe84b7..0000000000
--- a/gr-digital/grc/digital_constellation_rect.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-## Create a Rectangular Constellation Object
-###################################################
- -->
-<block>
- <name>Constellation Rect. Object</name>
- <key>variable_constellation_rect</key>
- <category>Modulators</category>
- <import>from gnuradio import digital</import>
- <var_make>self.$(id) = $(id) = digital.constellation_rect($const_points, $sym_map, $rot_sym, $real_sect, $imag_sect, $w_real_sect, $w_imag_sect).base()
-#if str($soft_dec_lut).lower() == '"auto"' or str($soft_dec_lut).lower() == "'auto'"
-self.$(id).gen_soft_dec_lut($precision)
-#else if str($soft_dec_lut) != 'None'
-self.$(id).set_soft_dec_lut($soft_dec_lut, $precision)
-#end if
-</var_make>
-
- <var_value>digital.constellation_rect($const_points, $sym_map, $rot_sym, $real_sect, $imag_sect, $w_real_sect, $w_imag_sect)</var_value>
-
- <make></make>
- <!--<callback>set_softbits($softbits_lut, $precision)</callback>-->
-
- <param>
- <name>Symbol Map</name>
- <key>sym_map</key>
- <value>[0, 1, 3, 2]</value>
- <type>int_vector</type>
- </param>
-
- <param>
- <name>Constellation Points</name>
- <key>const_points</key>
- <value>[-1-1j, -1+1j, 1+1j, 1-1j]</value>
- <type>complex_vector</type>
- </param>
-
- <param>
- <name>Rotational Symmetry</name>
- <key>rot_sym</key>
- <value>4</value>
- <type>int</type>
- </param>
-
- <param>
- <name>Real Sectors</name>
- <key>real_sect</key>
- <value>2</value>
- <type>int</type>
- </param>
-
- <param>
- <name>Imaginary Sectors</name>
- <key>imag_sect</key>
- <value>2</value>
- <type>int</type>
- </param>
-
- <param>
- <name>Width Real Sectors</name>
- <key>w_real_sect</key>
- <value>1</value>
- <type>int</type>
- </param>
-
- <param>
- <name>Width Imaginary Sectors</name>
- <key>w_imag_sect</key>
- <value>1</value>
- <type>int</type>
- </param>
-
- <param>
- <name>Soft bits precision</name>
- <key>precision</key>
- <value>8</value>
- <type>int</type>
- <hide>part</hide>
- </param>
-
- <param>
- <name>Soft Decisions LUT</name>
- <key>soft_dec_lut</key>
- <value>None</value>
- <type>raw</type>
- <hide>#if str($soft_dec_lut) == 'None' then 'part' else 'none'#</hide>
- </param>
-</block>
diff --git a/gr-digital/grc/digital_constellation_soft_decoder_cf.block.yml b/gr-digital/grc/digital_constellation_soft_decoder_cf.block.yml
new file mode 100644
index 0000000000..2b352a7f21
--- /dev/null
+++ b/gr-digital/grc/digital_constellation_soft_decoder_cf.block.yml
@@ -0,0 +1,21 @@
+id: digital_constellation_soft_decoder_cf
+label: Constellation Soft Decoder
+
+parameters:
+- id: constellation
+ label: Constellation Object
+ dtype: raw
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: stream
+ dtype: float
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.constellation_soft_decoder_cf(${constellation})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_constellation_soft_decoder_cf.xml b/gr-digital/grc/digital_constellation_soft_decoder_cf.xml
deleted file mode 100644
index 6b0995acc9..0000000000
--- a/gr-digital/grc/digital_constellation_soft_decoder_cf.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Constellation Decoder, soft bits out
-###################################################
- -->
-<block>
- <name>Constellation Soft Decoder</name>
- <key>digital_constellation_soft_decoder_cf</key>
- <import>from gnuradio import digital</import>
- <make>digital.constellation_soft_decoder_cf($constellation)</make>
- <param>
- <name>Constellation Object</name>
- <key>constellation</key>
- <type>raw</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>float</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_corr_est_cc.block.yml b/gr-digital/grc/digital_corr_est_cc.block.yml
new file mode 100644
index 0000000000..b3a9698d18
--- /dev/null
+++ b/gr-digital/grc/digital_corr_est_cc.block.yml
@@ -0,0 +1,38 @@
+id: digital_corr_est_cc
+label: Correlation Estimator
+
+parameters:
+- id: symbols
+ label: Symbols
+ dtype: complex_vector
+- id: sps
+ label: Samples per Symbol
+ dtype: float
+- id: mark_delay
+ label: Tag marking delay
+ dtype: int
+- id: threshold
+ label: Threshold
+ dtype: float
+ default: '0.9'
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: stream
+ dtype: complex
+- label: corr
+ domain: stream
+ dtype: complex
+ optional: true
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.corr_est_cc(${symbols}, ${sps}, ${mark_delay}, ${threshold})
+ callbacks:
+ - set_mark_delay(${mark_delay})
+ - set_threshold(${threshold})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_corr_est_cc.xml b/gr-digital/grc/digital_corr_est_cc.xml
deleted file mode 100644
index 1a1c449efb..0000000000
--- a/gr-digital/grc/digital_corr_est_cc.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0"?>
-<block>
- <name>Correlation Estimator</name>
- <key>digital_corr_est_cc</key>
- <import>from gnuradio import digital</import>
- <make>digital.corr_est_cc($symbols, $sps, $mark_delay, $threshold)</make>
- <callback>set_mark_delay($mark_delay)</callback>
- <callback>set_threshold($threshold)</callback>
-
- <param>
- <name>Symbols</name>
- <key>symbols</key>
- <type>complex_vector</type>
- </param>
-
- <param>
- <name>Samples per Symbol</name>
- <key>sps</key>
- <type>float</type>
- </param>
-
- <param>
- <name>Tag marking delay</name>
- <key>mark_delay</key>
- <type>int</type>
- </param>
-
- <param>
- <name>Threshold</name>
- <key>threshold</key>
- <value>0.9</value>
- <type>float</type>
- </param>
-
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
-
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-
- <source>
- <name>corr</name>
- <type>complex</type>
- <optional>1</optional>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_correlate_access_code_bb.block.yml b/gr-digital/grc/digital_correlate_access_code_bb.block.yml
new file mode 100644
index 0000000000..57394668b6
--- /dev/null
+++ b/gr-digital/grc/digital_correlate_access_code_bb.block.yml
@@ -0,0 +1,25 @@
+id: digital_correlate_access_code_bb
+label: Correlate Access Code
+
+parameters:
+- id: access_code
+ label: Access Code
+ dtype: string
+ default: '101010'
+- id: threshold
+ label: Threshold
+ dtype: int
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.correlate_access_code_bb(${access_code}, ${threshold})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_correlate_access_code_bb.xml b/gr-digital/grc/digital_correlate_access_code_bb.xml
deleted file mode 100644
index 3941834c40..0000000000
--- a/gr-digital/grc/digital_correlate_access_code_bb.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Correlate Access Code
-###################################################
- -->
-<block>
- <name>Correlate Access Code</name>
- <key>digital_correlate_access_code_bb</key>
- <import>from gnuradio import digital</import>
- <make>digital.correlate_access_code_bb($access_code, $threshold)</make>
- <param>
- <name>Access Code</name>
- <key>access_code</key>
- <value>101010</value>
- <type>string</type>
- </param>
- <param>
- <name>Threshold</name>
- <key>threshold</key>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_correlate_access_code_tag_xx.block.yml b/gr-digital/grc/digital_correlate_access_code_tag_xx.block.yml
new file mode 100644
index 0000000000..6cf81129c2
--- /dev/null
+++ b/gr-digital/grc/digital_correlate_access_code_tag_xx.block.yml
@@ -0,0 +1,40 @@
+id: digital_correlate_access_code_tag_xx
+label: Correlate Access Code - Tag
+
+parameters:
+- id: type
+ label: IO Type
+ dtype: enum
+ options: [byte, float]
+ option_attributes:
+ fcn: [bb, ff]
+ hide: part
+- id: access_code
+ label: Access Code
+ dtype: string
+ default: '101010'
+- id: threshold
+ label: Threshold
+ dtype: int
+- id: tagname
+ label: Tag Name
+ dtype: string
+
+inputs:
+- domain: stream
+ dtype: ${ type }
+
+outputs:
+- domain: stream
+ dtype: ${ type }
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.correlate_access_code_tag_${type.fcn}(${access_code}, ${threshold},
+ ${tagname})
+ callbacks:
+ - set_access_code(${access_code})
+ - set_threshold(${threshold})
+ - set_tagname(${tagname})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_correlate_access_code_tag_xx.xml b/gr-digital/grc/digital_correlate_access_code_tag_xx.xml
deleted file mode 100644
index c7c137187f..0000000000
--- a/gr-digital/grc/digital_correlate_access_code_tag_xx.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Correlate Access Code
-###################################################
- -->
-<block>
- <name>Correlate Access Code - Tag</name>
- <key>digital_correlate_access_code_tag_xx</key>
- <import>from gnuradio import digital</import>
- <make>digital.correlate_access_code_tag_$(type.fcn)($access_code, $threshold, $tagname)</make>
- <callback>set_access_code($access_code)</callback>
- <callback>set_threshold($threshold)</callback>
- <callback>set_tagname($tagname)</callback>
-
- <param>
- <name>IO Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Byte</name>
- <key>byte</key>
- <opt>fcn:bb</opt>
- </option>
- <option>
- <name>Float</name>
- <key>float</key>
- <opt>fcn:ff</opt>
- </option>
- </param>
- <param>
- <name>Access Code</name>
- <key>access_code</key>
- <value>101010</value>
- <type>string</type>
- </param>
- <param>
- <name>Threshold</name>
- <key>threshold</key>
- <type>int</type>
- </param>
- <param>
- <name>Tag Name</name>
- <key>tagname</key>
- <type>string</type>
- </param>
- <sink>
- <name>in</name>
- <type>$type</type>
- </sink>
- <source>
- <name>out</name>
- <type>$type</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_correlate_access_code_xx_ts.block.yml b/gr-digital/grc/digital_correlate_access_code_xx_ts.block.yml
new file mode 100644
index 0000000000..d51ba9833d
--- /dev/null
+++ b/gr-digital/grc/digital_correlate_access_code_xx_ts.block.yml
@@ -0,0 +1,37 @@
+id: digital_correlate_access_code_xx_ts
+label: Correlate Access Code - Tag Stream
+
+parameters:
+- id: type
+ label: IO Type
+ dtype: enum
+ options: [float, byte]
+ option_attributes:
+ fcn: [ff, bb]
+ hide: part
+- id: access_code
+ label: Access Code
+ dtype: string
+ default: '101010'
+- id: threshold
+ label: Threshold
+ dtype: int
+- id: tagname
+ label: Tag Name
+ dtype: string
+
+inputs:
+- domain: stream
+ dtype: ${ type }
+
+outputs:
+- domain: stream
+ dtype: ${ type }
+
+templates:
+ imports: from gnuradio import digital
+ make: |-
+ digital.correlate_access_code_${type.fcn}_ts(${access_code},
+ ${threshold}, ${tagname})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_correlate_access_code_xx_ts.xml b/gr-digital/grc/digital_correlate_access_code_xx_ts.xml
deleted file mode 100644
index 467c2c84d9..0000000000
--- a/gr-digital/grc/digital_correlate_access_code_xx_ts.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-## Correlate Access Code - to tag stream
-###################################################
- -->
-<block>
- <name>Correlate Access Code - Tag Stream</name>
- <key>digital_correlate_access_code_xx_ts</key>
- <import>from gnuradio import digital</import>
- <make>digital.correlate_access_code_$(type.fcn)_ts($access_code,
- $threshold, $tagname)</make>
-
- <param>
- <name>IO Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Float</name>
- <key>float</key>
- <opt>fcn:ff</opt>
- </option>
- <option>
- <name>Byte</name>
- <key>byte</key>
- <opt>fcn:bb</opt>
- </option>
- </param>
-
- <param>
- <name>Access Code</name>
- <key>access_code</key>
- <value>101010</value>
- <type>string</type>
- </param>
-
- <param>
- <name>Threshold</name>
- <key>threshold</key>
- <type>int</type>
- </param>
-
- <param>
- <name>Tag Name</name>
- <key>tagname</key>
- <type>string</type>
- </param>
-
- <sink>
- <name>in</name>
- <type>$type</type>
- </sink>
-
- <source>
- <name>out</name>
- <type>$type</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_costas_loop_cc.block.yml b/gr-digital/grc/digital_costas_loop_cc.block.yml
new file mode 100644
index 0000000000..6134774f32
--- /dev/null
+++ b/gr-digital/grc/digital_costas_loop_cc.block.yml
@@ -0,0 +1,48 @@
+id: digital_costas_loop_cc
+label: Costas Loop
+
+parameters:
+- id: w
+ label: Loop Bandwidth
+ dtype: real
+- id: order
+ label: Order
+ dtype: int
+- id: use_snr
+ label: Use SNR
+ dtype: enum
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['Yes', 'No']
+ hide: part
+
+inputs:
+- domain: stream
+ dtype: complex
+- domain: message
+ id: noise
+ optional: true
+
+outputs:
+- domain: stream
+ dtype: complex
+- label: frequency
+ domain: stream
+ dtype: float
+ optional: true
+- label: phase
+ domain: stream
+ dtype: float
+ optional: true
+- label: error
+ domain: stream
+ dtype: float
+ optional: true
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.costas_loop_cc(${w}, ${order}, ${use_snr})
+ callbacks:
+ - set_loop_bandwidth(${w})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_costas_loop_cc.xml b/gr-digital/grc/digital_costas_loop_cc.xml
deleted file mode 100644
index 23e3ca9037..0000000000
--- a/gr-digital/grc/digital_costas_loop_cc.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Costas Loop
-###################################################
- -->
-<block>
- <name>Costas Loop</name>
- <key>digital_costas_loop_cc</key>
- <import>from gnuradio import digital</import>
- <make>digital.costas_loop_cc($w, $order, $use_snr)</make>
- <callback>set_loop_bandwidth($w)</callback>
-
- <param>
- <name>Loop Bandwidth</name>
- <key>w</key>
- <type>real</type>
- </param>
-
- <param>
- <name>Order</name>
- <key>order</key>
- <type>int</type>
- </param>
-
- <param>
- <name>Use SNR</name>
- <key>use_snr</key>
- <value>False</value>
- <type>enum</type>
- <hide>part</hide>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- </param>
-
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
-
- <sink>
- <name>noise</name>
- <type>message</type>
- <optional>1</optional>
- </sink>
-
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-
- <!-- Optional Outputs -->
- <source>
- <name>frequency</name>
- <type>float</type>
- <optional>1</optional>
- </source>
- <source>
- <name>phase</name>
- <type>float</type>
- <optional>1</optional>
- </source>
- <source>
- <name>error</name>
- <type>float</type>
- <optional>1</optional>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_cpmmod_bc.block.yml b/gr-digital/grc/digital_cpmmod_bc.block.yml
new file mode 100644
index 0000000000..1a6435289b
--- /dev/null
+++ b/gr-digital/grc/digital_cpmmod_bc.block.yml
@@ -0,0 +1,40 @@
+id: digital_cpmmod_bc
+label: Continuous Phase Modulation
+
+parameters:
+- id: type
+ label: CPM Type
+ dtype: enum
+ options: [analog.cpm.LREC, analog.cpm.LRC, analog.cpm.LSRC, analog.cpm.TFM, analog.cpm.GAUSSIAN]
+ option_labels: [L-REC (Rectangular phase response), L-RC (Raised Cosine), L-SRC
+ (Spectral raised cosine), TFM (Tamed frequency modulation), Gaussian]
+- id: mod_index
+ label: Modulation Index
+ dtype: real
+ default: '0.5'
+- id: samples_per_symbol
+ label: Samples/Symbol
+ dtype: int
+ default: '4'
+- id: L
+ label: Pulse Duration (Symbols)
+ dtype: int
+ default: '4'
+- id: beta
+ label: Phase Response Parameter (BT or Beta)
+ dtype: real
+ default: '0.3'
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: complex
+
+templates:
+ imports: from gnuradio import gr, digital, analog
+ make: digital.cpmmod_bc(${type}, ${mod_index}, ${samples_per_symbol}, ${L}, ${beta})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_cpmmod_bc.xml b/gr-digital/grc/digital_cpmmod_bc.xml
deleted file mode 100644
index 94231775c9..0000000000
--- a/gr-digital/grc/digital_cpmmod_bc.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-## Continuous Phase Modulation
-###################################################
- -->
-<block>
- <name>Continuous Phase Modulation</name>
- <key>digital_cpmmod_bc</key>
- <import>from gnuradio import gr, digital, analog</import>
- <make>digital.cpmmod_bc($type, $mod_index, $samples_per_symbol, $L, $beta)</make>
- <param>
- <name>CPM Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>L-REC (Rectangular phase response)</name>
- <key>analog.cpm.LREC</key>
- </option>
- <option>
- <name>L-RC (Raised Cosine)</name>
- <key>analog.cpm.LRC</key>
- </option>
- <option>
- <name>L-SRC (Spectral raised cosine)</name>
- <key>analog.cpm.LSRC</key>
- </option>
- <option>
- <name>TFM (Tamed frequency modulation)</name>
- <key>analog.cpm.TFM</key>
- </option>
- <option>
- <name>Gaussian</name>
- <key>analog.cpm.GAUSSIAN</key>
- </option>
- </param>
- <param>
- <name>Modulation Index</name>
- <key>mod_index</key>
- <value>0.5</value>
- <type>real</type>
- </param>
- <param>
- <name>Samples/Symbol</name>
- <key>samples_per_symbol</key>
- <value>4</value>
- <type>int</type>
- </param>
- <param>
- <name>Pulse Duration (Symbols)</name>
- <key>L</key>
- <value>4</value>
- <type>int</type>
- </param>
- <param>
- <name>Phase Response Parameter (BT or Beta)</name>
- <key>beta</key>
- <value>0.3</value>
- <type>real</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_crc32_async_bb.block.yml b/gr-digital/grc/digital_crc32_async_bb.block.yml
new file mode 100644
index 0000000000..19b6732217
--- /dev/null
+++ b/gr-digital/grc/digital_crc32_async_bb.block.yml
@@ -0,0 +1,25 @@
+id: digital_crc32_async_bb
+label: Async CRC32
+
+parameters:
+- id: check
+ label: Mode
+ dtype: enum
+ options: ['False', 'True']
+ option_labels: [Generate CRC, Check CRC]
+
+inputs:
+- domain: message
+ id: in
+ optional: true
+
+outputs:
+- domain: message
+ id: out
+ optional: true
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.crc32_async_bb(${check})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_crc32_async_bb.xml b/gr-digital/grc/digital_crc32_async_bb.xml
deleted file mode 100644
index 84c60e60ab..0000000000
--- a/gr-digital/grc/digital_crc32_async_bb.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<block>
- <name>Async CRC32</name>
- <key>digital_crc32_async_bb</key>
- <import>from gnuradio import digital</import>
- <make>digital.crc32_async_bb($check)</make>
-
- <param>
- <name>Mode</name>
- <key>check</key>
- <type>enum</type>
- <option>
- <name>Generate CRC</name>
- <key>False</key>
- </option>
- <option>
- <name>Check CRC</name>
- <key>True</key>
- </option>
- </param>
-
- <sink>
- <name>in</name>
- <type>message</type>
- <optional>1</optional>
- </sink>
-
- <source>
- <name>out</name>
- <type>message</type>
- <optional>1</optional>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_crc32_bb.block.yml b/gr-digital/grc/digital_crc32_bb.block.yml
new file mode 100644
index 0000000000..9e88a63f74
--- /dev/null
+++ b/gr-digital/grc/digital_crc32_bb.block.yml
@@ -0,0 +1,33 @@
+id: digital_crc32_bb
+label: Stream CRC32
+
+parameters:
+- id: check
+ label: Mode
+ dtype: enum
+ options: ['False', 'True']
+ option_labels: [Generate CRC, Check CRC]
+- id: lengthtagname
+ label: Length tag name
+ dtype: string
+ default: '"packet_len"'
+- id: packed
+ label: Packed
+ dtype: bool
+ default: 'True'
+ options: ['True', 'False']
+ option_labels: ['Yes', 'No']
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.crc32_bb(${check}, ${lengthtagname}, ${packed})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_crc32_bb.xml b/gr-digital/grc/digital_crc32_bb.xml
deleted file mode 100644
index 2fc6c248d3..0000000000
--- a/gr-digital/grc/digital_crc32_bb.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<block>
- <name>Stream CRC32</name>
- <key>digital_crc32_bb</key>
- <import>from gnuradio import digital</import>
- <make>digital.crc32_bb($check, $lengthtagname, $packed)</make>
- <param>
- <name>Mode</name>
- <key>check</key>
- <type>enum</type>
- <option>
- <name>Generate CRC</name>
- <key>False</key>
- </option>
- <option>
- <name>Check CRC</name>
- <key>True</key>
- </option>
- </param>
- <param>
- <name>Length tag name</name>
- <key>lengthtagname</key>
- <value>"packet_len"</value>
- <type>string</type>
- </param>
- <param>
- <name>Packed</name>
- <key>packed</key>
- <value>True</value>
- <type>bool</type>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_descrambler_bb.block.yml b/gr-digital/grc/digital_descrambler_bb.block.yml
new file mode 100644
index 0000000000..fbb65c0ddc
--- /dev/null
+++ b/gr-digital/grc/digital_descrambler_bb.block.yml
@@ -0,0 +1,30 @@
+id: digital_descrambler_bb
+label: Descrambler
+
+parameters:
+- id: mask
+ label: Mask
+ dtype: hex
+ default: '0x8A'
+- id: seed
+ label: Seed
+ dtype: hex
+ default: '0x7F'
+- id: len
+ label: Length
+ dtype: int
+ default: '7'
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.descrambler_bb(${mask}, ${seed}, ${len})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_descrambler_bb.xml b/gr-digital/grc/digital_descrambler_bb.xml
deleted file mode 100644
index 4f52c79645..0000000000
--- a/gr-digital/grc/digital_descrambler_bb.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-## Descrambler
-###################################################
- -->
-<block>
- <name>Descrambler</name>
- <key>digital_descrambler_bb</key>
- <import>from gnuradio import digital</import>
- <make>digital.descrambler_bb($mask, $seed, $len)</make>
- <param>
- <name>Mask</name>
- <key>mask</key>
- <value>0x8A</value>
- <type>hex</type>
- </param>
- <param>
- <name>Seed</name>
- <key>seed</key>
- <value>0x7F</value>
- <type>hex</type>
- </param>
- <param>
- <name>Length</name>
- <key>len</key>
- <value>7</value>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_diff_decoder_bb.block.yml b/gr-digital/grc/digital_diff_decoder_bb.block.yml
new file mode 100644
index 0000000000..4b988007c2
--- /dev/null
+++ b/gr-digital/grc/digital_diff_decoder_bb.block.yml
@@ -0,0 +1,21 @@
+id: digital_diff_decoder_bb
+label: Differential Decoder
+
+parameters:
+- id: modulus
+ label: Modulus
+ dtype: int
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.diff_decoder_bb(${modulus})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_diff_decoder_bb.xml b/gr-digital/grc/digital_diff_decoder_bb.xml
deleted file mode 100644
index a7c94b834c..0000000000
--- a/gr-digital/grc/digital_diff_decoder_bb.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Differential Decoder
-###################################################
- -->
-<block>
- <name>Differential Decoder</name>
- <key>digital_diff_decoder_bb</key>
- <import>from gnuradio import digital</import>
- <make>digital.diff_decoder_bb($modulus)</make>
- <param>
- <name>Modulus</name>
- <key>modulus</key>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_diff_encoder_bb.block.yml b/gr-digital/grc/digital_diff_encoder_bb.block.yml
new file mode 100644
index 0000000000..45a5c71302
--- /dev/null
+++ b/gr-digital/grc/digital_diff_encoder_bb.block.yml
@@ -0,0 +1,21 @@
+id: digital_diff_encoder_bb
+label: Differential Encoder
+
+parameters:
+- id: modulus
+ label: Modulus
+ dtype: int
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.diff_encoder_bb(${modulus})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_diff_encoder_bb.xml b/gr-digital/grc/digital_diff_encoder_bb.xml
deleted file mode 100644
index 3885bed9aa..0000000000
--- a/gr-digital/grc/digital_diff_encoder_bb.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Differential Encoder
-###################################################
- -->
-<block>
- <name>Differential Encoder</name>
- <key>digital_diff_encoder_bb</key>
- <import>from gnuradio import digital</import>
- <make>digital.diff_encoder_bb($modulus)</make>
- <param>
- <name>Modulus</name>
- <key>modulus</key>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_diff_phasor_cc.block.yml b/gr-digital/grc/digital_diff_phasor_cc.block.yml
new file mode 100644
index 0000000000..e63c718277
--- /dev/null
+++ b/gr-digital/grc/digital_diff_phasor_cc.block.yml
@@ -0,0 +1,16 @@
+id: digital_diff_phasor_cc
+label: Differential Phasor
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: stream
+ dtype: complex
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.diff_phasor_cc()
+
+file_format: 1
diff --git a/gr-digital/grc/digital_diff_phasor_cc.xml b/gr-digital/grc/digital_diff_phasor_cc.xml
deleted file mode 100644
index 506bf400ba..0000000000
--- a/gr-digital/grc/digital_diff_phasor_cc.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Differential Phasor
-###################################################
- -->
-<block>
- <name>Differential Phasor</name>
- <key>digital_diff_phasor_cc</key>
- <import>from gnuradio import digital</import>
- <make>digital.diff_phasor_cc()</make>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_dxpsk_demod.block.yml b/gr-digital/grc/digital_dxpsk_demod.block.yml
new file mode 100644
index 0000000000..99e7f40e6c
--- /dev/null
+++ b/gr-digital/grc/digital_dxpsk_demod.block.yml
@@ -0,0 +1,75 @@
+id: digital_dxpsk_demod
+label: DPSK Demod
+category: '[Core]/Deprecated'
+
+parameters:
+- id: type
+ label: Type
+ dtype: enum
+ options: [dbpsk, dqpsk]
+ option_labels: [DBPSK, DQPSK]
+- id: samples_per_symbol
+ label: Samples/Symbol
+ dtype: int
+ default: '2'
+- id: excess_bw
+ label: Excess BW
+ dtype: real
+ default: '0.35'
+- id: freq_bw
+ label: FLL Bandwidth
+ dtype: real
+ default: 6.28/100.0
+- id: phase_bw
+ label: Phase Loop Bandwidth
+ dtype: real
+ default: 6.28/100.0
+- id: timing_bw
+ label: Timing Bandwidth
+ dtype: real
+ default: 6.28/100.0
+- id: mod_code
+ label: Gray Code
+ dtype: enum
+ options: ['"gray"', '"none"']
+ option_labels: ['Yes', 'No']
+- id: verbose
+ label: Verbose
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(verbose) == 'False' else 'none') }
+- id: log
+ label: Log
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(log) == 'False' else 'none') }
+- id: sync_out
+ label: Sync Out
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: "digital.${type}_demod(\n\tsamples_per_symbol=${samples_per_symbol},\n\t\
+ excess_bw=${excess_bw},\n\tfreq_bw=${freq_bw},\n\tphase_bw=${phase_bw},\n\t\
+ timing_bw=${timing_bw},\n\tmod_code=${mod_code},\n\tverbose=${verbose},\n\t\
+ log=${log}\n)"
+ callbacks:
+ - clock_recov.set_loop_bandwidth(${phase_bw})
+ - time_recov.set_loop_bandwidth(${timing_bw})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_dxpsk_demod.xml b/gr-digital/grc/digital_dxpsk_demod.xml
deleted file mode 100644
index 12089ad771..0000000000
--- a/gr-digital/grc/digital_dxpsk_demod.xml
+++ /dev/null
@@ -1,154 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- Copyright 2009,2010,2011 Free Software Foundation, Inc.
-
- This file is part of GNU Radio
-
- GNU Radio is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GNU Radio is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Radio; see the file COPYING. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street,
- Boston, MA 02110-1301, USA.
--->
-
-<!--
-###################################################
-##DPSK2 Mod - 2, 4
-###################################################
- -->
-<block>
- <name>DPSK Demod</name>
- <key>digital_dxpsk_demod</key>
- <category>[Core]/Deprecated</category>
- <import>from gnuradio import digital</import>
- <make>digital.$(type)_demod(
- samples_per_symbol=$samples_per_symbol,
- excess_bw=$excess_bw,
- freq_bw=$freq_bw,
- phase_bw=$phase_bw,
- timing_bw=$timing_bw,
- mod_code=$mod_code,
- verbose=$verbose,
- log=$log
-)</make>
- <callback>clock_recov.set_loop_bandwidth($phase_bw)</callback>
- <callback>time_recov.set_loop_bandwidth($timing_bw)</callback>
- <param>
- <name>Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>DBPSK</name>
- <key>dbpsk</key>
- </option>
- <option>
- <name>DQPSK</name>
- <key>dqpsk</key>
- </option>
- </param>
- <param>
- <name>Samples/Symbol</name>
- <key>samples_per_symbol</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>Excess BW</name>
- <key>excess_bw</key>
- <value>0.35</value>
- <type>real</type>
- </param>
- <param>
- <name>FLL Bandwidth</name>
- <key>freq_bw</key>
- <value>6.28/100.0</value>
- <type>real</type>
- </param>
- <param>
- <name>Phase Loop Bandwidth</name>
- <key>phase_bw</key>
- <value>6.28/100.0</value>
- <type>real</type>
- </param>
- <param>
- <name>Timing Bandwidth</name>
- <key>timing_bw</key>
- <value>6.28/100.0</value>
- <type>real</type>
- </param>
- <param>
- <name>Gray Code</name>
- <key>mod_code</key>
- <type>enum</type>
- <option>
- <name>Yes</name>
- <key>"gray"</key>
- </option>
- <option>
- <name>No</name>
- <key>"none"</key>
- </option>
- </param>
- <param>
- <name>Verbose</name>
- <key>verbose</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Log</name>
- <key>log</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Sync Out</name>
- <key>sync_out</key>
- <value>False</value>
- <type>bool</type>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_dxpsk_mod.block.yml b/gr-digital/grc/digital_dxpsk_mod.block.yml
new file mode 100644
index 0000000000..577baa4426
--- /dev/null
+++ b/gr-digital/grc/digital_dxpsk_mod.block.yml
@@ -0,0 +1,52 @@
+id: digital_dxpsk_mod
+label: DPSK Mod
+category: '[Core]/Deprecated'
+
+parameters:
+- id: type
+ label: Type
+ dtype: enum
+ options: [dbpsk, dqpsk]
+ option_labels: [DBPSK, DQPSK]
+- id: samples_per_symbol
+ label: Samples/Symbol
+ dtype: int
+ default: '2'
+- id: excess_bw
+ label: Excess BW
+ dtype: real
+ default: '0.35'
+- id: mod_code
+ label: Gray Code
+ dtype: enum
+ options: ['"gray"', '"none"']
+ option_labels: ['Yes', 'No']
+- id: verbose
+ label: Verbose
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(verbose) == 'False' else 'none') }
+- id: log
+ label: Log
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(log) == 'False' else 'none') }
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: complex
+
+templates:
+ imports: from gnuradio import digital
+ make: "digital.${type}_mod(\n\tsamples_per_symbol=${samples_per_symbol},\n\texcess_bw=${excess_bw},\n\
+ \tmod_code=${mod_code},\n\tverbose=${verbose},\n\tlog=${log})\n\t"
+
+file_format: 1
diff --git a/gr-digital/grc/digital_dxpsk_mod.xml b/gr-digital/grc/digital_dxpsk_mod.xml
deleted file mode 100644
index 4198b8805c..0000000000
--- a/gr-digital/grc/digital_dxpsk_mod.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- Copyright 2009,2010,2011 Free Software Foundation, Inc.
-
- This file is part of GNU Radio
-
- GNU Radio is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GNU Radio is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Radio; see the file COPYING. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street,
- Boston, MA 02110-1301, USA.
--->
-
-<!--
-###################################################
-## DPSK Mod - 2, 4
-###################################################
- -->
-<block>
- <name>DPSK Mod</name>
- <key>digital_dxpsk_mod</key>
- <category>[Core]/Deprecated</category>
- <import>from gnuradio import digital</import>
- <make>digital.$(type)_mod(
- samples_per_symbol=$samples_per_symbol,
- excess_bw=$excess_bw,
- mod_code=$mod_code,
- verbose=$verbose,
- log=$log)
- </make>
- <param>
- <name>Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>DBPSK</name>
- <key>dbpsk</key>
- </option>
- <option>
- <name>DQPSK</name>
- <key>dqpsk</key>
- </option>
- </param>
- <param>
- <name>Samples/Symbol</name>
- <key>samples_per_symbol</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>Excess BW</name>
- <key>excess_bw</key>
- <value>0.35</value>
- <type>real</type>
- </param>
- <param>
- <name>Gray Code</name>
- <key>mod_code</key>
- <type>enum</type>
- <option>
- <name>Yes</name>
- <key>"gray"</key>
- </option>
- <option>
- <name>No</name>
- <key>"none"</key>
- </option>
- </param>
- <param>
- <name>Verbose</name>
- <key>verbose</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Log</name>
- <key>log</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_fll_band_edge_cc.block.yml b/gr-digital/grc/digital_fll_band_edge_cc.block.yml
new file mode 100644
index 0000000000..63b64912bb
--- /dev/null
+++ b/gr-digital/grc/digital_fll_band_edge_cc.block.yml
@@ -0,0 +1,53 @@
+id: digital_fll_band_edge_cc
+label: FLL Band-Edge
+
+parameters:
+- id: type
+ label: Type
+ dtype: enum
+ options: [cc]
+ option_labels: [Complex->Complex]
+ option_attributes:
+ input: [complex]
+ output: [complex]
+ hide: part
+- id: samps_per_sym
+ label: Samples Per Symbol
+ dtype: real
+- id: rolloff
+ label: Filter Rolloff Factor
+ dtype: real
+- id: filter_size
+ label: Prototype Filter Size
+ dtype: int
+- id: w
+ label: Loop Bandwidth
+ dtype: real
+
+inputs:
+- domain: stream
+ dtype: ${ type.input }
+
+outputs:
+- domain: stream
+ dtype: ${ type.output }
+- label: freq
+ domain: stream
+ dtype: float
+ optional: true
+- label: phase
+ domain: stream
+ dtype: float
+ optional: true
+- label: error
+ domain: stream
+ dtype: float
+ optional: true
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.fll_band_edge_cc(${samps_per_sym}, ${rolloff}, ${filter_size}, ${w})
+ callbacks:
+ - set_loop_bandwidth(${w})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_fll_band_edge_cc.xml b/gr-digital/grc/digital_fll_band_edge_cc.xml
deleted file mode 100644
index e4da773db2..0000000000
--- a/gr-digital/grc/digital_fll_band_edge_cc.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-## FLL using Band-Edge Filters
-###################################################
- -->
-<block>
- <name>FLL Band-Edge</name>
- <key>digital_fll_band_edge_cc</key>
- <import>from gnuradio import digital</import>
- <make>digital.fll_band_edge_cc($samps_per_sym, $rolloff, $filter_size, $w)</make>
- <callback>set_loop_bandwidth($w)</callback>
- <param>
- <name>Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Complex->Complex</name>
- <key>cc</key>
- <opt>input:complex</opt>
- <opt>output:complex</opt>
- </option>
- </param>
-
- <param>
- <name>Samples Per Symbol</name>
- <key>samps_per_sym</key>
- <type>real</type>
- </param>
- <param>
- <name>Filter Rolloff Factor</name>
- <key>rolloff</key>
- <type>real</type>
- </param>
- <param>
- <name>Prototype Filter Size</name>
- <key>filter_size</key>
- <type>int</type>
- </param>
-
- <param>
- <name>Loop Bandwidth</name>
- <key>w</key>
- <type>real</type>
- </param>
-
- <sink>
- <name>in</name>
- <type>$type.input</type>
- </sink>
- <source>
- <name>out</name>
- <type>$type.output</type>
- </source>
- <source>
- <name>freq</name>
- <type>float</type>
- <optional>1</optional>
- </source>
- <source>
- <name>phase</name>
- <type>float</type>
- <optional>1</optional>
- </source>
- <source>
- <name>error</name>
- <type>float</type>
- <optional>1</optional>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_framer_sink_1.block.yml b/gr-digital/grc/digital_framer_sink_1.block.yml
new file mode 100644
index 0000000000..a05a1bf0e7
--- /dev/null
+++ b/gr-digital/grc/digital_framer_sink_1.block.yml
@@ -0,0 +1,17 @@
+id: digital_framer_sink_1
+label: Framer Sink 1
+
+parameters:
+- id: target_queue
+ label: Target Message Queue
+ dtype: raw
+
+inputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.framer_sink_1(${target_queue})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_framer_sink_1.xml b/gr-digital/grc/digital_framer_sink_1.xml
deleted file mode 100644
index 9124e6d0dc..0000000000
--- a/gr-digital/grc/digital_framer_sink_1.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-## Framer Sink 1
-###################################################
- -->
-<block>
- <name>Framer Sink 1</name>
- <key>digital_framer_sink_1</key>
- <import>from gnuradio import digital</import>
- <make>digital.framer_sink_1($target_queue)</make>
- <param>
- <name>Target Message Queue</name>
- <key>target_queue</key>
- <type>raw</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
-</block>
diff --git a/gr-digital/grc/digital_gfsk_demod.block.yml b/gr-digital/grc/digital_gfsk_demod.block.yml
new file mode 100644
index 0000000000..9f6b33c6af
--- /dev/null
+++ b/gr-digital/grc/digital_gfsk_demod.block.yml
@@ -0,0 +1,58 @@
+id: digital_gfsk_demod
+label: GFSK Demod
+
+parameters:
+- id: samples_per_symbol
+ label: Samples/Symbol
+ dtype: int
+ default: '2'
+- id: sensitivity
+ label: Sensitivity
+ dtype: real
+ default: '1.0'
+- id: gain_mu
+ label: Gain Mu
+ dtype: real
+ default: '0.175'
+- id: mu
+ label: Mu
+ dtype: real
+ default: '0.5'
+- id: omega_relative_limit
+ label: Omega Relative Limit
+ dtype: real
+ default: '0.005'
+- id: freq_error
+ label: Freq Error
+ dtype: real
+ default: '0.0'
+- id: verbose
+ label: Verbose
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(verbose) == 'False' else 'none') }
+- id: log
+ label: Log
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(log) == 'False' else 'none') }
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: "digital.gfsk_demod(\n\tsamples_per_symbol=${samples_per_symbol},\n\tsensitivity=${sensitivity},\n\
+ \tgain_mu=${gain_mu},\n\tmu=${mu},\n\tomega_relative_limit=${omega_relative_limit},\n\
+ \tfreq_error=${freq_error},\n\tverbose=${verbose},\n\tlog=${log},\n)"
+
+file_format: 1
diff --git a/gr-digital/grc/digital_gfsk_demod.xml b/gr-digital/grc/digital_gfsk_demod.xml
deleted file mode 100644
index cbea39e63e..0000000000
--- a/gr-digital/grc/digital_gfsk_demod.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##GFSK Demod
-###################################################
- -->
-<block>
- <name>GFSK Demod</name>
- <key>digital_gfsk_demod</key>
- <import>from gnuradio import digital</import>
- <make>digital.gfsk_demod(
- samples_per_symbol=$samples_per_symbol,
- sensitivity=$sensitivity,
- gain_mu=$gain_mu,
- mu=$mu,
- omega_relative_limit=$omega_relative_limit,
- freq_error=$freq_error,
- verbose=$verbose,
- log=$log,
-)</make>
- <param>
- <name>Samples/Symbol</name>
- <key>samples_per_symbol</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>Sensitivity</name>
- <key>sensitivity</key>
- <value>1.0</value>
- <type>real</type>
- </param>
- <param>
- <name>Gain Mu</name>
- <key>gain_mu</key>
- <value>0.175</value>
- <type>real</type>
- </param>
- <param>
- <name>Mu</name>
- <key>mu</key>
- <value>0.5</value>
- <type>real</type>
- </param>
- <param>
- <name>Omega Relative Limit</name>
- <key>omega_relative_limit</key>
- <value>0.005</value>
- <type>real</type>
- </param>
- <param>
- <name>Freq Error</name>
- <key>freq_error</key>
- <value>0.0</value>
- <type>real</type>
- </param>
- <param>
- <name>Verbose</name>
- <key>verbose</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Log</name>
- <key>log</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_gfsk_mod.block.yml b/gr-digital/grc/digital_gfsk_mod.block.yml
new file mode 100644
index 0000000000..3dda769a4c
--- /dev/null
+++ b/gr-digital/grc/digital_gfsk_mod.block.yml
@@ -0,0 +1,45 @@
+id: digital_gfsk_mod
+label: GFSK Mod
+
+parameters:
+- id: samples_per_symbol
+ label: Samples/Symbol
+ dtype: int
+ default: '2'
+- id: sensitivity
+ label: Sensitivity
+ dtype: real
+ default: '1.0'
+- id: bt
+ label: BT
+ dtype: real
+ default: '0.35'
+- id: verbose
+ label: Verbose
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(verbose) == 'False' else 'none') }
+- id: log
+ label: Log
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(log) == 'False' else 'none') }
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: complex
+
+templates:
+ imports: from gnuradio import digital
+ make: "digital.gfsk_mod(\n\tsamples_per_symbol=${samples_per_symbol},\n\tsensitivity=${sensitivity},\n\
+ \tbt=${bt},\n\tverbose=${verbose},\n\tlog=${log},\n)"
+
+file_format: 1
diff --git a/gr-digital/grc/digital_gfsk_mod.xml b/gr-digital/grc/digital_gfsk_mod.xml
deleted file mode 100644
index 08e2c84790..0000000000
--- a/gr-digital/grc/digital_gfsk_mod.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##GFSK Mod
-###################################################
- -->
-<block>
- <name>GFSK Mod</name>
- <key>digital_gfsk_mod</key>
- <import>from gnuradio import digital</import>
- <make>digital.gfsk_mod(
- samples_per_symbol=$samples_per_symbol,
- sensitivity=$sensitivity,
- bt=$bt,
- verbose=$verbose,
- log=$log,
-)</make>
- <param>
- <name>Samples/Symbol</name>
- <key>samples_per_symbol</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>Sensitivity</name>
- <key>sensitivity</key>
- <value>1.0</value>
- <type>real</type>
- </param>
- <param>
- <name>BT</name>
- <key>bt</key>
- <value>0.35</value>
- <type>real</type>
- </param>
- <param>
- <name>Verbose</name>
- <key>verbose</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Log</name>
- <key>log</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_glfsr_source_x.block.yml b/gr-digital/grc/digital_glfsr_source_x.block.yml
new file mode 100644
index 0000000000..716b77b02c
--- /dev/null
+++ b/gr-digital/grc/digital_glfsr_source_x.block.yml
@@ -0,0 +1,37 @@
+id: digital_glfsr_source_x
+label: GLFSR Source
+
+parameters:
+- id: type
+ label: Type
+ dtype: enum
+ options: [float, byte]
+ option_attributes:
+ fcn: [f, b]
+ hide: part
+- id: degree
+ label: Degree
+ dtype: int
+- id: repeat
+ label: Repeat
+ dtype: enum
+ options: ['True', 'False']
+ option_labels: ['Yes', 'No']
+- id: mask
+ label: Mask
+ dtype: int
+ default: '0'
+- id: seed
+ label: Seed
+ dtype: int
+ default: '1'
+
+outputs:
+- domain: stream
+ dtype: ${ type }
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.glfsr_source_${type.fcn}(${degree}, ${repeat}, ${mask}, ${seed})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_glfsr_source_x.xml b/gr-digital/grc/digital_glfsr_source_x.xml
deleted file mode 100644
index 654dfa71c0..0000000000
--- a/gr-digital/grc/digital_glfsr_source_x.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##GLFSR Source
-###################################################
- -->
-<block>
- <name>GLFSR Source</name>
- <key>digital_glfsr_source_x</key>
- <import>from gnuradio import digital</import>
- <make>digital.glfsr_source_$(type.fcn)($degree, $repeat, $mask, $seed)</make>
- <param>
- <name>Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Float</name>
- <key>float</key>
- <opt>fcn:f</opt>
- </option>
- <option>
- <name>Byte</name>
- <key>byte</key>
- <opt>fcn:b</opt>
- </option>
- </param>
- <param>
- <name>Degree</name>
- <key>degree</key>
- <type>int</type>
- </param>
- <param>
- <name>Repeat</name>
- <key>repeat</key>
- <type>enum</type>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Mask</name>
- <key>mask</key>
- <value>0</value>
- <type>int</type>
- </param>
- <param>
- <name>Seed</name>
- <key>seed</key>
- <value>1</value>
- <type>int</type>
- </param>
- <source>
- <name>out</name>
- <type>$type</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_gmsk_demod.block.yml b/gr-digital/grc/digital_gmsk_demod.block.yml
new file mode 100644
index 0000000000..bbd3b4148a
--- /dev/null
+++ b/gr-digital/grc/digital_gmsk_demod.block.yml
@@ -0,0 +1,54 @@
+id: digital_gmsk_demod
+label: GMSK Demod
+
+parameters:
+- id: samples_per_symbol
+ label: Samples/Symbol
+ dtype: int
+ default: '2'
+- id: gain_mu
+ label: Gain Mu
+ dtype: real
+ default: '0.175'
+- id: mu
+ label: Mu
+ dtype: real
+ default: '0.5'
+- id: omega_relative_limit
+ label: Omega Relative Limit
+ dtype: real
+ default: '0.005'
+- id: freq_error
+ label: Freq Error
+ dtype: real
+ default: '0.0'
+- id: verbose
+ label: Verbose
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(verbose) == 'False' else 'none') }
+- id: log
+ label: Log
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(log) == 'False' else 'none') }
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: "digital.gmsk_demod(\n\tsamples_per_symbol=${samples_per_symbol},\n\tgain_mu=${gain_mu},\n\
+ \tmu=${mu},\n\tomega_relative_limit=${omega_relative_limit},\n\tfreq_error=${freq_error},\n\
+ \tverbose=${verbose},\n\tlog=${log},\n)"
+
+file_format: 1
diff --git a/gr-digital/grc/digital_gmsk_demod.xml b/gr-digital/grc/digital_gmsk_demod.xml
deleted file mode 100644
index 4d57f1a17a..0000000000
--- a/gr-digital/grc/digital_gmsk_demod.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##GMSK Demod
-###################################################
- -->
-<block>
- <name>GMSK Demod</name>
- <key>digital_gmsk_demod</key>
- <import>from gnuradio import digital</import>
- <make>digital.gmsk_demod(
- samples_per_symbol=$samples_per_symbol,
- gain_mu=$gain_mu,
- mu=$mu,
- omega_relative_limit=$omega_relative_limit,
- freq_error=$freq_error,
- verbose=$verbose,
- log=$log,
-)</make>
- <param>
- <name>Samples/Symbol</name>
- <key>samples_per_symbol</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>Gain Mu</name>
- <key>gain_mu</key>
- <value>0.175</value>
- <type>real</type>
- </param>
- <param>
- <name>Mu</name>
- <key>mu</key>
- <value>0.5</value>
- <type>real</type>
- </param>
- <param>
- <name>Omega Relative Limit</name>
- <key>omega_relative_limit</key>
- <value>0.005</value>
- <type>real</type>
- </param>
- <param>
- <name>Freq Error</name>
- <key>freq_error</key>
- <value>0.0</value>
- <type>real</type>
- </param>
- <param>
- <name>Verbose</name>
- <key>verbose</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Log</name>
- <key>log</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_gmsk_mod.block.yml b/gr-digital/grc/digital_gmsk_mod.block.yml
new file mode 100644
index 0000000000..0b0941bae0
--- /dev/null
+++ b/gr-digital/grc/digital_gmsk_mod.block.yml
@@ -0,0 +1,41 @@
+id: digital_gmsk_mod
+label: GMSK Mod
+
+parameters:
+- id: samples_per_symbol
+ label: Samples/Symbol
+ dtype: int
+ default: '2'
+- id: bt
+ label: BT
+ dtype: real
+ default: '0.35'
+- id: verbose
+ label: Verbose
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(verbose) == 'False' else 'none') }
+- id: log
+ label: Log
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(log) == 'False' else 'none') }
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: complex
+
+templates:
+ imports: from gnuradio import digital
+ make: "digital.gmsk_mod(\n\tsamples_per_symbol=${samples_per_symbol},\n\tbt=${bt},\n\
+ \tverbose=${verbose},\n\tlog=${log},\n)"
+
+file_format: 1
diff --git a/gr-digital/grc/digital_gmsk_mod.xml b/gr-digital/grc/digital_gmsk_mod.xml
deleted file mode 100644
index 77f52ca2f2..0000000000
--- a/gr-digital/grc/digital_gmsk_mod.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##GMSK Mod
-###################################################
- -->
-<block>
- <name>GMSK Mod</name>
- <key>digital_gmsk_mod</key>
- <import>from gnuradio import digital</import>
- <make>digital.gmsk_mod(
- samples_per_symbol=$samples_per_symbol,
- bt=$bt,
- verbose=$verbose,
- log=$log,
-)</make>
- <param>
- <name>Samples/Symbol</name>
- <key>samples_per_symbol</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>BT</name>
- <key>bt</key>
- <value>0.35</value>
- <type>real</type>
- </param>
- <param>
- <name>Verbose</name>
- <key>verbose</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Log</name>
- <key>log</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_gmskmod_bc.block.yml b/gr-digital/grc/digital_gmskmod_bc.block.yml
new file mode 100644
index 0000000000..4b9a511078
--- /dev/null
+++ b/gr-digital/grc/digital_gmskmod_bc.block.yml
@@ -0,0 +1,30 @@
+id: digital_gmskmod_bc
+label: GMSK Modulator
+
+parameters:
+- id: samples_per_symbol
+ label: Samples/Symbol
+ dtype: int
+ default: '2'
+- id: bt
+ label: 3 dB Time-Bandwith Product
+ dtype: real
+ default: '0.3'
+- id: L
+ label: Pulse Duration (Symbols)
+ dtype: int
+ default: '4'
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: complex
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.gmskmod_bc(${samples_per_symbol}, ${L}, ${bt})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_gmskmod_bc.xml b/gr-digital/grc/digital_gmskmod_bc.xml
deleted file mode 100644
index 6cda687f76..0000000000
--- a/gr-digital/grc/digital_gmskmod_bc.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-## GMSK
-###################################################
- -->
-<block>
- <name>GMSK Modulator</name>
- <key>digital_gmskmod_bc</key>
- <import>from gnuradio import digital</import>
- <make>digital.gmskmod_bc($samples_per_symbol, $L, $bt)</make>
- <param>
- <name>Samples/Symbol</name>
- <key>samples_per_symbol</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>3 dB Time-Bandwith Product</name>
- <key>bt</key>
- <value>0.3</value>
- <type>real</type>
- </param>
- <param>
- <name>Pulse Duration (Symbols)</name>
- <key>L</key>
- <value>4</value>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_hdlc_deframer_bp.block.yml b/gr-digital/grc/digital_hdlc_deframer_bp.block.yml
new file mode 100644
index 0000000000..38b31ca53f
--- /dev/null
+++ b/gr-digital/grc/digital_hdlc_deframer_bp.block.yml
@@ -0,0 +1,26 @@
+id: digital_hdlc_deframer_bp
+label: HDLC Deframer
+
+parameters:
+- id: min
+ label: Min length
+ dtype: int
+ default: '32'
+- id: max
+ label: Max length
+ dtype: int
+ default: '500'
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: message
+ id: out
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.hdlc_deframer_bp(${min}, ${max})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_hdlc_deframer_bp.xml b/gr-digital/grc/digital_hdlc_deframer_bp.xml
deleted file mode 100644
index 3e78b891df..0000000000
--- a/gr-digital/grc/digital_hdlc_deframer_bp.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-<block>
- <name>HDLC Deframer</name>
- <key>digital_hdlc_deframer_bp</key>
- <import>from gnuradio import digital</import>
- <make>digital.hdlc_deframer_bp($min, $max)</make>
- <param>
- <name>Min length</name>
- <key>min</key>
- <value>32</value>
- <type>int</type>
- </param>
- <param>
- <name>Max length</name>
- <key>max</key>
- <value>500</value>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>message</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_hdlc_framer_pb.block.yml b/gr-digital/grc/digital_hdlc_framer_pb.block.yml
new file mode 100644
index 0000000000..f775a489ef
--- /dev/null
+++ b/gr-digital/grc/digital_hdlc_framer_pb.block.yml
@@ -0,0 +1,21 @@
+id: digital_hdlc_framer_pb
+label: HDLC Framer
+
+parameters:
+- id: frame_tag_name
+ label: Frame tag name
+ dtype: string
+
+inputs:
+- domain: message
+ id: in
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.hdlc_framer_pb(${frame_tag_name})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_hdlc_framer_pb.xml b/gr-digital/grc/digital_hdlc_framer_pb.xml
deleted file mode 100644
index 8dc122d581..0000000000
--- a/gr-digital/grc/digital_hdlc_framer_pb.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-<block>
- <name>HDLC Framer</name>
- <key>digital_hdlc_framer_pb</key>
- <import>from gnuradio import digital</import>
- <make>digital.hdlc_framer_pb($frame_tag_name)</make>
- <param>
- <name>Frame tag name</name>
- <key>frame_tag_name</key>
- <type>string</type>
- </param>
- <sink>
- <name>in</name>
- <type>message</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_header_payload_demux.block.yml b/gr-digital/grc/digital_header_payload_demux.block.yml
new file mode 100644
index 0000000000..4f69a08f29
--- /dev/null
+++ b/gr-digital/grc/digital_header_payload_demux.block.yml
@@ -0,0 +1,85 @@
+id: digital_header_payload_demux
+label: Header/Payload Demux
+
+parameters:
+- id: header_len
+ label: Header Length (Symbols)
+ dtype: int
+- id: header_padding
+ label: Header Padding (Uncertainty / Symbols)
+ dtype: int
+ default: '0'
+- id: items_per_symbol
+ label: Items per symbol
+ dtype: int
+ hide: ${ 'part' if vlen == 1 else 'none' }
+- id: guard_interval
+ label: Guard Interval (items)
+ dtype: int
+ default: '0'
+ hide: ${ ('none' if guard_interval else 'part') }
+- id: length_tag_key
+ label: Length tag key
+ dtype: string
+ default: '"frame_len"'
+- id: trigger_tag_key
+ label: Trigger tag key
+ dtype: string
+ default: '""'
+ hide: ${ ('none' if trigger_tag_key else 'part') }
+- id: output_symbols
+ label: Output Format
+ dtype: enum
+ options: ['False', 'True']
+ option_labels: [Items, Symbols]
+ hide: ${ 'part' if vlen == 1 else 'none' }
+- id: type
+ label: IO Type
+ dtype: enum
+ options: [complex, float, int, short, byte]
+ option_attributes:
+ itemsize: [gr.sizeof_gr_complex, gr.sizeof_float, gr.sizeof_int, gr.sizeof_short,
+ gr.sizeof_char]
+ hide: part
+- id: timing_tag_key
+ label: Timing tag key
+ dtype: string
+ default: '"rx_time"'
+- id: samp_rate
+ label: Sampling Rate
+ dtype: int
+ default: samp_rate
+- id: special_tags
+ label: Special Tag Keys
+ dtype: raw
+ default: (,)
+
+inputs:
+- domain: stream
+ dtype: ${ type }
+- label: trigger
+ domain: stream
+ dtype: byte
+ optional: true
+- domain: message
+ id: header_data
+
+outputs:
+- label: out_hdr
+ domain: stream
+ dtype: ${ type }
+ vlen: '${ {True: items_per_symbol, False: 1}[output_symbols] }'
+- label: out_payload
+ domain: stream
+ dtype: ${ type }
+ vlen: '${ {True: items_per_symbol, False: 1}[output_symbols] }'
+
+templates:
+ imports: from gnuradio import digital
+ make: "digital.header_payload_demux(\n\t ${header_len},\n\t ${items_per_symbol},\n\
+ \t ${guard_interval},\n\t ${length_tag_key},\n\t ${trigger_tag_key},\n\t\
+ \ ${output_symbols},\n\t ${type.itemsize},\n\t ${timing_tag_key},\n \
+ \ ${samp_rate},\n ${special_tags},\n ${header_padding},\n\
+ \ )"
+
+file_format: 1
diff --git a/gr-digital/grc/digital_header_payload_demux.xml b/gr-digital/grc/digital_header_payload_demux.xml
deleted file mode 100644
index a2fe80e621..0000000000
--- a/gr-digital/grc/digital_header_payload_demux.xml
+++ /dev/null
@@ -1,138 +0,0 @@
-<block>
- <name>Header/Payload Demux</name>
- <key>digital_header_payload_demux</key>
- <import>from gnuradio import digital</import>
- <make>digital.header_payload_demux(
- $header_len,
- $items_per_symbol,
- $guard_interval,
- $length_tag_key,
- $trigger_tag_key,
- $output_symbols,
- $(type.itemsize),
- $timing_tag_key,
- $samp_rate,
- $special_tags,
- $header_padding,
- )</make>
- <param>
- <name>Header Length (Symbols)</name>
- <key>header_len</key>
- <type>int</type>
- </param>
- <param>
- <name>Header Padding (Uncertainty / Symbols)</name>
- <key>header_padding</key>
- <value>0</value>
- <type>int</type>
- </param>
- <param>
- <name>Items per symbol</name>
- <key>items_per_symbol</key>
- <type>int</type>
- </param>
- <param>
- <name>Guard Interval (items)</name>
- <key>guard_interval</key>
- <value>0</value>
- <type>int</type>
- <hide>#if $guard_interval then 'none' else 'part'#</hide>
- </param>
- <param>
- <name>Length tag key</name>
- <key>length_tag_key</key>
- <value>"frame_len"</value>
- <type>string</type>
- </param>
- <param>
- <name>Trigger tag key</name>
- <key>trigger_tag_key</key>
- <value>""</value>
- <type>string</type>
- <hide>#if $trigger_tag_key then 'none' else 'part'#</hide>
- </param>
- <param>
- <name>Output Format</name>
- <key>output_symbols</key>
- <type>enum</type>
- <option>
- <name>Items</name>
- <key>False</key>
- </option>
- <option>
- <name>Symbols</name>
- <key>True</key>
- </option>
- </param>
- <param>
- <name>IO Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Complex</name>
- <key>complex</key>
- <opt>itemsize:gr.sizeof_gr_complex</opt>
- </option>
- <option>
- <name>Float</name>
- <key>float</key>
- <opt>itemsize:gr.sizeof_float</opt>
- </option>
- <option>
- <name>Int</name>
- <key>int</key>
- <opt>itemsize:gr.sizeof_int</opt>
- </option>
- <option>
- <name>Short</name>
- <key>short</key>
- <opt>itemsize:gr.sizeof_short</opt>
- </option>
- <option>
- <name>Byte</name>
- <key>byte</key>
- <opt>itemsize:gr.sizeof_char</opt>
- </option>
- </param>
- <param>
- <name>Timing tag key</name>
- <key>timing_tag_key</key>
- <value>"rx_time"</value>
- <type>string</type>
- </param>
- <param>
- <name>Sampling Rate</name>
- <key>samp_rate</key>
- <value>samp_rate</value>
- <type>int</type>
- </param>
- <param>
- <name>Special Tag Keys</name>
- <key>special_tags</key>
- <value>(,)</value>
- <type>raw</type>
- </param>
- <sink>
- <name>in</name>
- <type>$type</type>
- </sink>
- <sink>
- <name>trigger</name>
- <type>byte</type>
- <optional>1</optional>
- </sink>
- <sink>
- <name>header_data</name>
- <type>message</type>
- </sink>
- <source>
- <name>out_hdr</name>
- <type>$type</type>
- <vlen>{True: $items_per_symbol, False: 1}[$output_symbols]</vlen>
- </source>
- <source>
- <name>out_payload</name>
- <type>$type</type>
- <vlen>{True: $items_per_symbol, False: 1}[$output_symbols]</vlen>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_kurtotic_equalizer_cc.block.yml b/gr-digital/grc/digital_kurtotic_equalizer_cc.block.yml
new file mode 100644
index 0000000000..d81aee7d4d
--- /dev/null
+++ b/gr-digital/grc/digital_kurtotic_equalizer_cc.block.yml
@@ -0,0 +1,26 @@
+id: digital_kurtotic_equalizer_cc
+label: Kurtotic Equalizer
+
+parameters:
+- id: num_taps
+ label: Num. Taps
+ dtype: int
+- id: mu
+ label: Mu
+ dtype: real
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: stream
+ dtype: complex
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.kurtotic_equalizer_cc(${num_taps}, ${mu})
+ callbacks:
+ - set_gain(${mu})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_kurtotic_equalizer_cc.xml b/gr-digital/grc/digital_kurtotic_equalizer_cc.xml
deleted file mode 100644
index 8c4a2012d2..0000000000
--- a/gr-digital/grc/digital_kurtotic_equalizer_cc.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-## Kurtotic Equalizer
-###################################################
- -->
-<block>
- <name>Kurtotic Equalizer</name>
- <key>digital_kurtotic_equalizer_cc</key>
- <import>from gnuradio import digital</import>
- <make>digital.kurtotic_equalizer_cc($num_taps, $mu)</make>
- <callback>set_gain($mu)</callback>
- <param>
- <name>Num. Taps</name>
- <key>num_taps</key>
- <type>int</type>
- </param>
- <param>
- <name>Mu</name>
- <key>mu</key>
- <type>real</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_lms_dd_equalizer_cc.block.yml b/gr-digital/grc/digital_lms_dd_equalizer_cc.block.yml
new file mode 100644
index 0000000000..1c44ea2850
--- /dev/null
+++ b/gr-digital/grc/digital_lms_dd_equalizer_cc.block.yml
@@ -0,0 +1,32 @@
+id: digital_lms_dd_equalizer_cc
+label: LMS DD Equalizer
+
+parameters:
+- id: mu
+ label: Gain
+ dtype: real
+- id: num_taps
+ label: Num. Taps
+ dtype: int
+- id: sps
+ label: Samples per Symbol
+ dtype: int
+- id: cnst
+ label: Constellation Object
+ dtype: raw
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: stream
+ dtype: complex
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.lms_dd_equalizer_cc(${num_taps}, ${mu}, ${sps}, ${cnst})
+ callbacks:
+ - set_gain(${mu})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_lms_dd_equalizer_cc.xml b/gr-digital/grc/digital_lms_dd_equalizer_cc.xml
deleted file mode 100644
index 0fd7d523b8..0000000000
--- a/gr-digital/grc/digital_lms_dd_equalizer_cc.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-## LMS DD Equalizer
-###################################################
- -->
-<block>
- <name>LMS DD Equalizer</name>
- <key>digital_lms_dd_equalizer_cc</key>
- <import>from gnuradio import digital</import>
- <make>digital.lms_dd_equalizer_cc($num_taps, $mu, $sps, $cnst)</make>
- <callback>set_gain($mu)</callback>
- <param>
- <name>Gain</name>
- <key>mu</key>
- <type>real</type>
- </param>
- <param>
- <name>Num. Taps</name>
- <key>num_taps</key>
- <type>int</type>
- </param>
- <param>
- <name>Samples per Symbol</name>
- <key>sps</key>
- <type>int</type>
- </param>
- <param>
- <name>Constellation Object</name>
- <key>cnst</key>
- <type>raw</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_map_bb.block.yml b/gr-digital/grc/digital_map_bb.block.yml
new file mode 100644
index 0000000000..8f1a33fb0f
--- /dev/null
+++ b/gr-digital/grc/digital_map_bb.block.yml
@@ -0,0 +1,21 @@
+id: digital_map_bb
+label: Map
+
+parameters:
+- id: map
+ label: Map
+ dtype: int_vector
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.map_bb(${map})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_map_bb.xml b/gr-digital/grc/digital_map_bb.xml
deleted file mode 100644
index 1435c5ac78..0000000000
--- a/gr-digital/grc/digital_map_bb.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Map
-###################################################
- -->
-<block>
- <name>Map</name>
- <key>digital_map_bb</key>
- <import>from gnuradio import digital</import>
- <make>digital.map_bb($map)</make>
- <param>
- <name>Map</name>
- <key>map</key>
- <type>int_vector</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_modulate_vector.block.yml b/gr-digital/grc/digital_modulate_vector.block.yml
new file mode 100644
index 0000000000..a06cc211c8
--- /dev/null
+++ b/gr-digital/grc/digital_modulate_vector.block.yml
@@ -0,0 +1,22 @@
+id: variable_modulate_vector
+label: Modulate Vector
+category: Modulators
+
+parameters:
+- id: mod
+ label: Modulator
+ dtype: raw
+- id: data
+ label: Data vector
+ dtype: int_vector
+- id: taps
+ label: Filter taps
+ dtype: float_vector
+value: ${ digital.modulate_vector_bc(mod .to_basic_block(), data, taps) }
+
+templates:
+ imports: from gnuradio import digital
+ var_make: self.${id} = ${id} = digital.modulate_vector_bc(${mod} .to_basic_block(),
+ ${data}, ${taps})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_modulate_vector.xml b/gr-digital/grc/digital_modulate_vector.xml
deleted file mode 100644
index 91614dd3fd..0000000000
--- a/gr-digital/grc/digital_modulate_vector.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-# modulate_vector_bc
-###################################################
- -->
-<block>
- <name>Modulate Vector</name>
- <key>variable_modulate_vector</key>
- <category>Modulators</category>
- <import>from gnuradio import digital</import>
- <var_make>self.$(id) = $(id) = digital.modulate_vector_bc($mod .to_basic_block(), $data, $taps)</var_make>
- <var_value>digital.modulate_vector_bc($mod .to_basic_block(), $data, $taps)</var_value>
- <make></make>
-
- <param>
- <name>Modulator</name>
- <key>mod</key>
- <value></value>
- <type>raw</type>
- </param>
- <param>
- <name>Data vector</name>
- <key>data</key>
- <value></value>
- <type>int_vector</type>
- </param>
- <param>
- <name>Filter taps</name>
- <key>taps</key>
- <value></value>
- <type>float_vector</type>
- </param>
-</block>
diff --git a/gr-digital/grc/digital_mpsk_snr_est_cc.block.yml b/gr-digital/grc/digital_mpsk_snr_est_cc.block.yml
new file mode 100644
index 0000000000..7c39a24927
--- /dev/null
+++ b/gr-digital/grc/digital_mpsk_snr_est_cc.block.yml
@@ -0,0 +1,35 @@
+id: digital_mpsk_snr_est_cc
+label: MPSK SNR Estimator
+
+parameters:
+- id: type
+ label: Type
+ dtype: enum
+ options: ['0', '1', '2', '3']
+ option_labels: [Simple, Skewness, 2nd and 4th Moment, SVR]
+- id: tag_nsamples
+ label: Samples between tags
+ dtype: int
+ default: '10000'
+- id: alpha
+ label: Filter Alpha
+ dtype: real
+ default: '0.001'
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: stream
+ dtype: complex
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.mpsk_snr_est_cc(${type}, ${tag_nsamples}, ${alpha})
+ callbacks:
+ - set_type(${type})
+ - set_tag_nsamples(${tag_nsamples})
+ - set_alpha(${alpha})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_mpsk_snr_est_cc.xml b/gr-digital/grc/digital_mpsk_snr_est_cc.xml
deleted file mode 100644
index 6039e5b13e..0000000000
--- a/gr-digital/grc/digital_mpsk_snr_est_cc.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##MPSK SNR Estimator
-###################################################
- -->
-<block>
- <name>MPSK SNR Estimator</name>
- <key>digital_mpsk_snr_est_cc</key>
- <import>from gnuradio import digital</import>
- <make>digital.mpsk_snr_est_cc($type, $tag_nsamples, $alpha)</make>
- <callback>set_type($type)</callback>
- <callback>set_tag_nsamples($tag_nsamples)</callback>
- <callback>set_alpha($alpha)</callback>
- <param>
- <name>Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Simple</name>
- <key>0</key>
- </option>
- <option>
- <name>Skewness</name>
- <key>1</key>
- </option>
- <option>
- <name>2nd and 4th Moment</name>
- <key>2</key>
- </option>
- <option>
- <name>SVR</name>
- <key>3</key>
- </option>
- </param>
- <param>
- <name>Samples between tags</name>
- <key>tag_nsamples</key>
- <value>10000</value>
- <type>int</type>
- </param>
- <param>
- <name>Filter Alpha</name>
- <key>alpha</key>
- <value>0.001</value>
- <type>real</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_msk_timing_recovery_cc.block.yml b/gr-digital/grc/digital_msk_timing_recovery_cc.block.yml
new file mode 100644
index 0000000000..3f5ae678c7
--- /dev/null
+++ b/gr-digital/grc/digital_msk_timing_recovery_cc.block.yml
@@ -0,0 +1,42 @@
+id: digital_msk_timing_recovery_cc
+label: MSK Timing Recovery
+
+parameters:
+- id: gain
+ label: Gain
+ dtype: float
+- id: sps
+ label: Samples per symbol
+ dtype: float
+- id: limit
+ label: Error limit
+ dtype: float
+- id: osps
+ label: Output samples per symbol
+ dtype: int
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: stream
+ dtype: complex
+- label: err
+ domain: stream
+ dtype: float
+ optional: true
+- label: omega
+ domain: stream
+ dtype: float
+ optional: true
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.msk_timing_recovery_cc(${sps}, ${gain}, ${limit}, ${osps})
+ callbacks:
+ - set_gain(${gain})
+ - set_sps(${sps})
+ - set_limit(${limit})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_msk_timing_recovery_cc.xml b/gr-digital/grc/digital_msk_timing_recovery_cc.xml
deleted file mode 100644
index cda780d685..0000000000
--- a/gr-digital/grc/digital_msk_timing_recovery_cc.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>
-<block>
- <name>MSK Timing Recovery</name>
- <key>digital_msk_timing_recovery_cc</key>
- <import>from gnuradio import digital</import>
- <make>digital.msk_timing_recovery_cc($sps, $gain, $limit, $osps)</make>
- <callback>set_gain($gain)</callback>
- <callback>set_sps($sps)</callback>
- <callback>set_limit($limit)</callback>
- <param>
- <name>Gain</name>
- <key>gain</key>
- <type>float</type>
- </param>
- <param>
- <name>Samples per symbol</name>
- <key>sps</key>
- <type>float</type>
- </param>
- <param>
- <name>Error limit</name>
- <key>limit</key>
- <type>float</type>
- </param>
- <param>
- <name>Output samples per symbol</name>
- <key>osps</key>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
- <source>
- <name>err</name>
- <type>float</type>
- <optional>1</optional>
- </source>
- <source>
- <name>omega</name>
- <type>float</type>
- <optional>1</optional>
- </source>
-
-</block>
diff --git a/gr-digital/grc/digital_ofdm_carrier_allocator_cvc.block.yml b/gr-digital/grc/digital_ofdm_carrier_allocator_cvc.block.yml
new file mode 100644
index 0000000000..ab260ab9d9
--- /dev/null
+++ b/gr-digital/grc/digital_ofdm_carrier_allocator_cvc.block.yml
@@ -0,0 +1,44 @@
+id: digital_ofdm_carrier_allocator_cvc
+label: OFDM Carrier Allocator
+
+parameters:
+- id: fft_len
+ label: FFT length
+ dtype: int
+ default: fft_len
+ hide: ${ 'part' if vlen == 1 else 'none' }
+- id: occupied_carriers
+ label: Occupied Carriers
+ dtype: raw
+- id: pilot_carriers
+ label: Pilot Carriers
+ dtype: raw
+ default: ()
+- id: pilot_symbols
+ label: Pilot Symbols
+ dtype: raw
+ default: ()
+- id: sync_words
+ label: Sync Words
+ dtype: raw
+ default: ()
+- id: len_tag_key
+ label: Length tag key
+ dtype: string
+ default: '"packet_len"'
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: stream
+ dtype: complex
+ vlen: ${ fft_len }
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.ofdm_carrier_allocator_cvc(${fft_len}, ${occupied_carriers}, ${pilot_carriers},
+ ${pilot_symbols}, ${sync_words}, ${len_tag_key})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_ofdm_carrier_allocator_cvc.xml b/gr-digital/grc/digital_ofdm_carrier_allocator_cvc.xml
deleted file mode 100644
index b9bdde543d..0000000000
--- a/gr-digital/grc/digital_ofdm_carrier_allocator_cvc.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-<block>
- <name>OFDM Carrier Allocator</name>
- <key>digital_ofdm_carrier_allocator_cvc</key>
- <import>from gnuradio import digital</import>
- <make>digital.ofdm_carrier_allocator_cvc($fft_len, $occupied_carriers, $pilot_carriers, $pilot_symbols, $sync_words, $len_tag_key)</make>
- <param>
- <name>FFT length</name>
- <key>fft_len</key>
- <value>fft_len</value>
- <type>int</type>
- </param>
- <param>
- <name>Occupied Carriers</name>
- <key>occupied_carriers</key>
- <type>raw</type>
- </param>
- <param>
- <name>Pilot Carriers</name>
- <key>pilot_carriers</key>
- <value>()</value>
- <type>raw</type>
- </param>
- <param>
- <name>Pilot Symbols</name>
- <key>pilot_symbols</key>
- <value>()</value>
- <type>raw</type>
- </param>
- <param>
- <name>Sync Words</name>
- <key>sync_words</key>
- <value>()</value>
- <type>raw</type>
- </param>
- <param>
- <name>Length tag key</name>
- <key>len_tag_key</key>
- <value>"packet_len"</value>
- <type>string</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- <vlen>$fft_len</vlen>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_ofdm_chanest_vcvc.block.yml b/gr-digital/grc/digital_ofdm_chanest_vcvc.block.yml
new file mode 100644
index 0000000000..352c6ab5a7
--- /dev/null
+++ b/gr-digital/grc/digital_ofdm_chanest_vcvc.block.yml
@@ -0,0 +1,53 @@
+id: digital_ofdm_chanest_vcvc
+label: OFDM Channel Estimation
+
+parameters:
+- id: sync_symbol1
+ label: Synch. symbol 1
+ dtype: complex_vector
+ hide: ${ 'part' if vlen == 1 else 'none' }
+- id: sync_symbol2
+ label: Synch. symbol 2
+ dtype: complex_vector
+ default: ()
+- id: n_data_symbols
+ label: Number of data symbols
+ dtype: int
+ default: '1'
+- id: eq_noise_red_len
+ label: Channel taps noise reduction length
+ dtype: int
+ default: '0'
+ hide: all
+- id: max_carr_offset
+ label: Maximum carrier offset
+ dtype: int
+ default: '-1'
+ hide: ${ ('part' if max_carr_offset < 0 else 'none') }
+- id: force_one_symbol
+ label: Force One Synchronisation Symbol
+ dtype: enum
+ options: ['False', 'True']
+ option_labels: ['No', 'Yes']
+ hide: ${ ('part' if not force_one_symbol else 'none') }
+
+inputs:
+- domain: stream
+ dtype: complex
+ vlen: ${ len(sync_symbol1) }
+
+outputs:
+- domain: stream
+ dtype: complex
+ vlen: ${ len(sync_symbol1) }
+
+asserts:
+- ${ len(sync_symbol1) }
+- ${ len(sync_symbol2) == 0 or len(sync_symbol2) == len(sync_symbol1) }
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.ofdm_chanest_vcvc(${sync_symbol1}, ${sync_symbol2}, ${n_data_symbols},
+ ${eq_noise_red_len}, ${max_carr_offset}, ${force_one_symbol})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_ofdm_chanest_vcvc.xml b/gr-digital/grc/digital_ofdm_chanest_vcvc.xml
deleted file mode 100644
index 5cc2145456..0000000000
--- a/gr-digital/grc/digital_ofdm_chanest_vcvc.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0"?>
-<block>
- <name>OFDM Channel Estimation</name>
- <key>digital_ofdm_chanest_vcvc</key>
- <import>from gnuradio import digital</import>
- <make>digital.ofdm_chanest_vcvc($sync_symbol1, $sync_symbol2, $n_data_symbols, $eq_noise_red_len, $max_carr_offset, $force_one_symbol)</make>
- <param>
- <name>Synch. symbol 1</name>
- <key>sync_symbol1</key>
- <type>complex_vector</type>
- </param>
- <param>
- <name>Synch. symbol 2</name>
- <key>sync_symbol2</key>
- <value>()</value>
- <type>complex_vector</type>
- </param>
- <param>
- <name>Number of data symbols</name>
- <key>n_data_symbols</key>
- <value>1</value>
- <type>int</type>
- </param>
- <param>
- <name>Channel taps noise reduction length</name>
- <key>eq_noise_red_len</key>
- <value>0</value>
- <type>int</type>
- <hide>all</hide>
- </param>
- <param>
- <name>Maximum carrier offset</name>
- <key>max_carr_offset</key>
- <value>-1</value>
- <type>int</type>
- <hide>#if $max_carr_offset &lt; 0 then 'part' else 'none'#</hide>
- </param>
- <param>
- <name>Force One Synchronisation Symbol</name>
- <key>force_one_symbol</key>
- <type>enum</type>
- <hide>#if not $force_one_symbol then 'part' else 'none'#</hide>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- </param>
- <check>len($sync_symbol1)</check>
- <check>len($sync_symbol2) == 0 or len($sync_symbol2) == len($sync_symbol1)</check>
- <sink>
- <name>in</name>
- <type>complex</type>
- <vlen>len($sync_symbol1)</vlen>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- <vlen>len($sync_symbol1)</vlen>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_ofdm_cyclic_prefixer.block.yml b/gr-digital/grc/digital_ofdm_cyclic_prefixer.block.yml
new file mode 100644
index 0000000000..cd475a0601
--- /dev/null
+++ b/gr-digital/grc/digital_ofdm_cyclic_prefixer.block.yml
@@ -0,0 +1,38 @@
+id: digital_ofdm_cyclic_prefixer
+label: OFDM Cyclic Prefixer
+
+parameters:
+- id: input_size
+ label: FFT Length
+ dtype: int
+ default: fft_len
+ hide: ${ 'part' if vlen == 1 else 'none' }
+- id: cp_len
+ label: CP Length
+ dtype: int
+ default: fft_len/4
+- id: rolloff
+ label: Rolloff
+ dtype: int
+ default: '0'
+ hide: ${ ('none' if rolloff else 'part') }
+- id: tagname
+ label: Length Tag Key
+ dtype: string
+ default: '"frame_len"'
+
+inputs:
+- domain: stream
+ dtype: complex
+ vlen: ${ input_size }
+
+outputs:
+- domain: stream
+ dtype: complex
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.ofdm_cyclic_prefixer(${input_size}, ${input_size+cp_len}, ${rolloff},
+ ${tagname})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_ofdm_cyclic_prefixer.xml b/gr-digital/grc/digital_ofdm_cyclic_prefixer.xml
deleted file mode 100644
index ec5e027047..0000000000
--- a/gr-digital/grc/digital_ofdm_cyclic_prefixer.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Copyright 2011 Free Software Foundation, Inc.
-
- This file is part of GNU Radio
-
- GNU Radio is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GNU Radio is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Radio; see the file COPYING. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street,
- Boston, MA 02110-1301, USA.
--->
-
-<!--
-###################################################
-##OFDM Cyclic Prefixer
-###################################################
- -->
-<block>
- <name>OFDM Cyclic Prefixer</name>
- <key>digital_ofdm_cyclic_prefixer</key>
- <import>from gnuradio import digital</import>
- <make>digital.ofdm_cyclic_prefixer($input_size, $input_size+$cp_len, $rolloff, $tagname)</make>
- <param>
- <name>FFT Length</name>
- <key>input_size</key>
- <value>fft_len</value>
- <type>int</type>
- </param>
- <param>
- <name>CP Length</name>
- <key>cp_len</key>
- <value>fft_len/4</value>
- <type>int</type>
- </param>
- <param>
- <name>Rolloff</name>
- <key>rolloff</key>
- <value>0</value>
- <type>int</type>
- <hide>#if $rolloff then 'none' else 'part'#</hide>
- </param>
- <param>
- <name>Length Tag Key</name>
- <key>tagname</key>
- <value>"frame_len"</value>
- <type>string</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- <vlen>$input_size</vlen>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_ofdm_frame_equalizer_vcvc.block.yml b/gr-digital/grc/digital_ofdm_frame_equalizer_vcvc.block.yml
new file mode 100644
index 0000000000..b2eba18e64
--- /dev/null
+++ b/gr-digital/grc/digital_ofdm_frame_equalizer_vcvc.block.yml
@@ -0,0 +1,46 @@
+id: digital_ofdm_frame_equalizer_vcvc
+label: OFDM Frame Equalizer
+
+parameters:
+- id: fft_len
+ label: FFT length
+ dtype: int
+ default: fft_len
+ hide: ${ 'part' if vlen == 1 else 'none' }
+- id: cp_len
+ label: CP length
+ dtype: int
+ default: fft_len/4
+- id: equalizer
+ label: Equalizer
+ dtype: raw
+- id: len_tag_key
+ label: Length Tag Key
+ dtype: string
+- id: propagate_channel_state
+ label: Propagate Channel State
+ dtype: enum
+ options: ['True', 'False']
+ option_labels: ['Yes', 'No']
+- id: fixed_frame_len
+ label: Fixed frame length
+ dtype: int
+ default: '0'
+ hide: ${ ('none' if fixed_frame_len else 'part') }
+
+inputs:
+- domain: stream
+ dtype: complex
+ vlen: ${ fft_len }
+
+outputs:
+- domain: stream
+ dtype: complex
+ vlen: ${ fft_len }
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.ofdm_frame_equalizer_vcvc(${equalizer}, ${cp_len}, ${len_tag_key},
+ ${propagate_channel_state}, ${fixed_frame_len})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_ofdm_frame_equalizer_vcvc.xml b/gr-digital/grc/digital_ofdm_frame_equalizer_vcvc.xml
deleted file mode 100644
index 2a0c24e528..0000000000
--- a/gr-digital/grc/digital_ofdm_frame_equalizer_vcvc.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<block>
- <name>OFDM Frame Equalizer</name>
- <key>digital_ofdm_frame_equalizer_vcvc</key>
- <import>from gnuradio import digital</import>
- <make>digital.ofdm_frame_equalizer_vcvc($equalizer, $cp_len, $len_tag_key, $propagate_channel_state, $fixed_frame_len)</make>
- <param>
- <name>FFT length</name>
- <key>fft_len</key>
- <value>fft_len</value>
- <type>int</type>
- </param>
- <param>
- <name>CP length</name>
- <key>cp_len</key>
- <value>fft_len/4</value>
- <type>int</type>
- </param>
- <param>
- <name>Equalizer</name>
- <key>equalizer</key>
- <type>raw</type>
- </param>
- <param>
- <name>Length Tag Key</name>
- <key>len_tag_key</key>
- <type>string</type>
- </param>
- <param>
- <name>Propagate Channel State</name>
- <key>propagate_channel_state</key>
- <type>enum</type>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Fixed frame length</name>
- <key>fixed_frame_len</key>
- <value>0</value>
- <type>int</type>
- <hide>#if $fixed_frame_len then 'none' else 'part'#</hide>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- <vlen>$fft_len</vlen>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- <vlen>$fft_len</vlen>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_ofdm_rx.block.yml b/gr-digital/grc/digital_ofdm_rx.block.yml
new file mode 100644
index 0000000000..2a3928020b
--- /dev/null
+++ b/gr-digital/grc/digital_ofdm_rx.block.yml
@@ -0,0 +1,95 @@
+id: digital_ofdm_rx
+label: OFDM Receiver
+
+parameters:
+- id: fft_len
+ label: FFT Length
+ dtype: int
+ default: '64'
+- id: cp_len
+ label: Cyclic Prefix Length
+ dtype: int
+ default: '16'
+- id: packet_len_key
+ label: Packet Length Tag Key
+ dtype: string
+ default: '"length"'
+- id: occupied_carriers
+ label: Occupied Carriers
+ dtype: raw
+ default: ()
+ hide: ${ 'none' if occupied_carriers else 'part' }
+- id: pilot_carriers
+ label: Pilot Carriers
+ dtype: raw
+ default: ()
+ hide: ${ 'none' if pilot_carriers else 'part' }
+- id: pilot_symbols
+ label: Pilot Symbols
+ dtype: raw
+ default: ()
+ hide: ${ 'none' if pilot_symbols else 'part' }
+- id: sync_word1
+ label: Sync Word 1
+ dtype: raw
+ default: ()
+ hide: ${ 'none' if sync_word1 else 'part' }
+- id: sync_word2
+ label: Sync Word 2
+ dtype: raw
+ default: ()
+ hide: ${ 'none' if sync_word2 else 'part' }
+- id: header_mod
+ label: Header Modulation
+ dtype: enum
+ options: ['"BPSK"', '"QPSK"']
+ option_labels: [BPSK, QPSK]
+ option_attributes:
+ bps: ['1', '2']
+- id: payload_mod
+ label: Payload Modulation
+ dtype: enum
+ options: ['"BPSK"', '"QPSK"', '"8-PSK"']
+ option_labels: [BPSK, QPSK, 8-PSK]
+ option_attributes:
+ bps: ['1', '2', '3']
+- id: scramble_bits
+ label: Scramble Bits
+ dtype: enum
+ default: 'False'
+ options: ['False', 'True']
+ option_labels: ['No', 'Yes']
+ hide: ${ ('part' if scramble_bits else 'none') }
+- id: log
+ label: Log Debug Info
+ dtype: enum
+ default: 'False'
+ options: ['False', 'True']
+ option_labels: ['No', 'Yes']
+ hide: ${ ('none' if log else 'part') }
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: stream
+ dtype: byte
+
+asserts:
+- ${ fft_len > 0 }
+- ${ cp_len > 0 }
+- ${ cp_len < fft_len }
+
+templates:
+ imports: from gnuradio import digital
+ make: "digital.ofdm_rx(\n\t fft_len=${fft_len}, cp_len=${cp_len},\n\t frame_length_tag_key='frame_'+${packet_len_key},\n\
+ \t packet_length_tag_key=${packet_len_key},\n\t % if occupied_carriers:\n\
+ \t occupied_carriers=${occupied_carriers},\n\t % endif\n\t % if pilot_carriers:\n\
+ \t pilot_carriers=${pilot_carriers},\n\t % endif\n\t % if pilot_symbols:\n\
+ \t pilot_symbols=${pilot_symbols},\n\t % endif\n\t % if sync_word1:\n\t\
+ \ sync_word1=${sync_word1},\n\t % endif\n\t % if sync_word2:\n\t sync_word2=${sync_word2},\n\
+ \t % endif\n\t bps_header=${header_mod.bps},\n\t bps_payload=${payload_mod.bps},\n\
+ \t debug_log=${log},\n\t scramble_bits=${scramble_bits}\n\t )"
+
+file_format: 1
diff --git a/gr-digital/grc/digital_ofdm_rx.xml b/gr-digital/grc/digital_ofdm_rx.xml
deleted file mode 100644
index 9c2bf65e9d..0000000000
--- a/gr-digital/grc/digital_ofdm_rx.xml
+++ /dev/null
@@ -1,190 +0,0 @@
-<?xml version="1.0"?>
-<block>
- <name>OFDM Receiver</name>
- <key>digital_ofdm_rx</key>
- <import>from gnuradio import digital</import>
- <make>digital.ofdm_rx(
- fft_len=$fft_len, cp_len=$cp_len,
- frame_length_tag_key='frame_'+$packet_len_key,
- packet_length_tag_key=$packet_len_key,
- #if $occupied_carriers()
- occupied_carriers=$occupied_carriers,
- #end if
- #if $pilot_carriers()
- pilot_carriers=$pilot_carriers,
- #end if
- #if $pilot_symbols()
- pilot_symbols=$pilot_symbols,
- #end if
- #if $sync_word1()
- sync_word1=$sync_word1,
- #end if
- #if $sync_word2()
- sync_word2=$sync_word2,
- #end if
- bps_header=$header_mod.bps,
- bps_payload=$payload_mod.bps,
- debug_log=$log,
- scramble_bits=$scramble_bits
- )</make>
- <param>
- <name>FFT Length</name>
- <key>fft_len</key>
- <value>64</value>
- <type>int</type>
- </param>
- <param>
- <name>Cyclic Prefix Length</name>
- <key>cp_len</key>
- <value>16</value>
- <type>int</type>
- </param>
- <param>
- <name>Packet Length Tag Key</name>
- <key>packet_len_key</key>
- <value>"length"</value>
- <type>string</type>
- </param>
- <param>
- <name>Occupied Carriers</name>
- <key>occupied_carriers</key>
- <value>()</value>
- <type>raw</type>
- <hide>
- #if $occupied_carriers()
- none
- #else
- part
- #end if
- </hide>
- </param>
- <param>
- <name>Pilot Carriers</name>
- <key>pilot_carriers</key>
- <value>()</value>
- <type>raw</type>
- <hide>
- #if $pilot_carriers()
- none
- #else
- part
- #end if
- </hide>
- </param>
- <param>
- <name>Pilot Symbols</name>
- <key>pilot_symbols</key>
- <value>()</value>
- <type>raw</type>
- <hide>
- #if $pilot_symbols()
- none
- #else
- part
- #end if
- </hide>
- </param>
- <param>
- <name>Sync Word 1</name>
- <key>sync_word1</key>
- <value>()</value>
- <type>raw</type>
- <hide>
- #if $sync_word1()
- none
- #else
- part
- #end if
- </hide>
- </param>
- <param>
- <name>Sync Word 2</name>
- <key>sync_word2</key>
- <value>()</value>
- <type>raw</type>
- <hide>
- #if $sync_word2()
- none
- #else
- part
- #end if
- </hide>
- </param>
- <param>
- <name>Header Modulation</name>
- <key>header_mod</key>
- <type>enum</type>
- <option>
- <name>BPSK</name>
- <key>"BPSK"</key>
- <opt>bps:1</opt>
- </option>
- <option>
- <name>QPSK</name>
- <key>"QPSK"</key>
- <opt>bps:2</opt>
- </option>
- </param>
- <param>
- <name>Payload Modulation</name>
- <key>payload_mod</key>
- <type>enum</type>
- <option>
- <name>BPSK</name>
- <key>"BPSK"</key>
- <opt>bps:1</opt>
- </option>
- <option>
- <name>QPSK</name>
- <key>"QPSK"</key>
- <opt>bps:2</opt>
- </option>
- <option>
- <name>8-PSK</name>
- <key>"8-PSK"</key>
- <opt>bps:3</opt>
- </option>
- </param>
- <param>
- <name>Scramble Bits</name>
- <key>scramble_bits</key>
- <value>False</value>
- <type>enum</type>
- <hide> #if $scramble_bits then 'part' else 'none'#</hide>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- </param>
- <param>
- <name>Log Debug Info</name>
- <key>log</key>
- <value>False</value>
- <type>enum</type>
- <hide> #if $log then 'none' else 'part'#</hide>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- </param>
- <check>$fft_len &gt; 0</check>
- <check>$cp_len &gt; 0</check>
- <check>$cp_len &lt; $fft_len</check>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
-
diff --git a/gr-digital/grc/digital_ofdm_serializer_vcc.block.yml b/gr-digital/grc/digital_ofdm_serializer_vcc.block.yml
new file mode 100644
index 0000000000..d81dd569f7
--- /dev/null
+++ b/gr-digital/grc/digital_ofdm_serializer_vcc.block.yml
@@ -0,0 +1,51 @@
+id: digital_ofdm_serializer_vcc
+label: OFDM Serializer
+
+parameters:
+- id: fft_len
+ label: FFT length
+ dtype: int
+ default: fft_len
+ hide: ${ 'part' if vlen == 1 else 'none' }
+- id: occupied_carriers
+ label: Occupied Carriers
+ dtype: raw
+- id: len_tag_key
+ label: Length Tag Key
+ dtype: string
+- id: packet_len_tag_key
+ label: Packet Length Tag Key
+ dtype: string
+ default: '""'
+ hide: ${ ('none' if packet_len_tag_key else 'part') }
+- id: symbols_skipped
+ label: Symbols skipped
+ dtype: int
+ default: '0'
+ hide: ${ ('none' if symbols_skipped else 'part') }
+- id: carr_offset_key
+ label: Carrier Offset Key
+ dtype: string
+ default: '""'
+ hide: ${ ('none' if carr_offset_key else 'part') }
+- id: input_is_shifted
+ label: Input is shifted
+ dtype: bool
+ default: 'True'
+ hide: ${ ('part' if input_is_shifted else 'none') }
+
+inputs:
+- domain: stream
+ dtype: complex
+ vlen: ${ fft_len }
+
+outputs:
+- domain: stream
+ dtype: complex
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.ofdm_serializer_vcc(${fft_len}, ${occupied_carriers}, ${len_tag_key},
+ ${packet_len_tag_key}, ${symbols_skipped}, ${carr_offset_key}, ${input_is_shifted})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_ofdm_serializer_vcc.xml b/gr-digital/grc/digital_ofdm_serializer_vcc.xml
deleted file mode 100644
index 1c09cd94fc..0000000000
--- a/gr-digital/grc/digital_ofdm_serializer_vcc.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0"?>
-<block>
- <name>OFDM Serializer</name>
- <key>digital_ofdm_serializer_vcc</key>
- <import>from gnuradio import digital</import>
- <make>digital.ofdm_serializer_vcc($fft_len, $occupied_carriers, $len_tag_key, $packet_len_tag_key, $symbols_skipped, $carr_offset_key, $input_is_shifted)</make>
- <param>
- <name>FFT length</name>
- <key>fft_len</key>
- <value>fft_len</value>
- <type>int</type>
- </param>
- <param>
- <name>Occupied Carriers</name>
- <key>occupied_carriers</key>
- <type>raw</type>
- </param>
- <param>
- <name>Length Tag Key</name>
- <key>len_tag_key</key>
- <type>string</type>
- </param>
- <param>
- <name>Packet Length Tag Key</name>
- <key>packet_len_tag_key</key>
- <value>""</value>
- <type>string</type>
- <hide>#if $packet_len_tag_key then 'none' else 'part'#</hide>
- </param>
- <param>
- <name>Symbols skipped</name>
- <key>symbols_skipped</key>
- <value>0</value>
- <type>int</type>
- <hide>#if $symbols_skipped then 'none' else 'part'#</hide>
- </param>
- <param>
- <name>Carrier Offset Key</name>
- <key>carr_offset_key</key>
- <value>""</value>
- <type>string</type>
- <hide>#if $carr_offset_key then 'none' else 'part'#</hide>
- </param>
- <param>
- <name>Input is shifted</name>
- <key>input_is_shifted</key>
- <value>True</value>
- <type>bool</type>
- <hide>#if $input_is_shifted then 'part' else 'none'#</hide>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- <vlen>$fft_len</vlen>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_ofdm_sync_sc_cfb.block.yml b/gr-digital/grc/digital_ofdm_sync_sc_cfb.block.yml
new file mode 100644
index 0000000000..f1e2f3b13b
--- /dev/null
+++ b/gr-digital/grc/digital_ofdm_sync_sc_cfb.block.yml
@@ -0,0 +1,35 @@
+id: digital_ofdm_sync_sc_cfb
+label: Schmidl & Cox OFDM synch.
+
+parameters:
+- id: fft_len
+ label: FFT length
+ dtype: int
+- id: cp_len
+ label: Cyclic Prefix length
+ dtype: int
+- id: use_even_carriers
+ label: Preamble Carriers
+ dtype: enum
+ default: 'False'
+ options: ['False', 'True']
+ option_labels: [Odd, Even]
+ hide: part
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- label: freq_offset
+ domain: stream
+ dtype: float
+- label: detect
+ domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.ofdm_sync_sc_cfb(${fft_len}, ${cp_len}, ${use_even_carriers})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_ofdm_sync_sc_cfb.xml b/gr-digital/grc/digital_ofdm_sync_sc_cfb.xml
deleted file mode 100644
index 4238df761c..0000000000
--- a/gr-digital/grc/digital_ofdm_sync_sc_cfb.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<block>
- <name>Schmidl &amp; Cox OFDM synch.</name>
- <key>digital_ofdm_sync_sc_cfb</key>
- <import>from gnuradio import digital</import>
- <make>digital.ofdm_sync_sc_cfb($fft_len, $cp_len, $use_even_carriers)</make>
- <param>
- <name>FFT length</name>
- <key>fft_len</key>
- <type>int</type>
- </param>
- <param>
- <name>Cyclic Prefix length</name>
- <key>cp_len</key>
- <type>int</type>
- </param>
- <param>
- <name>Preamble Carriers</name>
- <key>use_even_carriers</key>
- <value>False</value>
- <type>enum</type>
- <hide>part</hide>
- <option>
- <name>Odd</name>
- <key>False</key>
- </option>
- <option>
- <name>Even</name>
- <key>True</key>
- </option>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>freq_offset</name>
- <type>float</type>
- </source>
- <source>
- <name>detect</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_ofdm_tx.block.yml b/gr-digital/grc/digital_ofdm_tx.block.yml
new file mode 100644
index 0000000000..c81da0d27f
--- /dev/null
+++ b/gr-digital/grc/digital_ofdm_tx.block.yml
@@ -0,0 +1,100 @@
+id: digital_ofdm_tx
+label: OFDM Transmitter
+
+parameters:
+- id: fft_len
+ label: FFT Length
+ dtype: int
+ default: '64'
+- id: cp_len
+ label: Cyclic Prefix Length
+ dtype: int
+ default: '16'
+- id: packet_len_key
+ label: Length Tag Name
+ dtype: string
+ default: length
+- id: occupied_carriers
+ label: Occupied Carriers
+ dtype: raw
+ default: ()
+ hide: ${ 'none' if occupied_carriers else 'part' }
+- id: pilot_carriers
+ label: Pilot Carriers
+ dtype: raw
+ default: ()
+ hide: ${ 'none' if pilot_carriers else 'part' }
+- id: pilot_symbols
+ label: Pilot Symbols
+ dtype: raw
+ default: ()
+ hide: ${ 'none' if pilot_symbols else 'part' }
+- id: sync_word1
+ label: Sync Word 1
+ dtype: raw
+ default: ()
+ hide: ${ 'none' if sync_word1 else 'part' }
+- id: sync_word2
+ label: Sync Word 2
+ dtype: raw
+ default: ()
+ hide: ${ 'none' if sync_word2 else 'part' }
+- id: header_mod
+ label: Header Modulation
+ dtype: enum
+ options: ['"BPSK"', '"QPSK"']
+ option_labels: [BPSK, QPSK]
+ option_attributes:
+ bps: ['1', '2']
+- id: payload_mod
+ label: Payload Modulation
+ dtype: enum
+ options: ['"BPSK"', '"QPSK"', '"8-PSK"']
+ option_labels: [BPSK, QPSK, 8-PSK]
+ option_attributes:
+ bps: ['1', '2', '3']
+- id: rolloff
+ label: Rolloff length (samples)
+ dtype: int
+ default: '0'
+- id: scramble_bits
+ label: Scramble Bits
+ dtype: enum
+ default: 'False'
+ options: ['False', 'True']
+ option_labels: ['No', 'Yes']
+ hide: ${ ('part' if scramble_bits else 'none') }
+- id: log
+ label: Log Debug Info
+ dtype: enum
+ default: 'False'
+ options: ['False', 'True']
+ option_labels: ['No', 'Yes']
+ hide: ${ ('none' if log else 'part') }
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: complex
+
+asserts:
+- ${ fft_len > 0 }
+- ${ cp_len > 0 }
+- ${ cp_len < fft_len }
+- ${ rolloff >= 0 }
+
+templates:
+ imports: from gnuradio import digital
+ make: "digital.ofdm_tx(\n\t fft_len=${fft_len}, cp_len=${cp_len},\n\t packet_length_tag_key=${packet_len_key},\n\
+ \t % if occupied_carriers:\n\t occupied_carriers=${occupied_carriers},\n\
+ \t % endif\n\t % if pilot_carriers:\n\t pilot_carriers=${pilot_carriers},\n\
+ \t % endif\n\t % if pilot_carriers:\n\t pilot_symbols=${pilot_symbols},\n\
+ \t % endif\n\t % if sync_word1:\n\t sync_word1=${sync_word1},\n\t % endif\n\
+ \t % if sync_word2:\n\t sync_word2=${sync_word2},\n\t % endif\n\t bps_header=${header_mod.bps},\n\
+ \t bps_payload=${payload_mod.bps},\n\t rolloff=${rolloff},\n\t debug_log=${log},\n\
+ \t scramble_bits=${scramble_bits}\n\t )"
+
+file_format: 1
diff --git a/gr-digital/grc/digital_ofdm_tx.xml b/gr-digital/grc/digital_ofdm_tx.xml
deleted file mode 100644
index bad0b2b13d..0000000000
--- a/gr-digital/grc/digital_ofdm_tx.xml
+++ /dev/null
@@ -1,196 +0,0 @@
-<?xml version="1.0"?>
-<block>
- <name>OFDM Transmitter</name>
- <key>digital_ofdm_tx</key>
- <import>from gnuradio import digital</import>
- <make>digital.ofdm_tx(
- fft_len=$fft_len, cp_len=$cp_len,
- packet_length_tag_key=$packet_len_key,
- #if $occupied_carriers()
- occupied_carriers=$occupied_carriers,
- #end if
- #if $pilot_carriers()
- pilot_carriers=$pilot_carriers,
- #end if
- #if $pilot_carriers()
- pilot_symbols=$pilot_symbols,
- #end if
- #if $sync_word1()
- sync_word1=$sync_word1,
- #end if
- #if $sync_word2()
- sync_word2=$sync_word2,
- #end if
- bps_header=$header_mod.bps,
- bps_payload=$payload_mod.bps,
- rolloff=$rolloff,
- debug_log=$log,
- scramble_bits=$scramble_bits
- )</make>
- <param>
- <name>FFT Length</name>
- <key>fft_len</key>
- <value>64</value>
- <type>int</type>
- </param>
- <param>
- <name>Cyclic Prefix Length</name>
- <key>cp_len</key>
- <value>16</value>
- <type>int</type>
- </param>
- <param>
- <name>Length Tag Name</name>
- <key>packet_len_key</key>
- <value>length</value>
- <type>string</type>
- </param>
- <param>
- <name>Occupied Carriers</name>
- <key>occupied_carriers</key>
- <value>()</value>
- <type>raw</type>
- <hide>
- #if $occupied_carriers()
- none
- #else
- part
- #end if
- </hide>
- </param>
- <param>
- <name>Pilot Carriers</name>
- <key>pilot_carriers</key>
- <value>()</value>
- <type>raw</type>
- <hide>
- #if $pilot_carriers()
- none
- #else
- part
- #end if
- </hide>
- </param>
- <param>
- <name>Pilot Symbols</name>
- <key>pilot_symbols</key>
- <value>()</value>
- <type>raw</type>
- <hide>
- #if $pilot_symbols()
- none
- #else
- part
- #end if
- </hide>
- </param>
- <param>
- <name>Sync Word 1</name>
- <key>sync_word1</key>
- <value>()</value>
- <type>raw</type>
- <hide>
- #if $sync_word1()
- none
- #else
- part
- #end if
- </hide>
- </param>
- <param>
- <name>Sync Word 2</name>
- <key>sync_word2</key>
- <value>()</value>
- <type>raw</type>
- <hide>
- #if $sync_word2()
- none
- #else
- part
- #end if
- </hide>
- </param>
- <param>
- <name>Header Modulation</name>
- <key>header_mod</key>
- <type>enum</type>
- <option>
- <name>BPSK</name>
- <key>"BPSK"</key>
- <opt>bps:1</opt>
- </option>
- <option>
- <name>QPSK</name>
- <key>"QPSK"</key>
- <opt>bps:2</opt>
- </option>
- </param>
- <param>
- <name>Payload Modulation</name>
- <key>payload_mod</key>
- <type>enum</type>
- <option>
- <name>BPSK</name>
- <key>"BPSK"</key>
- <opt>bps:1</opt>
- </option>
- <option>
- <name>QPSK</name>
- <key>"QPSK"</key>
- <opt>bps:2</opt>
- </option>
- <option>
- <name>8-PSK</name>
- <key>"8-PSK"</key>
- <opt>bps:3</opt>
- </option>
- </param>
- <param>
- <name>Rolloff length (samples)</name>
- <key>rolloff</key>
- <value>0</value>
- <type>int</type>
- </param>
- <param>
- <name>Scramble Bits</name>
- <key>scramble_bits</key>
- <value>False</value>
- <type>enum</type>
- <hide> #if $scramble_bits then 'part' else 'none'#</hide>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- </param>
- <param>
- <name>Log Debug Info</name>
- <key>log</key>
- <value>False</value>
- <type>enum</type>
- <hide> #if $log then 'none' else 'part'#</hide>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- </param>
- <check>$fft_len &gt; 0</check>
- <check>$cp_len &gt; 0</check>
- <check>$cp_len &lt; $fft_len</check>
- <check>$rolloff &gt;= 0</check>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_packet_headergenerator_bb.block.yml b/gr-digital/grc/digital_packet_headergenerator_bb.block.yml
new file mode 100644
index 0000000000..d77530450f
--- /dev/null
+++ b/gr-digital/grc/digital_packet_headergenerator_bb.block.yml
@@ -0,0 +1,27 @@
+id: digital_packet_headergenerator_bb
+label: Packet Header Generator
+
+parameters:
+- id: header_formatter
+ label: Formatter Object
+ dtype: raw
+- id: len_tag_key
+ label: Length Tag Name
+ dtype: string
+ default: '"packet_len"'
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.packet_headergenerator_bb(${header_formatter}, ${len_tag_key})
+ callbacks:
+ - set_header_formatter(${header_formatter})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_packet_headergenerator_bb.xml b/gr-digital/grc/digital_packet_headergenerator_bb.xml
deleted file mode 100644
index f069b52a01..0000000000
--- a/gr-digital/grc/digital_packet_headergenerator_bb.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<block>
- <name>Packet Header Generator</name>
- <key>digital_packet_headergenerator_bb</key>
- <import>from gnuradio import digital</import>
- <make>digital.packet_headergenerator_bb($header_formatter, $len_tag_key)</make>
- <callback>set_header_formatter($header_formatter)</callback>
- <param>
- <name>Formatter Object</name>
- <key>header_formatter</key>
- <type>raw</type>
- </param>
- <param>
- <name>Length Tag Name</name>
- <key>len_tag_key</key>
- <value>"packet_len"</value>
- <type>string</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_packet_headergenerator_bb_default.block.yml b/gr-digital/grc/digital_packet_headergenerator_bb_default.block.yml
new file mode 100644
index 0000000000..f9af16acac
--- /dev/null
+++ b/gr-digital/grc/digital_packet_headergenerator_bb_default.block.yml
@@ -0,0 +1,25 @@
+id: digital_packet_headergenerator_bb_default
+label: Packet Header Generator (Default)
+
+parameters:
+- id: header_len
+ label: Header Length
+ dtype: int
+- id: len_tag_key
+ label: Length Tag Name
+ dtype: string
+ default: '"packet_len"'
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.packet_headergenerator_bb(${header_len}, ${len_tag_key})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_packet_headergenerator_bb_default.xml b/gr-digital/grc/digital_packet_headergenerator_bb_default.xml
deleted file mode 100644
index e89c340bf1..0000000000
--- a/gr-digital/grc/digital_packet_headergenerator_bb_default.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<block>
- <name>Packet Header Generator (Default)</name>
- <key>digital_packet_headergenerator_bb_default</key>
- <import>from gnuradio import digital</import>
- <make>digital.packet_headergenerator_bb($header_len, $len_tag_key)</make>
- <param>
- <name>Header Length</name>
- <key>header_len</key>
- <type>int</type>
- </param>
- <param>
- <name>Length Tag Name</name>
- <key>len_tag_key</key>
- <value>"packet_len"</value>
- <type>string</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
-
diff --git a/gr-digital/grc/digital_packet_headerparser_b.block.yml b/gr-digital/grc/digital_packet_headerparser_b.block.yml
new file mode 100644
index 0000000000..f3a4741086
--- /dev/null
+++ b/gr-digital/grc/digital_packet_headerparser_b.block.yml
@@ -0,0 +1,21 @@
+id: digital_packet_headerparser_b
+label: Packet Header Parser
+
+parameters:
+- id: header_formatter
+ label: Formatter Object
+ dtype: raw
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: message
+ id: header_data
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.packet_headerparser_b(${header_formatter})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_packet_headerparser_b.xml b/gr-digital/grc/digital_packet_headerparser_b.xml
deleted file mode 100644
index bab6bd22ed..0000000000
--- a/gr-digital/grc/digital_packet_headerparser_b.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<block>
- <name>Packet Header Parser</name>
- <key>digital_packet_headerparser_b</key>
- <import>from gnuradio import digital</import>
- <make>digital.packet_headerparser_b($header_formatter)</make>
- <param>
- <name>Formatter Object</name>
- <key>header_formatter</key>
- <type>raw</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>header_data</name>
- <type>message</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_packet_headerparser_b_default.block.yml b/gr-digital/grc/digital_packet_headerparser_b_default.block.yml
new file mode 100644
index 0000000000..903a23cf32
--- /dev/null
+++ b/gr-digital/grc/digital_packet_headerparser_b_default.block.yml
@@ -0,0 +1,25 @@
+id: digital_packet_headerparser_b_default
+label: Packet Header Parser (Default)
+
+parameters:
+- id: header_len
+ label: Header Length
+ dtype: int
+- id: len_tag_key
+ label: Length Tag Name
+ dtype: string
+ default: '"packet_len"'
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: message
+ id: header_data
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.packet_headerparser_b(${header_len}, ${len_tag_key})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_packet_headerparser_b_default.xml b/gr-digital/grc/digital_packet_headerparser_b_default.xml
deleted file mode 100644
index 81a33ed774..0000000000
--- a/gr-digital/grc/digital_packet_headerparser_b_default.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<block>
- <name>Packet Header Parser (Default)</name>
- <key>digital_packet_headerparser_b_default</key>
- <import>from gnuradio import digital</import>
- <make>digital.packet_headerparser_b($header_len, $len_tag_key)</make>
- <param>
- <name>Header Length</name>
- <key>header_len</key>
- <type>int</type>
- </param>
- <param>
- <name>Length Tag Name</name>
- <key>len_tag_key</key>
- <value>"packet_len"</value>
- <type>string</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>header_data</name>
- <type>message</type>
- </source>
-</block>
-
diff --git a/gr-digital/grc/digital_packet_sink.block.yml b/gr-digital/grc/digital_packet_sink.block.yml
new file mode 100644
index 0000000000..a603226afc
--- /dev/null
+++ b/gr-digital/grc/digital_packet_sink.block.yml
@@ -0,0 +1,24 @@
+id: digital_packet_sink
+label: Packet Sink
+
+parameters:
+- id: sync_vector
+ label: Sync Vector
+ dtype: int_vector
+- id: target_queue
+ label: Target Message Queue
+ dtype: raw
+- id: threshold
+ label: Threshold
+ dtype: int
+ default: '-1'
+
+inputs:
+- domain: stream
+ dtype: float
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.packet_sink(${sync_vector}, ${target_queue}, ${threshold})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_packet_sink.xml b/gr-digital/grc/digital_packet_sink.xml
deleted file mode 100644
index 2c6653d7ec..0000000000
--- a/gr-digital/grc/digital_packet_sink.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-## Packet Sink
-###################################################
- -->
-<block>
- <name>Packet Sink</name>
- <key>digital_packet_sink</key>
- <import>from gnuradio import digital</import>
- <make>digital.packet_sink($sync_vector, $target_queue, $threshold)</make>
- <param>
- <name>Sync Vector</name>
- <key>sync_vector</key>
- <type>int_vector</type>
- </param>
- <param>
- <name>Target Message Queue</name>
- <key>target_queue</key>
- <type>raw</type>
- </param>
- <param>
- <name>Threshold</name>
- <key>threshold</key>
- <value>-1</value>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>float</type>
- </sink>
-</block>
diff --git a/gr-digital/grc/digital_pfb_clock_sync.block.yml b/gr-digital/grc/digital_pfb_clock_sync.block.yml
new file mode 100644
index 0000000000..d9fbca8441
--- /dev/null
+++ b/gr-digital/grc/digital_pfb_clock_sync.block.yml
@@ -0,0 +1,69 @@
+id: digital_pfb_clock_sync_xxx
+label: Polyphase Clock Sync
+
+parameters:
+- id: type
+ label: Type
+ dtype: enum
+ options: [ccf, fff]
+ option_labels: [Complex->Complex (Real Taps), Float->Float (Real Taps)]
+ option_attributes:
+ input: [complex, float]
+ output: [complex, float]
+ taps: [real_vector, real_vector]
+ hide: part
+- id: sps
+ label: Samples/Symbol
+ dtype: real
+- id: loop_bw
+ label: Loop Bandwidth
+ dtype: real
+- id: taps
+ label: Taps
+ dtype: real_vector
+- id: filter_size
+ label: Filter Size
+ dtype: int
+ default: '32'
+- id: init_phase
+ label: Initial Phase
+ dtype: real
+ default: '16'
+- id: max_dev
+ label: Maximum Rate Deviation
+ dtype: real
+ default: '1.5'
+- id: osps
+ label: Output SPS
+ dtype: int
+ default: '1'
+
+inputs:
+- domain: stream
+ dtype: ${ type.input }
+
+outputs:
+- domain: stream
+ dtype: ${ type.output }
+- label: err
+ domain: stream
+ dtype: float
+ optional: true
+- label: rate
+ domain: stream
+ dtype: float
+ optional: true
+- label: phase
+ domain: stream
+ dtype: float
+ optional: true
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.pfb_clock_sync_${type}(${sps}, ${loop_bw}, ${taps}, ${filter_size},
+ ${init_phase}, ${max_dev}, ${osps})
+ callbacks:
+ - update_taps(${taps})
+ - set_loop_bandwidth(${loop_bw})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_pfb_clock_sync.xml b/gr-digital/grc/digital_pfb_clock_sync.xml
deleted file mode 100644
index c54417f2cb..0000000000
--- a/gr-digital/grc/digital_pfb_clock_sync.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-## Polyphase Filter based Clock Sync
-###################################################
- -->
-<block>
- <name>Polyphase Clock Sync</name>
- <key>digital_pfb_clock_sync_xxx</key>
- <import>from gnuradio import digital</import>
- <make>digital.pfb_clock_sync_$(type)($sps, $loop_bw, $taps, $filter_size, $init_phase, $max_dev, $osps)</make>
- <callback>update_taps($taps)</callback>
- <callback>set_loop_bandwidth($loop_bw)</callback>
-
- <param>
- <name>Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Complex->Complex (Real Taps)</name>
- <key>ccf</key>
- <opt>input:complex</opt>
- <opt>output:complex</opt>
- <opt>taps:real_vector</opt>
- </option>
- <option>
- <name>Float->Float (Real Taps)</name>
- <key>fff</key>
- <opt>input:float</opt>
- <opt>output:float</opt>
- <opt>taps:real_vector</opt>
- </option>
- </param>
-
- <param>
- <name>Samples/Symbol</name>
- <key>sps</key>
- <type>real</type>
- </param>
- <param>
- <name>Loop Bandwidth</name>
- <key>loop_bw</key>
- <type>real</type>
- </param>
- <param>
- <name>Taps</name>
- <key>taps</key>
- <type>real_vector</type>
- </param>
- <param>
- <name>Filter Size</name>
- <key>filter_size</key>
- <value>32</value>
- <type>int</type>
- </param>
- <param>
- <name>Initial Phase</name>
- <key>init_phase</key>
- <value>16</value>
- <type>real</type>
- </param>
- <param>
- <name>Maximum Rate Deviation</name>
- <key>max_dev</key>
- <value>1.5</value>
- <type>real</type>
- </param>
- <param>
- <name>Output SPS</name>
- <key>osps</key>
- <value>1</value>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>$type.input</type>
- </sink>
- <source>
- <name>out</name>
- <type>$type.output</type>
- </source>
- <source>
- <name>err</name>
- <type>float</type>
- <optional>1</optional>
- </source>
- <source>
- <name>rate</name>
- <type>float</type>
- <optional>1</optional>
- </source>
- <source>
- <name>phase</name>
- <type>float</type>
- <optional>1</optional>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_pn_correlator_cc.block.yml b/gr-digital/grc/digital_pn_correlator_cc.block.yml
new file mode 100644
index 0000000000..e92415433d
--- /dev/null
+++ b/gr-digital/grc/digital_pn_correlator_cc.block.yml
@@ -0,0 +1,29 @@
+id: digital_pn_correlator_cc
+label: PN Correlator
+
+parameters:
+- id: degree
+ label: Degree
+ dtype: int
+- id: mask
+ label: Mask
+ dtype: int
+ default: '0'
+- id: seed
+ label: Seed
+ dtype: int
+ default: '1'
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: stream
+ dtype: complex
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.pn_correlator_cc(${degree}, ${mask}, ${seed})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_pn_correlator_cc.xml b/gr-digital/grc/digital_pn_correlator_cc.xml
deleted file mode 100644
index 999cea15d9..0000000000
--- a/gr-digital/grc/digital_pn_correlator_cc.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##PN Correlator
-###################################################
- -->
-<block>
- <name>PN Correlator</name>
- <key>digital_pn_correlator_cc</key>
- <import>from gnuradio import digital</import>
- <make>digital.pn_correlator_cc($degree, $mask, $seed)</make>
- <param>
- <name>Degree</name>
- <key>degree</key>
- <type>int</type>
- </param>
- <param>
- <name>Mask</name>
- <key>mask</key>
- <value>0</value>
- <type>int</type>
- </param>
- <param>
- <name>Seed</name>
- <key>seed</key>
- <value>1</value>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_probe_density_b.block.yml b/gr-digital/grc/digital_probe_density_b.block.yml
new file mode 100644
index 0000000000..e329c6568c
--- /dev/null
+++ b/gr-digital/grc/digital_probe_density_b.block.yml
@@ -0,0 +1,24 @@
+id: digital_probe_density_b
+label: Probe Density
+
+parameters:
+- id: alpha
+ label: Alpha
+ dtype: real
+ default: '1'
+- id: probe_rate
+ label: Probe Rate
+ dtype: real
+ default: '10'
+
+inputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.probe_density_b(${alpha})
+ callbacks:
+ - set_alpha(${alpha})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_probe_density_b.xml b/gr-digital/grc/digital_probe_density_b.xml
deleted file mode 100644
index 8cf5dd8943..0000000000
--- a/gr-digital/grc/digital_probe_density_b.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Probe Density
-###################################################
- -->
-<block>
- <name>Probe Density</name>
- <key>digital_probe_density_b</key>
- <import>from gnuradio import digital</import>
- <make>digital.probe_density_b($alpha)</make>
- <callback>set_alpha($alpha)</callback>
- <param>
- <name>Alpha</name>
- <key>alpha</key>
- <value>1</value>
- <type>real</type>
- </param>
- <param>
- <name>Probe Rate</name>
- <key>probe_rate</key>
- <value>10</value>
- <type>real</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
-</block>
diff --git a/gr-digital/grc/digital_probe_mpsk_snr_est_c.block.yml b/gr-digital/grc/digital_probe_mpsk_snr_est_c.block.yml
new file mode 100644
index 0000000000..68e29c1e76
--- /dev/null
+++ b/gr-digital/grc/digital_probe_mpsk_snr_est_c.block.yml
@@ -0,0 +1,42 @@
+id: digital_probe_mpsk_snr_est_c
+label: MPSK SNR Estimator Probe
+
+parameters:
+- id: type
+ label: Type
+ dtype: enum
+ options: ['0', '1', '2', '3']
+ option_labels: [Simple, Skewness, 2nd and 4th Moment, SVR]
+- id: msg_nsamples
+ label: Samples between SNR messages
+ dtype: int
+ default: '10000'
+- id: alpha
+ label: Filter Alpha
+ dtype: real
+ default: '0.001'
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: message
+ id: snr
+ optional: true
+- domain: message
+ id: signal
+ optional: true
+- domain: message
+ id: noise
+ optional: true
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.probe_mpsk_snr_est_c(${type}, ${msg_nsamples}, ${alpha})
+ callbacks:
+ - set_type(${type})
+ - set_msg_nsample(${msg_nsamples})
+ - set_alpha(${alpha})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_probe_mpsk_snr_est_c.xml b/gr-digital/grc/digital_probe_mpsk_snr_est_c.xml
deleted file mode 100644
index e49f7e7f56..0000000000
--- a/gr-digital/grc/digital_probe_mpsk_snr_est_c.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##MPSK SNR Estimator
-###################################################
- -->
-<block>
- <name>MPSK SNR Estimator Probe</name>
- <key>digital_probe_mpsk_snr_est_c</key>
- <import>from gnuradio import digital</import>
- <make>digital.probe_mpsk_snr_est_c($type, $msg_nsamples, $alpha)</make>
- <callback>set_type($type)</callback>
- <callback>set_msg_nsample($msg_nsamples)</callback>
- <callback>set_alpha($alpha)</callback>
- <param>
- <name>Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Simple</name>
- <key>0</key>
- </option>
- <option>
- <name>Skewness</name>
- <key>1</key>
- </option>
- <option>
- <name>2nd and 4th Moment</name>
- <key>2</key>
- </option>
- <option>
- <name>SVR</name>
- <key>3</key>
- </option>
- </param>
- <param>
- <name>Samples between SNR messages</name>
- <key>msg_nsamples</key>
- <value>10000</value>
- <type>int</type>
- </param>
- <param>
- <name>Filter Alpha</name>
- <key>alpha</key>
- <value>0.001</value>
- <type>real</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>snr</name>
- <type>message</type>
- <optional>1</optional>
- </source>
- <source>
- <name>signal</name>
- <type>message</type>
- <optional>1</optional>
- </source>
- <source>
- <name>noise</name>
- <type>message</type>
- <optional>1</optional>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_protocol_formatter_async.block.yml b/gr-digital/grc/digital_protocol_formatter_async.block.yml
new file mode 100644
index 0000000000..29975522ff
--- /dev/null
+++ b/gr-digital/grc/digital_protocol_formatter_async.block.yml
@@ -0,0 +1,26 @@
+id: digital_protocol_formatter_async
+label: Protocol Formatter (Async)
+
+parameters:
+- id: format
+ label: Format Obj.
+ dtype: raw
+
+inputs:
+- domain: message
+ id: in
+ optional: true
+
+outputs:
+- domain: message
+ id: header
+ optional: true
+- domain: message
+ id: payload
+ optional: true
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.protocol_formatter_async(${format})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_protocol_formatter_async.xml b/gr-digital/grc/digital_protocol_formatter_async.xml
deleted file mode 100644
index 52a67eca36..0000000000
--- a/gr-digital/grc/digital_protocol_formatter_async.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0"?>
-
-<block>
- <name>Protocol Formatter (Async)</name>
- <key>digital_protocol_formatter_async</key>
- <import>from gnuradio import digital</import>
- <make>digital.protocol_formatter_async($format)</make>
-
- <param>
- <name>Format Obj.</name>
- <key>format</key>
- <type>raw</type>
- </param>
-
- <sink>
- <name>in</name>
- <type>message</type>
- <optional>1</optional>
- </sink>
-
- <source>
- <name>header</name>
- <type>message</type>
- <optional>1</optional>
- </source>
-
- <source>
- <name>payload</name>
- <type>message</type>
- <optional>1</optional>
- </source>
-
-</block>
diff --git a/gr-digital/grc/digital_protocol_formatter_bb.block.yml b/gr-digital/grc/digital_protocol_formatter_bb.block.yml
new file mode 100644
index 0000000000..9141b52085
--- /dev/null
+++ b/gr-digital/grc/digital_protocol_formatter_bb.block.yml
@@ -0,0 +1,25 @@
+id: digital_protocol_formatter_bb
+label: Protocol Formatter
+
+parameters:
+- id: format
+ label: Format Obj.
+ dtype: raw
+- id: len_tag_key
+ label: Length Tag Name
+ dtype: string
+ default: '"packet_len"'
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.protocol_formatter_bb(${format}, ${len_tag_key})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_protocol_formatter_bb.xml b/gr-digital/grc/digital_protocol_formatter_bb.xml
deleted file mode 100644
index b37a791fa8..0000000000
--- a/gr-digital/grc/digital_protocol_formatter_bb.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-
-<block>
- <name>Protocol Formatter</name>
- <key>digital_protocol_formatter_bb</key>
- <import>from gnuradio import digital</import>
- <make>digital.protocol_formatter_bb($format, $len_tag_key)</make>
-
- <param>
- <name>Format Obj.</name>
- <key>format</key>
- <type>raw</type>
- </param>
-
- <param>
- <name>Length Tag Name</name>
- <key>len_tag_key</key>
- <value>"packet_len"</value>
- <type>string</type>
- </param>
-
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
-
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-
-</block>
diff --git a/gr-digital/grc/digital_protocol_parser_b.block.yml b/gr-digital/grc/digital_protocol_parser_b.block.yml
new file mode 100644
index 0000000000..b09e480863
--- /dev/null
+++ b/gr-digital/grc/digital_protocol_parser_b.block.yml
@@ -0,0 +1,22 @@
+id: digital_protocol_parser_b
+label: Protocol Parser
+
+parameters:
+- id: format
+ label: Format Obj.
+ dtype: raw
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: message
+ id: info
+ optional: true
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.protocol_parser_b(${format})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_protocol_parser_b.xml b/gr-digital/grc/digital_protocol_parser_b.xml
deleted file mode 100644
index 27fb15e05b..0000000000
--- a/gr-digital/grc/digital_protocol_parser_b.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-
-<block>
- <name>Protocol Parser</name>
- <key>digital_protocol_parser_b</key>
- <import>from gnuradio import digital</import>
- <make>digital.protocol_parser_b($format)</make>
-
- <param>
- <name>Format Obj.</name>
- <key>format</key>
- <type>raw</type>
- </param>
-
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
-
- <source>
- <name>info</name>
- <type>message</type>
- <optional>1</optional>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_psk_demod.block.yml b/gr-digital/grc/digital_psk_demod.block.yml
new file mode 100644
index 0000000000..fbb5d60005
--- /dev/null
+++ b/gr-digital/grc/digital_psk_demod.block.yml
@@ -0,0 +1,79 @@
+id: digital_psk_demod
+label: PSK Demod
+category: '[Core]/Deprecated'
+
+parameters:
+- id: constellation_points
+ label: Number of Constellation Points
+ dtype: int
+ default: '8'
+- id: differential
+ label: Differential Encoding
+ dtype: bool
+ default: 'True'
+ options: ['True', 'False']
+ option_labels: ['Yes', 'No']
+- id: samples_per_symbol
+ label: Samples/Symbol
+ dtype: int
+ default: '2'
+- id: excess_bw
+ label: Excess BW
+ dtype: real
+ default: '0.35'
+- id: freq_bw
+ label: Frequency BW
+ dtype: real
+ default: 6.28/100.0
+- id: timing_bw
+ label: Timing BW
+ dtype: real
+ default: 6.28/100.0
+- id: phase_bw
+ label: Phase BW
+ dtype: real
+ default: 6.28/100.0
+- id: mod_code
+ label: Gray Code
+ dtype: enum
+ options: ['"gray"', '"none"']
+ option_labels: ['Yes', 'No']
+- id: verbose
+ label: Verbose
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(verbose) == 'False' else 'none') }
+- id: log
+ label: Log
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(log) == 'False' else 'none') }
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: |-
+ digital.psk.psk_demod(
+ constellation_points=${constellation_points},
+ differential=${differential},
+ samples_per_symbol=${samples_per_symbol},
+ excess_bw=${excess_bw},
+ phase_bw=${phase_bw},
+ timing_bw=${timing_bw},
+ mod_code=${mod_code},
+ verbose=${verbose},
+ log=${log},
+ )
+
+file_format: 1
diff --git a/gr-digital/grc/digital_psk_demod.xml b/gr-digital/grc/digital_psk_demod.xml
deleted file mode 100644
index 02beed01ac..0000000000
--- a/gr-digital/grc/digital_psk_demod.xml
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- Copyright 2009,2010,2011 Free Software Foundation, Inc.
-
- This file is part of GNU Radio
-
- GNU Radio is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GNU Radio is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Radio; see the file COPYING. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street,
- Boston, MA 02110-1301, USA.
--->
-
-<!--
-###################################################
-##PSK Demod
-###################################################
- -->
-<block>
- <name>PSK Demod</name>
- <key>digital_psk_demod</key>
- <category>[Core]/Deprecated</category>
- <import>from gnuradio import digital</import>
- <make>digital.psk.psk_demod(
- constellation_points=$constellation_points,
- differential=$differential,
- samples_per_symbol=$samples_per_symbol,
- excess_bw=$excess_bw,
- phase_bw=$phase_bw,
- timing_bw=$timing_bw,
- mod_code=$mod_code,
- verbose=$verbose,
- log=$log,
- )</make>
- <param>
- <name>Number of Constellation Points</name>
- <key>constellation_points</key>
- <value>8</value>
- <type>int</type>
- </param>
- <param>
- <name>Differential Encoding</name>
- <key>differential</key>
- <value>True</value>
- <type>bool</type>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Samples/Symbol</name>
- <key>samples_per_symbol</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>Excess BW</name>
- <key>excess_bw</key>
- <value>0.35</value>
- <type>real</type>
- </param>
- <param>
- <name>Frequency BW</name>
- <key>freq_bw</key>
- <value>6.28/100.0</value>
- <type>real</type>
- </param>
- <param>
- <name>Timing BW</name>
- <key>timing_bw</key>
- <value>6.28/100.0</value>
- <type>real</type>
- </param>
- <param>
- <name>Phase BW</name>
- <key>phase_bw</key>
- <value>6.28/100.0</value>
- <type>real</type>
- </param>
- <param>
- <name>Gray Code</name>
- <key>mod_code</key>
- <type>enum</type>
- <option>
- <name>Yes</name>
- <key>"gray"</key>
- </option>
- <option>
- <name>No</name>
- <key>"none"</key>
- </option>
- </param>
- <param>
- <name>Verbose</name>
- <key>verbose</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Log</name>
- <key>log</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_psk_mod.block.yml b/gr-digital/grc/digital_psk_mod.block.yml
new file mode 100644
index 0000000000..9145718fa7
--- /dev/null
+++ b/gr-digital/grc/digital_psk_mod.block.yml
@@ -0,0 +1,65 @@
+id: digital_psk_mod
+label: PSK Mod
+category: '[Core]/Deprecated'
+
+parameters:
+- id: constellation_points
+ label: Number of Constellation Points
+ dtype: int
+ default: '8'
+- id: mod_code
+ label: Gray Code
+ dtype: enum
+ options: ['"gray"', '"none"']
+ option_labels: ['Yes', 'No']
+- id: differential
+ label: Differential Encoding
+ dtype: bool
+ default: 'True'
+ options: ['True', 'False']
+ option_labels: ['Yes', 'No']
+- id: samples_per_symbol
+ label: Samples/Symbol
+ dtype: int
+ default: '2'
+- id: excess_bw
+ label: Excess BW
+ dtype: real
+ default: '0.35'
+- id: verbose
+ label: Verbose
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(verbose) == 'False' else 'none') }
+- id: log
+ label: Log
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(log) == 'False' else 'none') }
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: complex
+
+templates:
+ imports: from gnuradio import digital
+ make: |-
+ digital.psk.psk_mod(
+ constellation_points=${constellation_points},
+ mod_code=${mod_code},
+ differential=${differential},
+ samples_per_symbol=${samples_per_symbol},
+ excess_bw=${excess_bw},
+ verbose=${verbose},
+ log=${log},
+ )
+
+file_format: 1
diff --git a/gr-digital/grc/digital_psk_mod.xml b/gr-digital/grc/digital_psk_mod.xml
deleted file mode 100644
index 43e60562ee..0000000000
--- a/gr-digital/grc/digital_psk_mod.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- Copyright 2009,2010,2011 Free Software Foundation, Inc.
-
- This file is part of GNU Radio
-
- GNU Radio is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GNU Radio is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Radio; see the file COPYING. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street,
- Boston, MA 02110-1301, USA.
--->
-
-<!--
-###################################################
-##PSK Mod
-###################################################
- -->
-<block>
- <name>PSK Mod</name>
- <key>digital_psk_mod</key>
- <category>[Core]/Deprecated</category>
- <import>from gnuradio import digital</import>
- <make>digital.psk.psk_mod(
- constellation_points=$constellation_points,
- mod_code=$mod_code,
- differential=$differential,
- samples_per_symbol=$samples_per_symbol,
- excess_bw=$excess_bw,
- verbose=$verbose,
- log=$log,
- )</make>
- <param>
- <name>Number of Constellation Points</name>
- <key>constellation_points</key>
- <value>8</value>
- <type>int</type>
- </param>
- <param>
- <name>Gray Code</name>
- <key>mod_code</key>
- <type>enum</type>
- <option>
- <name>Yes</name>
- <key>"gray"</key>
- </option>
- <option>
- <name>No</name>
- <key>"none"</key>
- </option>
- </param>
- <param>
- <name>Differential Encoding</name>
- <key>differential</key>
- <value>True</value>
- <type>bool</type>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Samples/Symbol</name>
- <key>samples_per_symbol</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>Excess BW</name>
- <key>excess_bw</key>
- <value>0.35</value>
- <type>real</type>
- </param>
- <param>
- <name>Verbose</name>
- <key>verbose</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Log</name>
- <key>log</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_qam_demod.block.yml b/gr-digital/grc/digital_qam_demod.block.yml
new file mode 100644
index 0000000000..5ed8f4dd1d
--- /dev/null
+++ b/gr-digital/grc/digital_qam_demod.block.yml
@@ -0,0 +1,80 @@
+id: digital_qam_demod
+label: QAM Demod
+category: '[Core]/Deprecated'
+
+parameters:
+- id: constellation_points
+ label: Number of Constellation Points
+ dtype: int
+ default: '16'
+- id: differential
+ label: Differential Encoding
+ dtype: bool
+ default: 'True'
+ options: ['True', 'False']
+ option_labels: ['Yes', 'No']
+- id: samples_per_symbol
+ label: Samples/Symbol
+ dtype: int
+ default: '2'
+- id: excess_bw
+ label: Excess BW
+ dtype: real
+ default: '0.35'
+- id: freq_bw
+ label: Frequency BW
+ dtype: real
+ default: 6.28/100.0
+- id: timing_bw
+ label: Timing BW
+ dtype: real
+ default: 6.28/100.0
+- id: phase_bw
+ label: Phase BW
+ dtype: real
+ default: 6.28/100.0
+- id: mod_code
+ label: Gray Code
+ dtype: enum
+ options: ['"gray"', '"none"']
+ option_labels: ['Yes', 'No']
+- id: verbose
+ label: Verbose
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(verbose) == 'False' else 'none') }
+- id: log
+ label: Log
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(log) == 'False' else 'none') }
+
+inputs:
+- domain: stream
+ dtype: complex
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: |-
+ digital.qam.qam_demod(
+ constellation_points=${constellation_points},
+ differential=${differential},
+ samples_per_symbol=${samples_per_symbol},
+ excess_bw=${excess_bw},
+ freq_bw=${freq_bw},
+ timing_bw=${timing_bw},
+ phase_bw=${phase_bw},
+ mod_code=${mod_code},
+ verbose=${verbose},
+ log=${log},
+ )
+
+file_format: 1
diff --git a/gr-digital/grc/digital_qam_demod.xml b/gr-digital/grc/digital_qam_demod.xml
deleted file mode 100644
index c9a6c6aa4b..0000000000
--- a/gr-digital/grc/digital_qam_demod.xml
+++ /dev/null
@@ -1,147 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- Copyright 2009,2010,2011 Free Software Foundation, Inc.
-
- This file is part of GNU Radio
-
- GNU Radio is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GNU Radio is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Radio; see the file COPYING. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street,
- Boston, MA 02110-1301, USA.
--->
-
-<!--
-###################################################
-##QAM Demod
-###################################################
- -->
-<block>
- <name>QAM Demod</name>
- <key>digital_qam_demod</key>
- <category>[Core]/Deprecated</category>
- <import>from gnuradio import digital</import>
- <make>digital.qam.qam_demod(
- constellation_points=$constellation_points,
- differential=$differential,
- samples_per_symbol=$samples_per_symbol,
- excess_bw=$excess_bw,
- freq_bw=$freq_bw,
- timing_bw=$timing_bw,
- phase_bw=$phase_bw,
- mod_code=$mod_code,
- verbose=$verbose,
- log=$log,
- )</make>
- <param>
- <name>Number of Constellation Points</name>
- <key>constellation_points</key>
- <value>16</value>
- <type>int</type>
- </param>
- <param>
- <name>Differential Encoding</name>
- <key>differential</key>
- <value>True</value>
- <type>bool</type>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Samples/Symbol</name>
- <key>samples_per_symbol</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>Excess BW</name>
- <key>excess_bw</key>
- <value>0.35</value>
- <type>real</type>
- </param>
- <param>
- <name>Frequency BW</name>
- <key>freq_bw</key>
- <value>6.28/100.0</value>
- <type>real</type>
- </param>
- <param>
- <name>Timing BW</name>
- <key>timing_bw</key>
- <value>6.28/100.0</value>
- <type>real</type>
- </param>
- <param>
- <name>Phase BW</name>
- <key>phase_bw</key>
- <value>6.28/100.0</value>
- <type>real</type>
- </param>
- <param>
- <name>Gray Code</name>
- <key>mod_code</key>
- <type>enum</type>
- <option>
- <name>Yes</name>
- <key>"gray"</key>
- </option>
- <option>
- <name>No</name>
- <key>"none"</key>
- </option>
- </param>
- <param>
- <name>Verbose</name>
- <key>verbose</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Log</name>
- <key>log</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_qam_mod.block.yml b/gr-digital/grc/digital_qam_mod.block.yml
new file mode 100644
index 0000000000..6cfcc2966e
--- /dev/null
+++ b/gr-digital/grc/digital_qam_mod.block.yml
@@ -0,0 +1,65 @@
+id: digital_qam_mod
+label: QAM Mod
+category: '[Core]/Deprecated'
+
+parameters:
+- id: constellation_points
+ label: Number of Constellation Points
+ dtype: int
+ default: '16'
+- id: mod_code
+ label: Gray Code
+ dtype: enum
+ options: ['"gray"', '"none"']
+ option_labels: ['Yes', 'No']
+- id: differential
+ label: Differential Encoding
+ dtype: bool
+ default: 'True'
+ options: ['True', 'False']
+ option_labels: ['Yes', 'No']
+- id: samples_per_symbol
+ label: Samples/Symbol
+ dtype: int
+ default: '2'
+- id: excess_bw
+ label: Excess BW
+ dtype: real
+ default: '0.35'
+- id: verbose
+ label: Verbose
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(verbose) == 'False' else 'none') }
+- id: log
+ label: Log
+ dtype: bool
+ default: 'False'
+ options: ['True', 'False']
+ option_labels: ['On', 'Off']
+ hide: ${ ('part' if str(log) == 'False' else 'none') }
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: complex
+
+templates:
+ imports: from gnuradio import digital
+ make: |-
+ digital.qam.qam_mod(
+ constellation_points=${constellation_points},
+ mod_code=${mod_code},
+ differential=${differential},
+ samples_per_symbol=${samples_per_symbol},
+ excess_bw=${excess_bw},
+ verbose=${verbose},
+ log=${log},
+ )
+
+file_format: 1
diff --git a/gr-digital/grc/digital_qam_mod.xml b/gr-digital/grc/digital_qam_mod.xml
deleted file mode 100644
index 5c3d5139d2..0000000000
--- a/gr-digital/grc/digital_qam_mod.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- Copyright 2009,2010,2011 Free Software Foundation, Inc.
-
- This file is part of GNU Radio
-
- GNU Radio is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GNU Radio is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Radio; see the file COPYING. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street,
- Boston, MA 02110-1301, USA.
--->
-
-<!--
-###################################################
-##QAM Mod
-###################################################
- -->
-<block>
- <name>QAM Mod</name>
- <key>digital_qam_mod</key>
- <category>[Core]/Deprecated</category>
- <import>from gnuradio import digital</import>
- <make>digital.qam.qam_mod(
- constellation_points=$constellation_points,
- mod_code=$mod_code,
- differential=$differential,
- samples_per_symbol=$samples_per_symbol,
- excess_bw=$excess_bw,
- verbose=$verbose,
- log=$log,
- )</make>
- <param>
- <name>Number of Constellation Points</name>
- <key>constellation_points</key>
- <value>16</value>
- <type>int</type>
- </param>
- <param>
- <name>Gray Code</name>
- <key>mod_code</key>
- <type>enum</type>
- <option>
- <name>Yes</name>
- <key>"gray"</key>
- </option>
- <option>
- <name>No</name>
- <key>"none"</key>
- </option>
- </param>
- <param>
- <name>Differential Encoding</name>
- <key>differential</key>
- <value>True</value>
- <type>bool</type>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Samples/Symbol</name>
- <key>samples_per_symbol</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>Excess BW</name>
- <key>excess_bw</key>
- <value>0.35</value>
- <type>real</type>
- </param>
- <param>
- <name>Verbose</name>
- <key>verbose</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Log</name>
- <key>log</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_scrambler_bb.block.yml b/gr-digital/grc/digital_scrambler_bb.block.yml
new file mode 100644
index 0000000000..fb8b3cca1f
--- /dev/null
+++ b/gr-digital/grc/digital_scrambler_bb.block.yml
@@ -0,0 +1,30 @@
+id: digital_scrambler_bb
+label: Scrambler
+
+parameters:
+- id: mask
+ label: Mask
+ dtype: hex
+ default: '0x8A'
+- id: seed
+ label: Seed
+ dtype: hex
+ default: '0x7F'
+- id: len
+ label: Length
+ dtype: int
+ default: '7'
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.scrambler_bb(${mask}, ${seed}, ${len})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_scrambler_bb.xml b/gr-digital/grc/digital_scrambler_bb.xml
deleted file mode 100644
index 9c40b49f64..0000000000
--- a/gr-digital/grc/digital_scrambler_bb.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Descrambler
-###################################################
- -->
-<block>
- <name>Scrambler</name>
- <key>digital_scrambler_bb</key>
- <import>from gnuradio import digital</import>
- <make>digital.scrambler_bb($mask, $seed, $len)</make>
- <param>
- <name>Mask</name>
- <key>mask</key>
- <value>0x8A</value>
- <type>hex</type>
- </param>
- <param>
- <name>Seed</name>
- <key>seed</key>
- <value>0x7F</value>
- <type>hex</type>
- </param>
- <param>
- <name>Length</name>
- <key>len</key>
- <value>7</value>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_simple_correlator.block.yml b/gr-digital/grc/digital_simple_correlator.block.yml
new file mode 100644
index 0000000000..aae6139525
--- /dev/null
+++ b/gr-digital/grc/digital_simple_correlator.block.yml
@@ -0,0 +1,21 @@
+id: digital_simple_correlator
+label: Simple Correlator
+
+parameters:
+- id: payload_bytesize
+ label: Payload Byte Size
+ dtype: int
+
+inputs:
+- domain: stream
+ dtype: float
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.simple_correlator(${payload_bytesize})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_simple_correlator.xml b/gr-digital/grc/digital_simple_correlator.xml
deleted file mode 100644
index 3b70e59b12..0000000000
--- a/gr-digital/grc/digital_simple_correlator.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Simple Correlator
-###################################################
- -->
-<block>
- <name>Simple Correlator</name>
- <key>digital_simple_correlator</key>
- <import>from gnuradio import digital</import>
- <make>digital.simple_correlator($payload_bytesize)</make>
- <param>
- <name>Payload Byte Size</name>
- <key>payload_bytesize</key>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>float</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_simple_framer.block.yml b/gr-digital/grc/digital_simple_framer.block.yml
new file mode 100644
index 0000000000..f711948981
--- /dev/null
+++ b/gr-digital/grc/digital_simple_framer.block.yml
@@ -0,0 +1,21 @@
+id: digital_simple_framer
+label: Simple Framer
+
+parameters:
+- id: payload_bytesize
+ label: Payload Byte Size
+ dtype: int
+
+inputs:
+- domain: stream
+ dtype: byte
+
+outputs:
+- domain: stream
+ dtype: byte
+
+templates:
+ imports: from gnuradio import digital
+ make: digital.simple_framer(${payload_bytesize})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_simple_framer.xml b/gr-digital/grc/digital_simple_framer.xml
deleted file mode 100644
index 2d57222f3b..0000000000
--- a/gr-digital/grc/digital_simple_framer.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Simple Framer
-###################################################
- -->
-<block>
- <name>Simple Framer</name>
- <key>digital_simple_framer</key>
- <import>from gnuradio import digital</import>
- <make>digital.simple_framer($payload_bytesize)</make>
- <param>
- <name>Payload Byte Size</name>
- <key>payload_bytesize</key>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_symbol_sync_xx.block.yml b/gr-digital/grc/digital_symbol_sync_xx.block.yml
new file mode 100644
index 0000000000..ec63825127
--- /dev/null
+++ b/gr-digital/grc/digital_symbol_sync_xx.block.yml
@@ -0,0 +1,108 @@
+id: digital_symbol_sync_xx
+label: Symbol Sync
+category: '[Core]/Synchronizers'
+
+parameters:
+- id: type
+ label: I/O Type
+ dtype: enum
+ options: [cc, ff]
+ option_labels: [Complex, Float]
+ option_attributes:
+ input: [complex, float]
+ output: [complex, float]
+ hide: part
+- id: ted_type
+ label: Timing Error Detector
+ dtype: enum
+ options: [digital.TED_MUELLER_AND_MULLER, digital.TED_MOD_MUELLER_AND_MULLER,
+ digital.TED_ZERO_CROSSING, digital.TED_GARDNER, digital.TED_EARLY_LATE, digital.TED_DANDREA_AND_MENGALI_GEN_MSK,
+ digital.TED_MENGALI_AND_DANDREA_GMSK, digital.TED_SIGNAL_TIMES_SLOPE_ML, digital.TED_SIGNUM_TIMES_SLOPE_ML]
+ option_labels: ["Mueller and M\xFCller", "Modified Mueller and M\xFCller", Zero
+ Crossing, Gardner, Early-Late, D'Andrea and Mengali Gen MSK, Mengali and
+ D'Andrea GMSK, 'y[n]y''[n] Maximum Likelyhood', 'sgn(y[n])y''[n] Maximum
+ Likelyhood']
+ option_attributes:
+ hide_constellation: [part, part, part, all, all, all, all, all, all]
+- id: constellation
+ label: TED Slicer Constellation
+ dtype: raw
+ default: digital.constellation_bpsk().base()
+ hide: ${ ted_type.hide_constellation }
+- id: sps
+ label: Samples per Symbol
+ dtype: real
+ default: sps
+- id: ted_gain
+ label: Expected TED Gain
+ dtype: real
+ default: '1.0'
+- id: loop_bw
+ label: Loop Bandwidth
+ dtype: real
+ default: '0.045'
+- id: damping
+ label: Damping Factor
+ dtype: real
+ default: '1.0'
+- id: max_dev
+ label: Maximum Deviation
+ dtype: real
+ default: '1.5'
+- id: osps
+ label: Output Samples/Symbol
+ dtype: int
+ default: '1'
+- id: resamp_type
+ label: Interpolating Resampler
+ dtype: enum
+ options: [digital.IR_MMSE_8TAP, digital.IR_PFB_NO_MF, digital.IR_PFB_MF]
+ option_labels: ['MMSE, 8 tap FIR', 'Polyphase Filterbank, MMSE', 'Polyphase Filterbank,
+ MF']
+ option_attributes:
+ hide_nfilters: [all, '', '']
+ hide_pfb_mf_taps: [all, all, '']
+- id: nfilters
+ label: Filterbank Arms
+ dtype: int
+ default: '128'
+ hide: ${ resamp_type.hide_nfilters }
+- id: pfb_mf_taps
+ label: PFB MF Taps
+ dtype: real_vector
+ default: '[]'
+ hide: ${ resamp_type.hide_pfb_mf_taps }
+
+inputs:
+- domain: stream
+ dtype: ${ type.input }
+
+outputs:
+- domain: stream
+ dtype: ${ type.output }
+- label: error
+ domain: stream
+ dtype: float
+ optional: true
+- label: T_inst
+ domain: stream
+ dtype: float
+ optional: true
+- label: T_avg
+ domain: stream
+ dtype: float
+ optional: true
+
+templates:
+ imports: |-
+ from gnuradio import digital
+ from gnuradio import filter
+ make: digital.symbol_sync_${type}(${ted_type}, ${sps}, ${loop_bw}, ${damping},
+ ${ted_gain}, ${max_dev}, ${osps}, ${constellation}, ${resamp_type}, ${nfilters},
+ ${pfb_mf_taps})
+ callbacks:
+ - set_loop_bandwidth(${loop_bw})
+ - set_damping_factor(${damping})
+ - set_ted_gain(${ted_gain})
+
+file_format: 1
diff --git a/gr-digital/grc/digital_symbol_sync_xx.xml b/gr-digital/grc/digital_symbol_sync_xx.xml
deleted file mode 100644
index ffd2f5daff..0000000000
--- a/gr-digital/grc/digital_symbol_sync_xx.xml
+++ /dev/null
@@ -1,207 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Copyright (C) 2016-2017 Free Software Foundation, Inc.
-
- This file is part of GNU Radio.
-
- GNU Radio is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GNU Radio is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Radio; see the file COPYING. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street,
- Boston, MA 02110-1301, USA.
- -->
-
-<block>
- <name>Symbol Sync</name>
- <key>digital_symbol_sync_xx</key>
- <category>[Core]/Synchronizers</category>
- <import>from gnuradio import digital</import>
- <import>from gnuradio import filter</import>
- <make>digital.symbol_sync_$(type)($ted_type, $sps, $loop_bw, $damping, $ted_gain, $max_dev, $osps, $constellation, $resamp_type, $nfilters, $pfb_mf_taps)</make>
-
- <callback>set_loop_bandwidth($loop_bw)</callback>
- <callback>set_damping_factor($damping)</callback>
- <callback>set_ted_gain($ted_gain)</callback>
-
- <param>
- <name>I/O Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Complex</name>
- <key>cc</key>
- <opt>input:complex</opt>
- <opt>output:complex</opt>
- </option>
- <option>
- <name>Float</name>
- <key>ff</key>
- <opt>input:float</opt>
- <opt>output:float</opt>
- </option>
- </param>
- <param>
- <name>Timing Error Detector</name>
- <key>ted_type</key>
- <type>enum</type>
- <option>
- <name>Mueller and Müller</name>
- <key>digital.TED_MUELLER_AND_MULLER</key>
- <opt>hide_constellation:part</opt>
- </option>
- <option>
- <name>Modified Mueller and Müller</name>
- <key>digital.TED_MOD_MUELLER_AND_MULLER</key>
- <opt>hide_constellation:part</opt>
- </option>
- <option>
- <name>Zero Crossing</name>
- <key>digital.TED_ZERO_CROSSING</key>
- <opt>hide_constellation:part</opt>
- </option>
- <option>
- <name>Gardner</name>
- <key>digital.TED_GARDNER</key>
- <opt>hide_constellation:all</opt>
- </option>
- <option>
- <name>Early-Late</name>
- <key>digital.TED_EARLY_LATE</key>
- <opt>hide_constellation:all</opt>
- </option>
- <option>
- <name>D'Andrea and Mengali Gen MSK</name>
- <key>digital.TED_DANDREA_AND_MENGALI_GEN_MSK</key>
- <opt>hide_constellation:all</opt>
- </option>
- <option>
- <name>Mengali and D'Andrea GMSK</name>
- <key>digital.TED_MENGALI_AND_DANDREA_GMSK</key>
- <opt>hide_constellation:all</opt>
- </option>
- <option>
- <name>y[n]y'[n] Maximum Likelyhood</name>
- <key>digital.TED_SIGNAL_TIMES_SLOPE_ML</key>
- <opt>hide_constellation:all</opt>
- </option>
- <option>
- <name>sgn(y[n])y'[n] Maximum Likelyhood</name>
- <key>digital.TED_SIGNUM_TIMES_SLOPE_ML</key>
- <opt>hide_constellation:all</opt>
- </option>
- </param>
- <param>
- <name>TED Slicer Constellation</name>
- <key>constellation</key>
- <value>digital.constellation_bpsk().base()</value>
- <type>raw</type>
- <hide>$ted_type.hide_constellation</hide>
- </param>
- <param>
- <name>Samples per Symbol</name>
- <key>sps</key>
- <value>sps</value>
- <type>real</type>
- </param>
- <param>
- <name>Expected TED Gain</name>
- <key>ted_gain</key>
- <value>1.0</value>
- <type>real</type>
- </param>
- <param>
- <name>Loop Bandwidth</name>
- <key>loop_bw</key>
- <value>0.045</value>
- <type>real</type>
- </param>
- <param>
- <name>Damping Factor</name>
- <key>damping</key>
- <value>1.0</value>
- <type>real</type>
- </param>
- <param>
- <name>Maximum Deviation</name>
- <key>max_dev</key>
- <value>1.5</value>
- <type>real</type>
- </param>
- <param>
- <name>Output Samples/Symbol</name>
- <key>osps</key>
- <value>1</value>
- <type>int</type>
- </param>
- <param>
- <name>Interpolating Resampler</name>
- <key>resamp_type</key>
- <type>enum</type>
- <option>
- <name>MMSE, 8 tap FIR</name>
- <key>digital.IR_MMSE_8TAP</key>
- <opt>hide_nfilters:all</opt>
- <opt>hide_pfb_mf_taps:all</opt>
- </option>
- <option>
- <name>Polyphase Filterbank, MMSE</name>
- <key>digital.IR_PFB_NO_MF</key>
- <opt>hide_nfilters:</opt>
- <opt>hide_pfb_mf_taps:all</opt>
- </option>
- <option>
- <name>Polyphase Filterbank, MF</name>
- <key>digital.IR_PFB_MF</key>
- <opt>hide_nfilters:</opt>
- <opt>hide_pfb_mf_taps:</opt>
- </option>
- </param>
- <param>
- <name>Filterbank Arms</name>
- <key>nfilters</key>
- <value>128</value>
- <type>int</type>
- <hide>$resamp_type.hide_nfilters</hide>
- </param>
- <param>
- <name>PFB MF Taps</name>
- <key>pfb_mf_taps</key>
- <value>[]</value>
- <type>real_vector</type>
- <hide>$resamp_type.hide_pfb_mf_taps</hide>
- </param>
-
- <sink>
- <name>in</name>
- <type>$type.input</type>
- </sink>
-
- <source>
- <name>out</name>
- <type>$type.output</type>
- </source>
- <source>
- <name>error</name>
- <type>float</type>
- <optional>1</optional>
- </source>
- <source>
- <name>T_inst</name>
- <type>float</type>
- <optional>1</optional>
- </source>
- <source>
- <name>T_avg</name>
- <type>float</type>
- <optional>1</optional>
- </source>
-</block>
diff --git a/gr-digital/grc/variable_header_format_default.block.yml b/gr-digital/grc/variable_header_format_default.block.yml
new file mode 100644
index 0000000000..d326eb2e86
--- /dev/null
+++ b/gr-digital/grc/variable_header_format_default.block.yml
@@ -0,0 +1,25 @@
+id: variable_header_format_default
+label: Default Header Format Obj.
+
+parameters:
+- id: access_code
+ label: Access Code
+ dtype: string
+ default: '0'
+- id: threshold
+ label: Threshold
+ dtype: int
+ default: '0'
+- id: bps
+ label: Payload Bits per Symbol
+ dtype: int
+ default: '1'
+value: ${ digital.header_format_default(access_code, threshold, bps) }
+
+templates:
+ imports: from gnuradio import digital
+ var_make: "\n% if int(access_code)==0 #:\nself.${id} = ${id} = digital.header_format_default(digital.packet_utils.default_access_code,\
+ \ ${threshold}, ${bps})\n% else:\nself.${id} = ${id} = digital.header_format_default(${access_code},\
+ \ ${threshold}, ${bps})\n% endif\n "
+
+file_format: 1
diff --git a/gr-digital/grc/variable_header_format_default.xml b/gr-digital/grc/variable_header_format_default.xml
deleted file mode 100644
index 88727600ed..0000000000
--- a/gr-digital/grc/variable_header_format_default.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-# header_format_default object
-###################################################
- -->
-<block>
- <name>Default Header Format Obj.</name>
- <key>variable_header_format_default</key>
- <import>from gnuradio import digital</import>
- <var_make>
-#if int($access_code())==0 #
-self.$(id) = $(id) = digital.header_format_default(digital.packet_utils.default_access_code, $threshold, $bps)
-#else
-self.$(id) = $(id) = digital.header_format_default($access_code, $threshold, $bps)
-#end if
- </var_make>
- <var_value>digital.header_format_default($access_code, $threshold, $bps)</var_value>
- <make></make>
-
- <param>
- <name>Access Code</name>
- <key>access_code</key>
- <value>0</value>
- <type>string</type>
- </param>
-
- <param>
- <name>Threshold</name>
- <key>threshold</key>
- <value>0</value>
- <type>int</type>
- </param>
-
- <param>
- <name>Payload Bits per Symbol</name>
- <key>bps</key>
- <value>1</value>
- <type>int</type>
- </param>
-
-</block>
diff --git a/gr-digital/python/digital/CMakeLists.txt b/gr-digital/python/digital/CMakeLists.txt
index 8f88948a2e..e9d58491c4 100644
--- a/gr-digital/python/digital/CMakeLists.txt
+++ b/gr-digital/python/digital/CMakeLists.txt
@@ -78,6 +78,6 @@ if(ENABLE_TESTING)
file(GLOB py_qa_test_files "qa_*.py")
foreach(py_qa_test_file ${py_qa_test_files})
get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE)
- GR_ADD_TEST(${py_qa_test_name} ${QA_PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file})
+ GR_ADD_TEST(${py_qa_test_name} ${QA_PYTHON_EXECUTABLE} -B ${py_qa_test_file})
endforeach(py_qa_test_file)
endif(ENABLE_TESTING)
diff --git a/gr-digital/python/digital/__init__.py b/gr-digital/python/digital/__init__.py
index 79b740644d..90aa413a25 100644
--- a/gr-digital/python/digital/__init__.py
+++ b/gr-digital/python/digital/__init__.py
@@ -1,59 +1,63 @@
# Copyright 2011-2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
'''
Blocks and utilities for digital modulation and demodulation.
'''
+from __future__ import absolute_import
+from __future__ import unicode_literals
+
# The presence of this file turns this directory into a Python package
import os
try:
- from digital_swig import *
+ from .digital_swig import *
except ImportError:
dirname, filename = os.path.split(os.path.abspath(__file__))
__path__.append(os.path.join(dirname, "..", "..", "swig"))
- from digital_swig import *
-from psk import *
-from qam import *
-from qamlike import *
-from bpsk import *
-from qpsk import *
-from gmsk import *
-from gfsk import *
-from cpm import *
-from pkt import *
-from crc import *
-from modulation_utils import *
-from ofdm import *
-from ofdm_receiver import *
-from ofdm_sync_fixed import *
-from ofdm_sync_ml import *
-from ofdm_sync_pnac import *
-from ofdm_sync_pn import *
-from ofdm_txrx import ofdm_tx, ofdm_rx
-from soft_dec_lut_gen import *
-from psk_constellations import *
-from qam_constellations import *
-from constellation_map_generator import *
+ from .digital_swig import *
+
+from .psk import *
+from .qam import *
+from .qamlike import *
+from .bpsk import *
+from .qpsk import *
+from .gmsk import *
+from .gfsk import *
+from .cpm import *
+from .pkt import *
+from .crc import *
+from .modulation_utils import *
+from .ofdm import *
+from .ofdm_receiver import *
+from .ofdm_sync_fixed import *
+from .ofdm_sync_ml import *
+from .ofdm_sync_pnac import *
+from .ofdm_sync_pn import *
+from .ofdm_txrx import ofdm_tx, ofdm_rx
+from .soft_dec_lut_gen import *
+from .psk_constellations import *
+from .qam_constellations import *
+from .constellation_map_generator import *
-import packet_utils
-import ofdm_packet_utils
+from . import packet_utils
+from . import ofdm_packet_utils
diff --git a/gr-digital/python/digital/bpsk.py b/gr-digital/python/digital/bpsk.py
index 2ecaac3386..6193622be8 100644
--- a/gr-digital/python/digital/bpsk.py
+++ b/gr-digital/python/digital/bpsk.py
@@ -23,14 +23,17 @@
BPSK modulation and demodulation.
"""
+from __future__ import absolute_import
+from __future__ import unicode_literals
+
from math import pi, log
from cmath import exp
from gnuradio import gr
from gnuradio.digital.generic_mod_demod import generic_mod, generic_demod
from gnuradio.digital.generic_mod_demod import shared_mod_args, shared_demod_args
-import digital_swig
-import modulation_utils
+from . import digital_swig
+from . import modulation_utils
# /////////////////////////////////////////////////////////////////////////////
# BPSK constellation
diff --git a/gr-digital/python/digital/constellation_map_generator.py b/gr-digital/python/digital/constellation_map_generator.py
index 1dedd81280..bd4158194f 100644
--- a/gr-digital/python/digital/constellation_map_generator.py
+++ b/gr-digital/python/digital/constellation_map_generator.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import unicode_literals
def constellation_map_generator(basis_cpoints, basis_symbols, k, pi):
'''
Uses the a basis constellation provided (e.g., from
diff --git a/gr-digital/python/digital/cpm.py b/gr-digital/python/digital/cpm.py
index 322c3f0bfc..0752f01d66 100644
--- a/gr-digital/python/digital/cpm.py
+++ b/gr-digital/python/digital/cpm.py
@@ -1,37 +1,44 @@
#
-# CPM modulation and demodulation.
+# CPM modulation and demodulation.
#
#
# Copyright 2005-2007,2011 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import unicode_literals
# See gnuradio-examples/python/digital for examples
+
+from math import pi
+import numpy
+
from gnuradio import gr, filter
from gnuradio import analog
from gnuradio import blocks
-from math import pi
-import numpy
+from . import digital_swig
+from . import modulation_utils
-import digital_swig
-import modulation_utils
# default values (used in __init__ and add_options)
_def_samples_per_symbol = 2
@@ -53,16 +60,16 @@ _def_log = False
class cpm_mod(gr.hier_block2):
"""
Hierarchical block for Continuous Phase modulation.
-
+
The input is a byte stream (unsigned char) representing packed
bits and the output is the complex modulated signal at baseband.
-
+
See Proakis for definition of generic CPM signals:
s(t)=exp(j phi(t))
phi(t)= 2 pi h int_0^t f(t') dt'
f(t)=sum_k a_k g(t-kT)
(normalizing assumption: int_0^infty g(t) dt = 1/2)
-
+
Args:
samples_per_symbol: samples per baud >= 2 (integer)
bits_per_symbol: bits per symbol (integer)
@@ -76,21 +83,21 @@ class cpm_mod(gr.hier_block2):
debug: Print modulation data to files? (boolean)
"""
- def __init__(self,
+ def __init__(self,
samples_per_symbol=_def_samples_per_symbol,
bits_per_symbol=_def_bits_per_symbol,
h_numerator=_def_h_numerator,
h_denominator=_def_h_denominator,
cpm_type=_def_cpm_type,
- bt=_def_bt,
- symbols_per_pulse=_def_symbols_per_pulse,
+ bt=_def_bt,
+ symbols_per_pulse=_def_symbols_per_pulse,
generic_taps=_def_generic_taps,
verbose=_def_verbose,
log=_def_log):
- gr.hier_block2.__init__(self, "cpm_mod",
- gr.io_signature(1, 1, gr.sizeof_char), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
+ gr.hier_block2.__init__(self, "cpm_mod",
+ gr.io_signature(1, 1, gr.sizeof_char), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
self._samples_per_symbol = samples_per_symbol
self._bits_per_symbol = bits_per_symbol
@@ -99,29 +106,29 @@ class cpm_mod(gr.hier_block2):
self._cpm_type = cpm_type
self._bt=bt
if cpm_type == 0 or cpm_type == 2 or cpm_type == 3: # CPFSK, RC, Generic
- self._symbols_per_pulse = symbols_per_pulse
+ self._symbols_per_pulse = symbols_per_pulse
elif cpm_type == 1: # GMSK
- self._symbols_per_pulse = 4
+ self._symbols_per_pulse = 4
else:
- raise TypeError, ("cpm_type must be an integer in {0,1,2,3}, is %r" % (cpm_type,))
+ raise TypeError("cpm_type must be an integer in {0,1,2,3}, is %r" % (cpm_type,))
self._generic_taps=numpy.array(generic_taps)
if samples_per_symbol < 2:
- raise TypeError, ("samples_per_symbol must be >= 2, is %r" % (samples_per_symbol,))
+ raise TypeError("samples_per_symbol must be >= 2, is %r" % (samples_per_symbol,))
self.nsymbols = 2**bits_per_symbol
self.sym_alphabet = numpy.arange(-(self.nsymbols-1),self.nsymbols,2).tolist()
- self.ntaps = int(self._symbols_per_pulse * samples_per_symbol)
- sensitivity = 2 * pi * h_numerator / h_denominator / samples_per_symbol
+ self.ntaps = int(self._symbols_per_pulse * samples_per_symbol)
+ sensitivity = 2 * pi * h_numerator / h_denominator / samples_per_symbol
# Unpack Bytes into bits_per_symbol groups
self.B2s = blocks.packed_to_unpacked_bb(bits_per_symbol,gr.GR_MSB_FIRST)
-
-
- # Turn it into symmetric PAM data.
+
+
+ # Turn it into symmetric PAM data.
self.pam = digital_swig.chunks_to_symbols_bf(self.sym_alphabet,1)
# Generate pulse (sum of taps = samples_per_symbol/2)
@@ -129,72 +136,72 @@ class cpm_mod(gr.hier_block2):
self.taps= (1.0/self._symbols_per_pulse/2,) * self.ntaps
elif cpm_type == 1: # GMSK
gaussian_taps = filter.firdes.gaussian(
- 1.0/2, # gain
+ 1.0 / 2, # gain
samples_per_symbol, # symbol_rate
bt, # bandwidth * symbol time
self.ntaps # number of taps
)
- sqwave = (1,) * samples_per_symbol # rectangular window
- self.taps = numpy.convolve(numpy.array(gaussian_taps),numpy.array(sqwave))
+ sqwave = (1,) * samples_per_symbol # rectangular window
+ self.taps = numpy.convolve(numpy.array(gaussian_taps),numpy.array(sqwave))
elif cpm_type == 2: # Raised Cosine
# generalize it for arbitrary roll-off factor
- self.taps = (1-numpy.cos(2*pi*numpy.arange(0,self.ntaps)/samples_per_symbol/self._symbols_per_pulse))/(2*self._symbols_per_pulse)
+ self.taps = (1-numpy.cos(2*pi*numpy.arange(0 / self.ntaps/samples_per_symbol/self._symbols_per_pulse)),(2*self._symbols_per_pulse))
elif cpm_type == 3: # Generic CPM
self.taps = generic_taps
else:
- raise TypeError, ("cpm_type must be an integer in {0,1,2,3}, is %r" % (cpm_type,))
+ raise TypeError("cpm_type must be an integer in {0,1,2,3}, is %r" % (cpm_type,))
self.filter = filter.pfb.arb_resampler_fff(samples_per_symbol, self.taps)
- # FM modulation
- self.fmmod = analog.frequency_modulator_fc(sensitivity)
-
+ # FM modulation
+ self.fmmod = analog.frequency_modulator_fc(sensitivity)
+
if verbose:
self._print_verbage()
-
+
if log:
self._setup_logging()
- # Connect
- self.connect(self, self.B2s, self.pam, self.filter, self.fmmod, self)
+ # Connect
+ self.connect(self, self.B2s, self.pam, self.filter, self.fmmod, self)
def samples_per_symbol(self):
return self._samples_per_symbol
-
- def bits_per_symbol(self):
+
+ def bits_per_symbol(self):
return self._bits_per_symbol
-
- def h_numerator(self):
+
+ def h_numerator(self):
return self._h_numerator
- def h_denominator(self):
+ def h_denominator(self):
return self._h_denominator
- def cpm_type(self):
+ def cpm_type(self):
return self._cpm_type
- def bt(self):
+ def bt(self):
return self._bt
- def symbols_per_pulse(self):
+ def symbols_per_pulse(self):
return self._symbols_per_pulse
def _print_verbage(self):
- print "Samples per symbol = %d" % self._samples_per_symbol
- print "Bits per symbol = %d" % self._bits_per_symbol
- print "h = " , self._h_numerator , " / " , self._h_denominator
- print "Symbol alphabet = " , self.sym_alphabet
- print "Symbols per pulse = %d" % self._symbols_per_pulse
- print "taps = " , self.taps
-
- print "CPM type = %d" % self._cpm_type
+ print("Samples per symbol = %d" % self._samples_per_symbol)
+ print("Bits per symbol = %d" % self._bits_per_symbol)
+ print("h = " , self._h_numerator , " / " , self._h_denominator)
+ print("Symbol alphabet = " , self.sym_alphabet)
+ print("Symbols per pulse = %d" % self._symbols_per_pulse)
+ print("taps = " , self.taps)
+
+ print("CPM type = %d" % self._cpm_type)
if self._cpm_type == 1:
- print "Gaussian filter BT = %.2f" % self._bt
+ print("Gaussian filter BT = %.2f" % self._bt)
def _setup_logging(self):
- print "Modulation logging turned on."
+ print("Modulation logging turned on.")
self.connect(self.B2s,
blocks.file_sink(gr.sizeof_float, "symbols.dat"))
self.connect(self.pam,
diff --git a/gr-digital/python/digital/crc.py b/gr-digital/python/digital/crc.py
index e228faaa98..31e98d368a 100644
--- a/gr-digital/python/digital/crc.py
+++ b/gr-digital/python/digital/crc.py
@@ -1,26 +1,27 @@
+from __future__ import unicode_literals
#
# Copyright 2005,2007,2011 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
from gnuradio import gru
-import digital_swig as digital
+from . import digital_swig as digital
import struct
def gen_and_append_crc32(s):
diff --git a/gr-digital/python/digital/generic_mod_demod.py b/gr-digital/python/digital/generic_mod_demod.py
index b26966fbcf..2a0d2c44ce 100644
--- a/gr-digital/python/digital/generic_mod_demod.py
+++ b/gr-digital/python/digital/generic_mod_demod.py
@@ -19,32 +19,22 @@
# Boston, MA 02110-1301, USA.
#
-# See gnuradio-examples/python/digital for examples
-
"""
Generic modulation and demodulation.
"""
-from gnuradio import gr
-from modulation_utils import extract_kwargs_from_options_for_class
-from utils import mod_codes
-import digital_swig as digital
-import math
+# See gnuradio-examples/python/digital for examples
-try:
- from gnuradio import blocks
-except ImportError:
- import blocks_swig as blocks
+from __future__ import print_function
+from __future__ import absolute_import
+from __future__ import unicode_literals
-try:
- from gnuradio import filter
-except ImportError:
- import filter_swig as filter
+from gnuradio import gr, blocks, filter, analog
+from .modulation_utils import extract_kwargs_from_options_for_class
+from .utils import mod_codes
+from . import digital_swig as digital
+import math
-try:
- from gnuradio import analog
-except ImportError:
- import analog_swig as analog
# default values (used in __init__ and add_options)
_def_samples_per_symbol = 2
@@ -113,9 +103,9 @@ class generic_mod(gr.hier_block2):
verbose=_def_verbose,
log=_def_log):
- gr.hier_block2.__init__(self, "generic_mod",
- gr.io_signature(1, 1, gr.sizeof_char), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
+ gr.hier_block2.__init__(self, "generic_mod",
+ gr.io_signature(1, 1, gr.sizeof_char), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
self._constellation = constellation
self._samples_per_symbol = samples_per_symbol
@@ -125,7 +115,7 @@ class generic_mod(gr.hier_block2):
self.pre_diff_code = pre_diff_code and self._constellation.apply_pre_diff_code()
if self._samples_per_symbol < 2:
- raise TypeError, ("sps must be >= 2, is %f" % self._samples_per_symbol)
+ raise TypeError("sps must be >= 2, is %f" % self._samples_per_symbol)
arity = pow(2,self.bits_per_symbol())
@@ -153,7 +143,7 @@ class generic_mod(gr.hier_block2):
self.rrc_filter = filter.pfb_arb_resampler_ccf(self._samples_per_symbol,
self.rrc_taps)
- # Connect
+ # Connect
self._blocks = [self, self.bytes2chunks]
if self.pre_diff_code:
self._blocks.append(self.symbol_mapper)
@@ -191,12 +181,12 @@ class generic_mod(gr.hier_block2):
def _print_verbage(self):
- print "\nModulator:"
- print "bits per symbol: %d" % self.bits_per_symbol()
- print "RRC roll-off factor: %.2f" % self._excess_bw
+ print("\nModulator:")
+ print("bits per symbol: %d" % self.bits_per_symbol())
+ print("RRC roll-off factor: %.2f" % self._excess_bw)
def _setup_logging(self):
- print "Modulation logging turned on."
+ print("Modulation logging turned on.")
self.connect(self.bytes2chunks,
blocks.file_sink(gr.sizeof_char, "tx_bytes2chunks.8b"))
if self.pre_diff_code:
@@ -249,9 +239,9 @@ class generic_demod(gr.hier_block2):
verbose=_def_verbose,
log=_def_log):
- gr.hier_block2.__init__(self, "generic_demod",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
- gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
+ gr.hier_block2.__init__(self, "generic_demod",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
self._constellation = constellation
self._samples_per_symbol = samples_per_symbol
@@ -263,7 +253,7 @@ class generic_demod(gr.hier_block2):
self._differential = differential
if self._samples_per_symbol < 2:
- raise TypeError, ("sps must be >= 2, is %d" % self._samples_per_symbol)
+ raise TypeError("sps must be >= 2, is %d" % self._samples_per_symbol)
# Only apply a predifferential coding if the constellation also supports it.
self.pre_diff_code = pre_diff_code and self._constellation.apply_pre_diff_code()
@@ -328,15 +318,15 @@ class generic_demod(gr.hier_block2):
return self._constellation.bits_per_symbol()
def _print_verbage(self):
- print "\nDemodulator:"
- print "bits per symbol: %d" % self.bits_per_symbol()
- print "RRC roll-off factor: %.2f" % self._excess_bw
- print "FLL bandwidth: %.2e" % self._freq_bw
- print "Timing bandwidth: %.2e" % self._timing_bw
- print "Phase bandwidth: %.2e" % self._phase_bw
+ print("\nDemodulator:")
+ print("bits per symbol: %d" % self.bits_per_symbol())
+ print("RRC roll-off factor: %.2f" % self._excess_bw)
+ print("FLL bandwidth: %.2e" % self._freq_bw)
+ print("Timing bandwidth: %.2e" % self._timing_bw)
+ print("Phase bandwidth: %.2e" % self._phase_bw)
def _setup_logging(self):
- print "Modulation logging turned on."
+ print("Modulation logging turned on.")
self.connect(self.agc,
blocks.file_sink(gr.sizeof_gr_complex, "rx_agc.32fc"))
self.connect((self.freq_recov, 0),
diff --git a/gr-digital/python/digital/gfsk.py b/gr-digital/python/digital/gfsk.py
index 032302b103..8b86743bf1 100644
--- a/gr-digital/python/digital/gfsk.py
+++ b/gr-digital/python/digital/gfsk.py
@@ -1,43 +1,42 @@
#
-# GFSK modulation and demodulation.
+# GFSK modulation and demodulation.
#
#
# Copyright 2005-2007,2012 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import unicode_literals
# See gnuradio-examples/python/digital for examples
+import numpy
+
from gnuradio import gr
from gnuradio import analog
-from gnuradio import blocks
-import modulation_utils
-import digital_swig as digital
-from math import pi
-import numpy
-from pprint import pprint
-import inspect
+from gnuradio import blocks, filter
+from . import modulation_utils
+from . import digital_swig as digital
-try:
- from gnuradio import filter
-except ImportError:
- import filter_swig as filter
# default values (used in __init__ and add_options)
_def_samples_per_symbol = 2
@@ -69,22 +68,22 @@ class gfsk_mod(gr.hier_block2):
verbose=_def_verbose,
log=_def_log):
"""
- Hierarchical block for Gaussian Frequency Shift Key (GFSK)
- modulation.
+ Hierarchical block for Gaussian Frequency Shift Key (GFSK)
+ modulation.
- The input is a byte stream (unsigned char) and the
- output is the complex modulated signal at baseband.
+ The input is a byte stream (unsigned char) and the
+ output is the complex modulated signal at baseband.
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",
- gr.io_signature(1, 1, gr.sizeof_char), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
+ gr.hier_block2.__init__(self, "gfsk_mod",
+ gr.io_signature(1, 1, gr.sizeof_char), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
samples_per_symbol = int(samples_per_symbol)
self._samples_per_symbol = samples_per_symbol
@@ -92,43 +91,43 @@ class gfsk_mod(gr.hier_block2):
self._differential = False
if not isinstance(samples_per_symbol, int) or samples_per_symbol < 2:
- raise TypeError, ("samples_per_symbol must be an integer >= 2, is %r" % (samples_per_symbol,))
+ raise TypeError("samples_per_symbol must be an integer >= 2, is %r" % (samples_per_symbol,))
- ntaps = 4 * samples_per_symbol # up to 3 bits in filter at once
- #sensitivity = (pi / 2) / samples_per_symbol # phase change per bit = pi / 2
+ ntaps = 4 * samples_per_symbol # up to 3 bits in filter at once
+ #sensitivity = (pi / 2) / samples_per_symbol # phase change per bit = pi / 2
- # Turn it into NRZ data.
- #self.nrz = digital.bytes_to_syms()
+ # Turn it into NRZ data.
+ #self.nrz = digital.bytes_to_syms()
self.unpack = blocks.packed_to_unpacked_bb(1, gr.GR_MSB_FIRST)
self.nrz = digital.chunks_to_symbols_bf([-1, 1])
- # Form Gaussian filter
+ # Form Gaussian filter
# Generate Gaussian response (Needs to be convolved with window below).
- self.gaussian_taps = filter.firdes.gaussian(
- 1.0, # gain
- samples_per_symbol, # symbol_rate
- bt, # bandwidth * symbol time
- ntaps # number of taps
- )
-
- self.sqwave = (1,) * samples_per_symbol # rectangular window
- self.taps = numpy.convolve(numpy.array(self.gaussian_taps),numpy.array(self.sqwave))
- self.gaussian_filter = filter.interp_fir_filter_fff(samples_per_symbol, self.taps)
-
- # FM modulation
- self.fmmod = analog.frequency_modulator_fc(sensitivity)
-
- # small amount of output attenuation to prevent clipping USRP sink
- self.amp = blocks.multiply_const_cc(0.999)
-
+ self.gaussian_taps = filter.firdes.gaussian(
+ 1.0, # gain
+ samples_per_symbol, # symbol_rate
+ bt, # bandwidth * symbol time
+ ntaps # number of taps
+ )
+
+ self.sqwave = (1,) * samples_per_symbol # rectangular window
+ self.taps = numpy.convolve(numpy.array(self.gaussian_taps),numpy.array(self.sqwave))
+ self.gaussian_filter = filter.interp_fir_filter_fff(samples_per_symbol, self.taps)
+
+ # FM modulation
+ self.fmmod = analog.frequency_modulator_fc(sensitivity)
+
+ # small amount of output attenuation to prevent clipping USRP sink
+ self.amp = blocks.multiply_const_cc(0.999)
+
if verbose:
self._print_verbage()
-
+
if log:
self._setup_logging()
- # Connect & Initialize base class
- self.connect(self, self.unpack, self.nrz, self.gaussian_filter, self.fmmod, self.amp, self)
+ # Connect & Initialize base class
+ self.connect(self, self.unpack, self.nrz, self.gaussian_filter, self.fmmod, self.amp, self)
def samples_per_symbol(self):
return self._samples_per_symbol
@@ -138,12 +137,12 @@ class gfsk_mod(gr.hier_block2):
return 1
def _print_verbage(self):
- print "bits per symbol = %d" % self.bits_per_symbol()
- print "Gaussian filter bt = %.2f" % self._bt
+ print("bits per symbol = %d" % self.bits_per_symbol())
+ print("Gaussian filter bt = %.2f" % self._bt)
def _setup_logging(self):
- print "Modulation logging turned on."
+ print("Modulation logging turned on.")
self.connect(self.nrz,
blocks.file_sink(gr.sizeof_float, "nrz.dat"))
self.connect(self.gaussian_filter,
@@ -184,11 +183,11 @@ class gfsk_demod(gr.hier_block2):
verbose=_def_verbose,
log=_def_log):
"""
- Hierarchical block for Gaussian Minimum Shift Key (GFSK)
- demodulation.
+ Hierarchical block for Gaussian Minimum Shift Key (GFSK)
+ demodulation.
- The input is the complex modulated signal at baseband.
- The output is a stream of bits packed 1 bit per byte (the LSB)
+ The input is the complex modulated signal at baseband.
+ The output is a stream of bits packed 1 bit per byte (the LSB)
Args:
samples_per_symbol: samples per baud (integer)
@@ -196,18 +195,18 @@ class gfsk_demod(gr.hier_block2):
log: Print modualtion data to files? (bool)
Clock recovery parameters. These all have reasonable defaults.
-
+
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:
- """
+ float:
+ """
- gr.hier_block2.__init__(self, "gfsk_demod",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
- gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
+ gr.hier_block2.__init__(self, "gfsk_demod",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
self._samples_per_symbol = samples_per_symbol
self._gain_mu = gain_mu
@@ -215,24 +214,24 @@ class gfsk_demod(gr.hier_block2):
self._omega_relative_limit = omega_relative_limit
self._freq_error = freq_error
self._differential = False
-
+
if samples_per_symbol < 2:
- raise TypeError, "samples_per_symbol >= 2, is %f" % samples_per_symbol
+ raise TypeError("samples_per_symbol >= 2, is %f" % samples_per_symbol)
self._omega = samples_per_symbol*(1+self._freq_error)
if not self._gain_mu:
self._gain_mu = 0.175
-
- self._gain_omega = .25 * self._gain_mu * self._gain_mu # critically damped
- # Demodulate FM
- #sensitivity = (pi / 2) / samples_per_symbol
- self.fmdemod = analog.quadrature_demod_cf(1.0 / sensitivity)
+ self._gain_omega = .25 * self._gain_mu * self._gain_mu # critically damped
- # the clock recovery block tracks the symbol clock and resamples as needed.
- # the output of the block is a stream of soft symbols (float)
- self.clock_recovery = digital.clock_recovery_mm_ff(self._omega, self._gain_omega,
+ # Demodulate FM
+ #sensitivity = (pi / 2) / samples_per_symbol
+ self.fmdemod = analog.quadrature_demod_cf(1.0 / sensitivity)
+
+ # the clock recovery block tracks the symbol clock and resamples as needed.
+ # the output of the block is a stream of soft symbols (float)
+ self.clock_recovery = digital.clock_recovery_mm_ff(self._omega, self._gain_omega,
self._mu, self._gain_mu,
self._omega_relative_limit)
@@ -241,12 +240,12 @@ class gfsk_demod(gr.hier_block2):
if verbose:
self._print_verbage()
-
+
if log:
self._setup_logging()
- # Connect & Initialize base class
- self.connect(self, self.fmdemod, self.clock_recovery, self.slicer, self)
+ # Connect & Initialize base class
+ self.connect(self, self.fmdemod, self.clock_recovery, self.slicer, self)
def samples_per_symbol(self):
return self._samples_per_symbol
@@ -256,16 +255,16 @@ class gfsk_demod(gr.hier_block2):
return 1
def _print_verbage(self):
- print "bits per symbol = %d" % self.bits_per_symbol()
- print "M&M clock recovery omega = %f" % self._omega
- print "M&M clock recovery gain mu = %f" % self._gain_mu
- print "M&M clock recovery mu = %f" % self._mu
- print "M&M clock recovery omega rel. limit = %f" % self._omega_relative_limit
- print "frequency error = %f" % self._freq_error
+ print("bits per symbol = %d" % self.bits_per_symbol())
+ print("M&M clock recovery omega = %f" % self._omega)
+ print("M&M clock recovery gain mu = %f" % self._gain_mu)
+ print("M&M clock recovery mu = %f" % self._mu)
+ print("M&M clock recovery omega rel. limit = %f" % self._omega_relative_limit)
+ print("frequency error = %f" % self._freq_error)
def _setup_logging(self):
- print "Demodulation logging turned on."
+ print("Demodulation logging turned on.")
self.connect(self.fmdemod,
blocks.file_sink(gr.sizeof_float, "fmdemod.dat"))
self.connect(self.clock_recovery,
diff --git a/gr-digital/python/digital/gmsk.py b/gr-digital/python/digital/gmsk.py
index e7a92a95db..5e25a3d3a1 100644
--- a/gr-digital/python/digital/gmsk.py
+++ b/gr-digital/python/digital/gmsk.py
@@ -1,26 +1,31 @@
#
-# GMSK modulation and demodulation.
+# GMSK modulation and demodulation.
#
#
# Copyright 2005-2007,2012 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import unicode_literals
# See gnuradio-examples/python/digital for examples
@@ -31,8 +36,8 @@ import inspect
import numpy
from gnuradio import gr, blocks, analog, filter
-import modulation_utils
-import digital_swig as digital
+from . import modulation_utils
+from . import digital_swig as digital
# default values (used in __init__ and add_options)
_def_samples_per_symbol = 2
@@ -58,10 +63,10 @@ class gmsk_mod(gr.hier_block2):
"""
Hierarchical block for Gaussian Minimum Shift Key (GMSK)
modulation.
-
+
The input is a byte stream (unsigned char with packed bits)
and the output is the complex modulated signal at baseband.
-
+
Args:
samples_per_symbol: samples per baud >= 2 (integer)
bt: Gaussian filter bandwidth * symbol time (float)
@@ -75,9 +80,9 @@ class gmsk_mod(gr.hier_block2):
verbose=_def_verbose,
log=_def_log):
- gr.hier_block2.__init__(self, "gmsk_mod",
- gr.io_signature(1, 1, gr.sizeof_char), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
+ gr.hier_block2.__init__(self, "gmsk_mod",
+ gr.io_signature(1, 1, gr.sizeof_char), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
samples_per_symbol = int(samples_per_symbol)
self._samples_per_symbol = samples_per_symbol
@@ -85,40 +90,40 @@ class gmsk_mod(gr.hier_block2):
self._differential = False
if not isinstance(samples_per_symbol, int) or samples_per_symbol < 2:
- raise TypeError, ("samples_per_symbol must be an integer >= 2, is %r" % (samples_per_symbol,))
+ raise TypeError("samples_per_symbol must be an integer >= 2, is %r" % (samples_per_symbol,))
- ntaps = 4 * samples_per_symbol # up to 3 bits in filter at once
- sensitivity = (pi / 2) / samples_per_symbol # phase change per bit = pi / 2
+ ntaps = 4 * samples_per_symbol # up to 3 bits in filter at once
+ sensitivity = (old_div(pi / 2), samples_per_symbol) # phase change per bit = pi / 2
- # Turn it into NRZ data.
- #self.nrz = digital.bytes_to_syms()
+ # Turn it into NRZ data.
+ #self.nrz = digital.bytes_to_syms()
self.unpack = blocks.packed_to_unpacked_bb(1, gr.GR_MSB_FIRST)
self.nrz = digital.chunks_to_symbols_bf([-1, 1], 1)
- # Form Gaussian filter
+ # Form Gaussian filter
# Generate Gaussian response (Needs to be convolved with window below).
- self.gaussian_taps = filter.firdes.gaussian(
- 1, # gain
- samples_per_symbol, # symbol_rate
- bt, # bandwidth * symbol time
- ntaps # number of taps
- )
-
- self.sqwave = (1,) * samples_per_symbol # rectangular window
- self.taps = numpy.convolve(numpy.array(self.gaussian_taps),numpy.array(self.sqwave))
- self.gaussian_filter = filter.interp_fir_filter_fff(samples_per_symbol, self.taps)
-
- # FM modulation
- self.fmmod = analog.frequency_modulator_fc(sensitivity)
-
+ self.gaussian_taps = filter.firdes.gaussian(
+ 1, # gain
+ samples_per_symbol, # symbol_rate
+ bt, # bandwidth * symbol time
+ ntaps # number of taps
+ )
+
+ self.sqwave = (1,) * samples_per_symbol # rectangular window
+ self.taps = numpy.convolve(numpy.array(self.gaussian_taps),numpy.array(self.sqwave))
+ self.gaussian_filter = filter.interp_fir_filter_fff(samples_per_symbol, self.taps)
+
+ # FM modulation
+ self.fmmod = analog.frequency_modulator_fc(sensitivity)
+
if verbose:
self._print_verbage()
-
+
if log:
self._setup_logging()
- # Connect & Initialize base class
- self.connect(self, self.unpack, self.nrz, self.gaussian_filter, self.fmmod, self)
+ # Connect & Initialize base class
+ self.connect(self, self.unpack, self.nrz, self.gaussian_filter, self.fmmod, self)
def samples_per_symbol(self):
return self._samples_per_symbol
@@ -128,12 +133,12 @@ class gmsk_mod(gr.hier_block2):
return 1
def _print_verbage(self):
- print "bits per symbol = %d" % self.bits_per_symbol()
- print "Gaussian filter bt = %.2f" % self._bt
+ print("bits per symbol = %d" % self.bits_per_symbol())
+ print("Gaussian filter bt = %.2f" % self._bt)
def _setup_logging(self):
- print "Modulation logging turned on."
+ print("Modulation logging turned on.")
self.connect(self.nrz,
blocks.file_sink(gr.sizeof_float, "nrz.dat"))
self.connect(self.gaussian_filter,
@@ -166,10 +171,10 @@ class gmsk_demod(gr.hier_block2):
"""
Hierarchical block for Gaussian Minimum Shift Key (GMSK)
demodulation.
-
+
The input is the complex modulated signal at baseband.
The output is a stream of bits packed 1 bit per byte (the LSB)
-
+
Args:
samples_per_symbol: samples per baud (integer)
gain_mu: controls rate of mu adjustment (float)
@@ -179,7 +184,7 @@ class gmsk_demod(gr.hier_block2):
verbose: Print information about modulator? (boolean)
log: Print modualtion data to files? (boolean)
"""
-
+
def __init__(self,
samples_per_symbol=_def_samples_per_symbol,
gain_mu=_def_gain_mu,
@@ -189,9 +194,9 @@ class gmsk_demod(gr.hier_block2):
verbose=_def_verbose,
log=_def_log):
- gr.hier_block2.__init__(self, "gmsk_demod",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
- gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
+ gr.hier_block2.__init__(self, "gmsk_demod",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
self._samples_per_symbol = samples_per_symbol
self._gain_mu = gain_mu
@@ -199,24 +204,24 @@ class gmsk_demod(gr.hier_block2):
self._omega_relative_limit = omega_relative_limit
self._freq_error = freq_error
self._differential = False
-
+
if samples_per_symbol < 2:
- raise TypeError, "samples_per_symbol >= 2, is %f" % samples_per_symbol
+ raise TypeError("samples_per_symbol >= 2, is %f" % samples_per_symbol)
self._omega = samples_per_symbol*(1+self._freq_error)
if not self._gain_mu:
self._gain_mu = 0.175
-
- self._gain_omega = .25 * self._gain_mu * self._gain_mu # critically damped
- # Demodulate FM
- sensitivity = (pi / 2) / samples_per_symbol
- self.fmdemod = analog.quadrature_demod_cf(1.0 / sensitivity)
+ self._gain_omega = .25 * self._gain_mu * self._gain_mu # critically damped
- # the clock recovery block tracks the symbol clock and resamples as needed.
- # the output of the block is a stream of soft symbols (float)
- self.clock_recovery = digital.clock_recovery_mm_ff(self._omega, self._gain_omega,
+ # Demodulate FM
+ sensitivity = (old_div(pi / 2), samples_per_symbol)
+ self.fmdemod = analog.quadrature_demod_cf(1.0 / sensitivity)
+
+ # the clock recovery block tracks the symbol clock and resamples as needed.
+ # the output of the block is a stream of soft symbols (float)
+ self.clock_recovery = digital.clock_recovery_mm_ff(self._omega, self._gain_omega,
self._mu, self._gain_mu,
self._omega_relative_limit)
@@ -225,12 +230,12 @@ class gmsk_demod(gr.hier_block2):
if verbose:
self._print_verbage()
-
+
if log:
self._setup_logging()
- # Connect & Initialize base class
- self.connect(self, self.fmdemod, self.clock_recovery, self.slicer, self)
+ # Connect & Initialize base class
+ self.connect(self, self.fmdemod, self.clock_recovery, self.slicer, self)
def samples_per_symbol(self):
return self._samples_per_symbol
@@ -240,16 +245,16 @@ class gmsk_demod(gr.hier_block2):
return 1
def _print_verbage(self):
- print "bits per symbol = %d" % self.bits_per_symbol()
- print "M&M clock recovery omega = %f" % self._omega
- print "M&M clock recovery gain mu = %f" % self._gain_mu
- print "M&M clock recovery mu = %f" % self._mu
- print "M&M clock recovery omega rel. limit = %f" % self._omega_relative_limit
- print "frequency error = %f" % self._freq_error
+ print("bits per symbol = %d" % self.bits_per_symbol())
+ print("M&M clock recovery omega = %f" % self._omega)
+ print("M&M clock recovery gain mu = %f" % self._gain_mu)
+ print("M&M clock recovery mu = %f" % self._mu)
+ print("M&M clock recovery omega rel. limit = %f" % self._omega_relative_limit)
+ print("frequency error = %f" % self._freq_error)
def _setup_logging(self):
- print "Demodulation logging turned on."
+ print("Demodulation logging turned on.")
self.connect(self.fmdemod,
blocks.file_sink(gr.sizeof_float, "fmdemod.dat"))
self.connect(self.clock_recovery,
diff --git a/gr-digital/python/digital/modulation_utils.py b/gr-digital/python/digital/modulation_utils.py
index d499094d05..57d7ccdae8 100644
--- a/gr-digital/python/digital/modulation_utils.py
+++ b/gr-digital/python/digital/modulation_utils.py
@@ -22,6 +22,7 @@
Miscellaneous utilities for managing mods and demods, as well as other items
useful in dealing with generalized handling of different modulations and demods.
"""
+from __future__ import unicode_literals
import inspect
diff --git a/gr-digital/python/digital/ofdm.py b/gr-digital/python/digital/ofdm.py
index 563b70ad00..db15a4d3f1 100644
--- a/gr-digital/python/digital/ofdm.py
+++ b/gr-digital/python/digital/ofdm.py
@@ -1,33 +1,38 @@
#!/usr/bin/env python
#
# Copyright 2006-2008,2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import unicode_literals
import math
from gnuradio import gr, fft
from gnuradio import blocks
-import digital_swig as digital
-import ofdm_packet_utils
-from ofdm_receiver import ofdm_receiver
+from . import digital_swig as digital
+from . import ofdm_packet_utils
+from .ofdm_receiver import ofdm_receiver
import gnuradio.gr.gr_threading as _threading
-import psk, qam
+from . import psk, qam
# /////////////////////////////////////////////////////////////////////////////
# mod/demod with packets as i/o
@@ -37,12 +42,12 @@ class ofdm_mod(gr.hier_block2):
"""
Modulates an OFDM stream. Based on the options fft_length, occupied_tones, and
cp_length, this block creates OFDM symbols using a specified modulation option.
-
+
Send packets by calling send_pkt
"""
def __init__(self, options, msgq_limit=2, pad_for_usrp=True):
"""
- Hierarchical block for sending packets
+ Hierarchical block for sending packets
Packets to be sent are enqueued by calling send_pkt.
The output is the complex modulated signal at baseband.
@@ -53,9 +58,9 @@ class ofdm_mod(gr.hier_block2):
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",
- gr.io_signature(0, 0, 0), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
+ gr.hier_block2.__init__(self, "ofdm_mod",
+ gr.io_signature(0, 0, 0), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
self._pad_for_usrp = pad_for_usrp
self._modulation = options.modulation
@@ -66,7 +71,7 @@ class ofdm_mod(gr.hier_block2):
win = [] #[1 for i in range(self._fft_length)]
# Use freq domain to get doubled-up known symbol for correlation in time domain
- zeros_on_left = int(math.ceil((self._fft_length - self._occupied_tones)/2.0))
+ zeros_on_left = int(math.ceil((self._fft_length - self._occupied_tones) / 2.0))
ksfreq = known_symbols_4512_3[0:self._occupied_tones]
for i in range(len(ksfreq)):
if((zeros_on_left + i) & 1):
@@ -74,46 +79,46 @@ class ofdm_mod(gr.hier_block2):
# hard-coded known symbols
preambles = (ksfreq,)
-
+
padded_preambles = list()
for pre in preambles:
padded = self._fft_length*[0,]
padded[zeros_on_left : zeros_on_left + self._occupied_tones] = pre
padded_preambles.append(padded)
-
+
symbol_length = options.fft_length + options.cp_length
-
+
mods = {"bpsk": 2, "qpsk": 4, "8psk": 8, "qam8": 8, "qam16": 16, "qam64": 64, "qam256": 256}
arity = mods[self._modulation]
-
+
rot = 1
if self._modulation == "qpsk":
rot = (0.707+0.707j)
-
+
# FIXME: pass the constellation objects instead of just the points
if(self._modulation.find("psk") >= 0):
constel = psk.psk_constellation(arity)
- rotated_const = map(lambda pt: pt * rot, constel.points())
+ rotated_const = [pt * rot for pt in constel.points()]
elif(self._modulation.find("qam") >= 0):
constel = qam.qam_constellation(arity)
- rotated_const = map(lambda pt: pt * rot, constel.points())
- #print rotated_const
+ rotated_const = [pt * rot for pt in constel.points()]
+ #print(rotated_const)
self._pkt_input = digital.ofdm_mapper_bcv(rotated_const,
msgq_limit,
options.occupied_tones,
options.fft_length)
-
+
self.preambles = digital.ofdm_insert_preamble(self._fft_length,
padded_preambles)
self.ifft = fft.fft_vcc(self._fft_length, False, win, True)
self.cp_adder = digital.ofdm_cyclic_prefixer(self._fft_length,
symbol_length)
self.scale = blocks.multiply_const_cc(1.0 / math.sqrt(self._fft_length))
-
+
self.connect((self._pkt_input, 0), (self.preambles, 0))
self.connect((self._pkt_input, 1), (self.preambles, 1))
self.connect(self.preambles, self.ifft, self.cp_adder, self.scale, self)
-
+
if options.verbose:
self._print_verbage()
@@ -137,12 +142,12 @@ class ofdm_mod(gr.hier_block2):
if eof:
msg = gr.message(1) # tell self._pkt_input we're not sending any more packets
else:
- # print "original_payload =", string_to_hex_list(payload)
+ # print("original_payload =", string_to_hex_list(payload))
pkt = ofdm_packet_utils.make_packet(payload, 1, 1,
self._pad_for_usrp,
whitening=True)
-
- #print "pkt =", string_to_hex_list(pkt)
+
+ #print("pkt =", string_to_hex_list(pkt))
msg = gr.message_from_string(pkt)
self._pkt_input.msgq().insert_tail(msg)
@@ -164,11 +169,11 @@ class ofdm_mod(gr.hier_block2):
"""
Prints information about the OFDM modulator
"""
- print "\nOFDM Modulator:"
- print "Modulation Type: %s" % (self._modulation)
- print "FFT length: %3d" % (self._fft_length)
- print "Occupied Tones: %3d" % (self._occupied_tones)
- print "CP length: %3d" % (self._cp_length)
+ print("\nOFDM Modulator:")
+ print("Modulation Type: %s" % (self._modulation))
+ print("FFT length: %3d" % (self._fft_length))
+ print("Occupied Tones: %3d" % (self._occupied_tones))
+ print("CP length: %3d" % (self._cp_length))
class ofdm_demod(gr.hier_block2):
@@ -183,18 +188,18 @@ class ofdm_demod(gr.hier_block2):
def __init__(self, options, callback=None):
"""
- Hierarchical block for demodulating and deframing packets.
+ Hierarchical block for demodulating and deframing packets.
- The input is the complex modulated signal at baseband.
+ The input is the complex modulated signal at baseband.
Demodulated packets are sent to the handler.
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
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
+ """
+ gr.hier_block2.__init__(self, "ofdm_demod",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
self._rcvd_pktq = gr.msg_queue() # holds packets from the PHY
@@ -206,7 +211,7 @@ class ofdm_demod(gr.hier_block2):
self._snr = options.snr
# Use freq domain to get doubled-up known symbol for correlation in time domain
- zeros_on_left = int(math.ceil((self._fft_length - self._occupied_tones)/2.0))
+ zeros_on_left = int(math.ceil((self._fft_length - self._occupied_tones) / 2.0))
ksfreq = known_symbols_4512_3[0:self._occupied_tones]
for i in range(len(ksfreq)):
if((zeros_on_left + i) & 1):
@@ -224,7 +229,7 @@ class ofdm_demod(gr.hier_block2):
mods = {"bpsk": 2, "qpsk": 4, "8psk": 8, "qam8": 8, "qam16": 16, "qam64": 64, "qam256": 256}
arity = mods[self._modulation]
-
+
rot = 1
if self._modulation == "qpsk":
rot = (0.707+0.707j)
@@ -232,15 +237,15 @@ class ofdm_demod(gr.hier_block2):
# FIXME: pass the constellation objects instead of just the points
if(self._modulation.find("psk") >= 0):
constel = psk.psk_constellation(arity)
- rotated_const = map(lambda pt: pt * rot, constel.points())
+ rotated_const = [pt * rot for pt in constel.points()]
elif(self._modulation.find("qam") >= 0):
constel = qam.qam_constellation(arity)
- rotated_const = map(lambda pt: pt * rot, constel.points())
- #print rotated_const
+ rotated_const = [pt * rot for pt in constel.points()]
+ #print(rotated_const)
phgain = 0.25
frgain = phgain*phgain / 4.0
- self.ofdm_demod = digital.ofdm_frame_sink(rotated_const, range(arity),
+ self.ofdm_demod = digital.ofdm_frame_sink(rotated_const, list(range(arity)),
self._rcvd_pktq,
self._occupied_tones,
phgain, frgain)
@@ -263,7 +268,7 @@ class ofdm_demod(gr.hier_block2):
if options.verbose:
self._print_verbage()
-
+
self._watcher = _queue_watcher_thread(self._rcvd_pktq, callback)
@staticmethod
@@ -286,11 +291,11 @@ class ofdm_demod(gr.hier_block2):
"""
Prints information about the OFDM demodulator
"""
- print "\nOFDM Demodulator:"
- print "Modulation Type: %s" % (self._modulation)
- print "FFT length: %3d" % (self._fft_length)
- print "Occupied Tones: %3d" % (self._occupied_tones)
- print "CP length: %3d" % (self._cp_length)
+ print("\nOFDM Demodulator:")
+ print("Modulation Type: %s" % (self._modulation))
+ print("FFT length: %3d" % (self._fft_length))
+ print("Occupied Tones: %3d" % (self._occupied_tones))
+ print("CP length: %3d" % (self._cp_length))
diff --git a/gr-digital/python/digital/ofdm_packet_utils.py b/gr-digital/python/digital/ofdm_packet_utils.py
index e9ca641c7a..e26308a262 100644
--- a/gr-digital/python/digital/ofdm_packet_utils.py
+++ b/gr-digital/python/digital/ofdm_packet_utils.py
@@ -19,10 +19,15 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import print_function
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import unicode_literals
+
import struct
import numpy
from gnuradio import gru
-import crc
+from . import crc
def conv_packed_binary_string_to_1_0_string(s):
"""
@@ -35,7 +40,7 @@ def conv_packed_binary_string_to_1_0_string(s):
t = (x >> i) & 0x1
r.append(t)
- return ''.join(map(lambda x: chr(x + ord('0')), r))
+ return ''.join([chr(x + ord('0')) for x in r])
def conv_1_0_string_to_packed_binary_string(s):
"""
@@ -46,7 +51,7 @@ def conv_1_0_string_to_packed_binary_string(s):
to get to a multiple of 8.
"""
if not is_1_0_string(s):
- raise ValueError, "Input must be a string containing only 0's and 1's"
+ raise ValueError("Input must be a string containing only 0's and 1's")
# pad to multiple of 8
padded = False
@@ -78,7 +83,7 @@ def is_1_0_string(s):
return True
def string_to_hex_list(s):
- return map(lambda x: hex(ord(x)), s)
+ return [hex(ord(x)) for x in s]
def whiten(s, o):
@@ -93,7 +98,7 @@ def dewhiten(s, o):
def make_header(payload_len, whitener_offset=0):
# Upper nibble is offset, lower 12 bits is len
val = ((whitener_offset & 0xf) << 12) | (payload_len & 0x0fff)
- #print "offset =", whitener_offset, " len =", payload_len, " val=", val
+ #print("offset =", whitener_offset, " len =", payload_len, " val=", val)
return struct.pack('!HH', val, val)
def make_packet(payload, samples_per_symbol, bits_per_symbol,
@@ -113,15 +118,15 @@ def make_packet(payload, samples_per_symbol, bits_per_symbol,
"""
if not whitener_offset >=0 and whitener_offset < 16:
- raise ValueError, "whitener_offset must be between 0 and 15, inclusive (%i)" % (whitener_offset,)
+ raise ValueError("whitener_offset must be between 0 and 15, inclusive (%i)" % (whitener_offset,))
payload_with_crc = crc.gen_and_append_crc32(payload)
- #print "outbound crc =", string_to_hex_list(payload_with_crc[-4:])
+ #print("outbound crc =", string_to_hex_list(payload_with_crc[-4:]))
L = len(payload_with_crc)
MAXLEN = len(random_mask_tuple)
if L > MAXLEN:
- raise ValueError, "len(payload) must be in [0, %d]" % (MAXLEN,)
+ raise ValueError("len(payload) must be in [0, %d]" % (MAXLEN,))
pkt_hd = make_header(L, whitener_offset)
pkt_dt = ''.join((payload_with_crc, '\x55'))
@@ -136,7 +141,7 @@ def make_packet(payload, samples_per_symbol, bits_per_symbol,
else:
pkt = pkt_hd + pkt_dt
- #print "make_packet: len(pkt) =", len(pkt)
+ #print("make_packet: len(pkt) =", len(pkt))
return pkt
@@ -157,7 +162,7 @@ def _npadding_bytes(pkt_byte_len, samples_per_symbol, bits_per_symbol):
number of bytes of padding to append.
"""
modulus = 128
- byte_modulus = gru.lcm(modulus/8, samples_per_symbol) * bits_per_symbol / samples_per_symbol
+ byte_modulus = gru.lcm(modulus / 8, samples_per_symbol) * bits_per_symbol / samples_per_symbol
r = pkt_byte_len % byte_modulus
if r == 0:
return 0
@@ -182,9 +187,9 @@ def unmake_packet(whitened_payload_with_crc, whitener_offset=0, dewhitening=1):
ok, payload = crc.check_crc32(payload_with_crc)
if 0:
- print "payload_with_crc =", string_to_hex_list(payload_with_crc)
- print "ok = %r, len(payload) = %d" % (ok, len(payload))
- print "payload =", string_to_hex_list(payload)
+ print("payload_with_crc =", string_to_hex_list(payload_with_crc))
+ print("ok = %r, len(payload) = %d" % (ok, len(payload)))
+ print("payload =", string_to_hex_list(payload))
return ok, payload
diff --git a/gr-digital/python/digital/ofdm_receiver.py b/gr-digital/python/digital/ofdm_receiver.py
index 4b7836b43c..d23b338b78 100644
--- a/gr-digital/python/digital/ofdm_receiver.py
+++ b/gr-digital/python/digital/ofdm_receiver.py
@@ -1,24 +1,28 @@
#!/usr/bin/env python
#
# Copyright 2006-2008 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import unicode_literals
import math
from numpy import fft
@@ -28,16 +32,12 @@ from gnuradio import analog
from gnuradio import blocks
from gnuradio import filter
-import digital_swig as digital
-from ofdm_sync_pn import ofdm_sync_pn
-from ofdm_sync_fixed import ofdm_sync_fixed
-from ofdm_sync_pnac import ofdm_sync_pnac
-from ofdm_sync_ml import ofdm_sync_ml
+from . import digital_swig as digital
+from .ofdm_sync_pn import ofdm_sync_pn
+from .ofdm_sync_fixed import ofdm_sync_fixed
+from .ofdm_sync_pnac import ofdm_sync_pnac
+from .ofdm_sync_ml import ofdm_sync_ml
-try:
- from gnuradio import filter
-except ImportError:
- import filter_swig as filter
class ofdm_receiver(gr.hier_block2):
"""
@@ -51,9 +51,9 @@ class ofdm_receiver(gr.hier_block2):
def __init__(self, fft_length, cp_length, occupied_tones, snr, ks, logging=False):
"""
- Hierarchical block for receiving OFDM symbols.
+ Hierarchical block for receiving OFDM symbols.
- The input is the complex modulated signal at baseband.
+ The input is the complex modulated signal at baseband.
Synchronized packets are sent back to the demodulator.
Args:
@@ -63,13 +63,13 @@ class ofdm_receiver(gr.hier_block2):
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",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
+ gr.hier_block2.__init__(self, "ofdm_receiver",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
gr.io_signature2(2, 2, gr.sizeof_gr_complex*occupied_tones, gr.sizeof_char)) # Output signature
-
- bw = (float(occupied_tones) / float(fft_length)) / 2.0
+
+ bw = (old_div(float(occupied_tones) / float(fft_length)), 2.0)
tb = bw*0.08
chan_coeffs = filter.firdes.low_pass (1.0, # gain
1.0, # sampling rate
@@ -77,13 +77,13 @@ class ofdm_receiver(gr.hier_block2):
tb, # width of trans. band
filter.firdes.WIN_HAMMING) # filter type
self.chan_filt = filter.fft_filter_ccc(1, chan_coeffs)
-
+
win = [1 for i in range(fft_length)]
- zeros_on_left = int(math.ceil((fft_length - occupied_tones)/2.0))
+ zeros_on_left = int(math.ceil((fft_length - occupied_tones) / 2.0))
ks0 = fft_length*[0,]
ks0[zeros_on_left : zeros_on_left + occupied_tones] = ks[0]
-
+
ks0 = fft.ifftshift(ks0)
ks0time = fft.ifft(ks0)
# ADD SCALING FACTOR
@@ -91,19 +91,19 @@ class ofdm_receiver(gr.hier_block2):
SYNC = "pn"
if SYNC == "ml":
- nco_sensitivity = -1.0/fft_length # correct for fine frequency
+ nco_sensitivity = -1.0 / fft_length # correct for fine frequency
self.ofdm_sync = ofdm_sync_ml(fft_length,
cp_length,
snr,
ks0time,
logging)
elif SYNC == "pn":
- nco_sensitivity = -2.0/fft_length # correct for fine frequency
+ nco_sensitivity = -2.0 / fft_length # correct for fine frequency
self.ofdm_sync = ofdm_sync_pn(fft_length,
cp_length,
logging)
elif SYNC == "pnac":
- nco_sensitivity = -2.0/fft_length # correct for fine frequency
+ nco_sensitivity = -2.0 / fft_length # correct for fine frequency
self.ofdm_sync = ofdm_sync_pnac(fft_length,
cp_length,
ks0time,
@@ -111,10 +111,10 @@ class ofdm_receiver(gr.hier_block2):
# for testing only; do not user over the air
# remove filter and filter delay for this
elif SYNC == "fixed":
- self.chan_filt = blocks.multiply_const_cc(1.0)
+ self.chan_filt = blocks.multiply_const_cc(1.0)
nsymbols = 18 # enter the number of symbols per packet
freq_offset = 0.0 # if you use a frequency offset, enter it here
- nco_sensitivity = -2.0/fft_length # correct for fine frequency
+ nco_sensitivity = -2.0 / fft_length # correct for fine frequency
self.ofdm_sync = ofdm_sync_fixed(fft_length,
cp_length,
nsymbols,
diff --git a/gr-digital/python/digital/ofdm_sync_fixed.py b/gr-digital/python/digital/ofdm_sync_fixed.py
index 9cbd59b943..891ba17d07 100644
--- a/gr-digital/python/digital/ofdm_sync_fixed.py
+++ b/gr-digital/python/digital/ofdm_sync_fixed.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import unicode_literals
import math
from gnuradio import gr
from gnuradio import blocks
diff --git a/gr-digital/python/digital/ofdm_sync_ml.py b/gr-digital/python/digital/ofdm_sync_ml.py
index 3afd647098..6a03c21639 100644
--- a/gr-digital/python/digital/ofdm_sync_ml.py
+++ b/gr-digital/python/digital/ofdm_sync_ml.py
@@ -1,37 +1,31 @@
#!/usr/bin/env python
#
# Copyright 2007,2008 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import division
+from __future__ import unicode_literals
-import math
-from gnuradio import gr
-try:
- from gnuradio import filter
-except ImportError:
- import filter_swig as filter
+from gnuradio import gr, blocks, filter
-try:
- from gnuradio import blocks
-except ImportError:
- import blocks_swig as blocks
class ofdm_sync_ml(gr.hier_block2):
def __init__(self, fft_length, cp_length, snr, kstime, logging):
@@ -41,13 +35,13 @@ class ofdm_sync_ml(gr.hier_block2):
Signal Processing, vol. 45, no. 7, pp. 1800-1805, 1997.
'''
- gr.hier_block2.__init__(self, "ofdm_sync_ml",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
+ gr.hier_block2.__init__(self, "ofdm_sync_ml",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
gr.io_signature2(2, 2, gr.sizeof_float, gr.sizeof_char)) # Output signature
self.input = blocks.add_const_cc(0)
- SNR = 10.0**(snr/10.0)
+ SNR = 10.0**(snr / 10.0)
rho = SNR / (SNR + 1.0)
symbol_length = fft_length + cp_length
@@ -66,15 +60,15 @@ class ofdm_sync_ml(gr.hier_block2):
self.magsqrd2 = blocks.complex_to_mag_squared()
self.adder = blocks.add_ff()
- moving_sum_taps = [rho/2 for i in range(cp_length)]
+ moving_sum_taps = [rho / 2 for i in range(cp_length)]
self.moving_sum_filter = filter.fir_filter_fff(1,moving_sum_taps)
-
+
self.connect(self.input,self.magsqrd1)
self.connect(self.delay,self.magsqrd2)
self.connect(self.magsqrd1,(self.adder,0))
self.connect(self.magsqrd2,(self.adder,1))
self.connect(self.adder,self.moving_sum_filter)
-
+
# Correlation from ML Sync
self.conjg = blocks.conjugate_cc();
@@ -82,7 +76,7 @@ class ofdm_sync_ml(gr.hier_block2):
movingsum2_taps = [1.0 for i in range(cp_length)]
self.movingsum2 = filter.fir_filter_ccf(1,movingsum2_taps)
-
+
# Correlator data handler
self.c2mag = blocks.complex_to_mag()
self.angle = blocks.complex_to_arg()
@@ -104,7 +98,7 @@ class ofdm_sync_ml(gr.hier_block2):
# use the sync loop values to set the sampler and the NCO
# self.diff = theta
# self.angle = epsilon
-
+
self.connect(self.diff, self.pk_detect)
# The DPLL corrects for timing differences between CP correlations
@@ -115,7 +109,7 @@ class ofdm_sync_ml(gr.hier_block2):
self.connect(self.dpll, (self.sample_and_hold,1))
else:
self.connect(self.pk_detect, (self.sample_and_hold,1))
-
+
self.connect(self.angle, (self.sample_and_hold,0))
################################
@@ -130,7 +124,7 @@ class ofdm_sync_ml(gr.hier_block2):
self.div = blocks.divide_ff()
# The output signature of the correlation has a few spikes because the rest of the
- # system uses the repeated preamble symbol. It needs to work that generically if
+ # system uses the repeated preamble symbol. It needs to work that generically if
# anyone wants to use this against a WiMAX-like signal since it, too, repeats.
# The output theta of the correlator above is multiplied with this correlation to
# identify the proper peak and remove other products in this cross-correlation
@@ -139,17 +133,17 @@ class ofdm_sync_ml(gr.hier_block2):
self.f2b = blocks.float_to_char()
self.b2f = blocks.char_to_float()
self.mul = blocks.multiply_ff()
-
+
# Normalize the power of the corr output by the energy. This is not really needed
# and could be removed for performance, but it makes for a cleaner signal.
# if this is removed, the threshold value needs adjustment.
self.connect(self.input, self.kscorr, self.corrmag, (self.div,0))
self.connect(self.moving_sum_filter, (self.div,1))
-
+
self.connect(self.div, (self.mul,0))
self.connect(self.pk_detect, self.b2f, (self.mul,1))
self.connect(self.mul, self.slice)
-
+
# Set output signals
# Output 0: fine frequency correction value
# Output 1: timing signal
diff --git a/gr-digital/python/digital/ofdm_sync_pn.py b/gr-digital/python/digital/ofdm_sync_pn.py
index 0e79c67ca0..1192830679 100644
--- a/gr-digital/python/digital/ofdm_sync_pn.py
+++ b/gr-digital/python/digital/ofdm_sync_pn.py
@@ -1,38 +1,31 @@
#!/usr/bin/env python
#
# Copyright 2007,2008 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import division
+from __future__ import unicode_literals
-import math
-from numpy import fft
-from gnuradio import gr
-try:
- from gnuradio import filter
-except ImportError:
- import filter_swig as filter
+from gnuradio import gr, blocks, filter
-try:
- from gnuradio import blocks
-except ImportError:
- import blocks_swig as blocks
class ofdm_sync_pn(gr.hier_block2):
def __init__(self, fft_length, cp_length, logging=False):
@@ -52,7 +45,7 @@ class ofdm_sync_pn(gr.hier_block2):
# PN Sync
# Create a delay line
- self.delay = blocks.delay(gr.sizeof_gr_complex, fft_length/2)
+ self.delay = blocks.delay(gr.sizeof_gr_complex, fft_length / 2)
# Correlation from ML Sync
self.conjg = blocks.conjugate_cc();
@@ -98,10 +91,10 @@ class ofdm_sync_pn(gr.hier_block2):
self.connect(self.c2mag, (self.normalize,0))
# Create a moving sum filter for the corr output
- matched_filter_taps = [1.0/cp_length for i in range(cp_length)]
+ matched_filter_taps = [1.0 / cp_length for i in range(cp_length)]
self.matched_filter = filter.fir_filter_fff(1,matched_filter_taps)
self.connect(self.normalize, self.matched_filter)
-
+
self.connect(self.matched_filter, self.sub1, self.pk_detect)
#self.connect(self.matched_filter, self.pk_detect)
self.connect(self.pk_detect, (self.sample_and_hold,1))
diff --git a/gr-digital/python/digital/ofdm_sync_pnac.py b/gr-digital/python/digital/ofdm_sync_pnac.py
index 55a6c21f4c..4d756f7ff7 100644
--- a/gr-digital/python/digital/ofdm_sync_pnac.py
+++ b/gr-digital/python/digital/ofdm_sync_pnac.py
@@ -1,38 +1,31 @@
#!/usr/bin/env python
#
# Copyright 2007 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import division
+from __future__ import unicode_literals
-import math
-from numpy import fft
-from gnuradio import gr
-try:
- from gnuradio import filter
-except ImportError:
- import filter_swig as filter
+from gnuradio import gr, blocks, filter
-try:
- from gnuradio import blocks
-except ImportError:
- import blocks_swig as blocks
class ofdm_sync_pnac(gr.hier_block2):
def __init__(self, fft_length, cp_length, kstime, logging=False):
@@ -69,9 +62,9 @@ class ofdm_sync_pnac(gr.hier_block2):
kstime = [k.conjugate() for k in kstime[0:fft_length//2]]
kstime.reverse()
self.crosscorr_filter = filter.fir_filter_ccc(1, kstime)
-
+
# Create a delay line
- self.delay = blocks.delay(gr.sizeof_gr_complex, fft_length/2)
+ self.delay = blocks.delay(gr.sizeof_gr_complex, fft_length / 2)
# Correlation from ML Sync
self.conjg = blocks.conjugate_cc();
@@ -105,7 +98,7 @@ class ofdm_sync_pnac(gr.hier_block2):
self.connect(self.corr, self.c2mag)
self.connect(self.corr, self.angle)
self.connect(self.angle, (self.sample_and_hold,0))
-
+
# Get the power of the input signal to compare against the correlation
self.connect(self.crosscorr_filter, self.mag, self.power)
diff --git a/gr-digital/python/digital/ofdm_txrx.py b/gr-digital/python/digital/ofdm_txrx.py
index 6f96fc6287..f90a579385 100644
--- a/gr-digital/python/digital/ofdm_txrx.py
+++ b/gr-digital/python/digital/ofdm_txrx.py
@@ -25,24 +25,21 @@ For simple configurations, no need to connect all the relevant OFDM blocks
to form an OFDM Tx/Rx--simply use these.
"""
+from __future__ import print_function
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import unicode_literals
+
# Reminder: All frequency-domain stuff is in shifted form, i.e. DC carrier
# in the middle!
+
import numpy
-from gnuradio import gr
-import digital_swig as digital
-from utils import tagged_streams
-try:
- # This will work when feature #505 is added.
- from gnuradio import fft
- from gnuradio import blocks
- from gnuradio import analog
-except ImportError:
- # Until then this will work.
- import fft_swig as fft
- import blocks_swig as blocks
- import analog_swig as analog
+from gnuradio import gr, blocks, fft, analog
+
+from . import digital_swig as digital
+
_def_fft_len = 64
_def_cp_len = 16
@@ -50,7 +47,7 @@ _def_frame_length_tag_key = "frame_length"
_def_packet_length_tag_key = "packet_length"
_def_packet_num_tag_key = "packet_num"
# Data and pilot carriers are same as in 802.11a
-_def_occupied_carriers = (range(-26, -21) + range(-20, -7) + range(-6, 0) + range(1, 7) + range(8, 21) + range(22, 27),)
+_def_occupied_carriers = (list(range(-26, -21)) + list(range(-20, -7)) + list(range(-6, 0)) + list(range(1, 7)) + list(range(8, 21)) + list(range(22, 27)),)
_def_pilot_carriers=((-21, -7, 7, 21,),)
_pilot_sym_scramble_seq = (
1,1,1,1, -1,-1,-1,1, -1,-1,-1,-1, 1,1,-1,1, -1,-1,1,1, -1,1,1,-1, 1,1,1,1, 1,1,-1,1,
@@ -112,7 +109,7 @@ def _get_constellation(bps):
try:
return constellation[bps]
except KeyError:
- print 'Modulation not supported.'
+ print('Modulation not supported.')
exit(1)
class ofdm_tx(gr.hier_block2):
diff --git a/gr-digital/python/digital/packet_utils.py b/gr-digital/python/digital/packet_utils.py
index de7e2988da..04d27125fa 100644
--- a/gr-digital/python/digital/packet_utils.py
+++ b/gr-digital/python/digital/packet_utils.py
@@ -19,10 +19,18 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import print_function
+from __future__ import absolute_import
+from __future__ import division
+
import struct
+
import numpy
+import six
+
from gnuradio import gru
-import crc
+from . import crc
+
def conv_packed_binary_string_to_1_0_string(s):
"""
@@ -35,7 +43,7 @@ def conv_packed_binary_string_to_1_0_string(s):
t = (x >> i) & 0x1
r.append(t)
- return ''.join(map(lambda x: chr(x + ord('0')), r))
+ return ''.join([chr(x + ord('0')) for x in r])
def conv_1_0_string_to_packed_binary_string(s):
"""
@@ -46,7 +54,7 @@ def conv_1_0_string_to_packed_binary_string(s):
to get to a multiple of 8.
"""
if not is_1_0_string(s):
- raise ValueError, "Input must be a string containing only 0's and 1's"
+ raise ValueError("Input must be a string containing only 0's and 1's")
# pad to multiple of 8
padded = False
@@ -83,7 +91,7 @@ def is_1_0_string(s):
return True
def string_to_hex_list(s):
- return map(lambda x: hex(ord(x)), s)
+ return [hex(ord(x)) for x in s]
def whiten(s, o):
@@ -98,8 +106,8 @@ def dewhiten(s, o):
def make_header(payload_len, whitener_offset=0):
# Upper nibble is offset, lower 12 bits is len
val = ((whitener_offset & 0xf) << 12) | (payload_len & 0x0fff)
- #print "offset =", whitener_offset, " len =", payload_len, " val=", val
- return struct.pack('!HH', val, val)
+ #print("offset =", whitener_offset, " len =", payload_len, " val=", val)
+ return struct.pack(b'!HH', val, val)
def make_packet(payload, samples_per_symbol, bits_per_symbol,
preamble=default_preamble, access_code=default_access_code,
@@ -123,13 +131,13 @@ def make_packet(payload, samples_per_symbol, bits_per_symbol,
and finally CRC-32.
"""
if not is_1_0_string(preamble):
- raise ValueError, "preamble must be a string containing only 0's and 1's (%r)" % (preamble,)
+ raise ValueError("preamble must be a string containing only 0's and 1's (%r)" % (preamble,))
if not is_1_0_string(access_code):
- raise ValueError, "access_code must be a string containing only 0's and 1's (%r)" % (access_code,)
+ raise ValueError("access_code must be a string containing only 0's and 1's (%r)" % (access_code,))
if not whitener_offset >=0 and whitener_offset < 16:
- raise ValueError, "whitener_offset must be between 0 and 15, inclusive (%i)" % (whitener_offset,)
+ raise ValueError("whitener_offset must be between 0 and 15, inclusive (%i)" % (whitener_offset,))
(packed_access_code, padded) = conv_1_0_string_to_packed_binary_string(access_code)
(packed_preamble, ignore) = conv_1_0_string_to_packed_binary_string(preamble)
@@ -138,24 +146,24 @@ def make_packet(payload, samples_per_symbol, bits_per_symbol,
payload_with_crc = crc.gen_and_append_crc32(payload)
else:
payload_with_crc = payload
- #print "outbound crc =", string_to_hex_list(payload_with_crc[-4:])
+ #print("outbound crc =", string_to_hex_list(payload_with_crc[-4:]))
L = len(payload_with_crc)
MAXLEN = len(random_mask_tuple)
if L > MAXLEN:
- raise ValueError, "len(payload) must be in [0, %d]" % (MAXLEN,)
+ raise ValueError("len(payload) must be in [0, %d]" % (MAXLEN,))
if whitening:
- pkt = ''.join((packed_preamble, packed_access_code, make_header(L, whitener_offset),
- whiten(payload_with_crc, whitener_offset), '\x55'))
+ pkt = b''.join((packed_preamble, packed_access_code, make_header(L, whitener_offset),
+ whiten(payload_with_crc, whitener_offset), b'\x55'))
else:
- pkt = ''.join((packed_preamble, packed_access_code, make_header(L, whitener_offset),
- (payload_with_crc), '\x55'))
+ pkt = b''.join((packed_preamble, packed_access_code, make_header(L, whitener_offset),
+ (payload_with_crc), b'\x55'))
if pad_for_usrp:
- pkt = pkt + (_npadding_bytes(len(pkt), int(samples_per_symbol), bits_per_symbol) * '\x55')
+ pkt = pkt + (_npadding_bytes(len(pkt), int(samples_per_symbol), bits_per_symbol) * b'\x55')
- #print "make_packet: len(pkt) =", len(pkt)
+ #print("make_packet: len(pkt) =", len(pkt))
return pkt
def _npadding_bytes(pkt_byte_len, samples_per_symbol, bits_per_symbol):
@@ -175,7 +183,7 @@ def _npadding_bytes(pkt_byte_len, samples_per_symbol, bits_per_symbol):
number of bytes of padding to append.
"""
modulus = 128
- byte_modulus = gru.lcm(modulus/8, samples_per_symbol) * bits_per_symbol / samples_per_symbol
+ byte_modulus = gru.lcm(modulus // 8, samples_per_symbol) * bits_per_symbol // samples_per_symbol
r = pkt_byte_len % byte_modulus
if r == 0:
return 0
@@ -206,10 +214,10 @@ def unmake_packet(whitened_payload_with_crc, whitener_offset=0,
ok = True
if 0:
- print "payload_with_crc =", string_to_hex_list(payload_with_crc)
- print "ok = %r, len(payload) = %d" % (ok, len(payload))
- print "payload =", string_to_hex_list(payload)
- print ""
+ print("payload_with_crc =", string_to_hex_list(payload_with_crc))
+ print("ok = %r, len(payload) = %d" % (ok, len(payload)))
+ print("payload =", string_to_hex_list(payload))
+ print("")
return ok, payload
diff --git a/gr-digital/python/digital/pkt.py b/gr-digital/python/digital/pkt.py
index fbdcaa3a66..585a2915c0 100644
--- a/gr-digital/python/digital/pkt.py
+++ b/gr-digital/python/digital/pkt.py
@@ -1,34 +1,34 @@
#
# Copyright 2005, 2006, 2007 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import absolute_import
+from __future__ import unicode_literals
from math import pi
-from gnuradio import gr
+from gnuradio import gr, blocks
import gnuradio.gr.gr_threading as _threading
-import packet_utils
-import digital_swig as digital
+from . import packet_utils
+from . import digital_swig as digital
-try:
- from gnuradio import blocks
-except ImportError:
- import blocks_swig as blocks
# /////////////////////////////////////////////////////////////////////////////
# mod/demod with packets as i/o
@@ -43,7 +43,7 @@ class mod_pkts(gr.hier_block2):
def __init__(self, modulator, preamble=None, access_code=None, msgq_limit=2,
pad_for_usrp=True, use_whitener_offset=False, modulate=True):
"""
- Hierarchical block for sending packets
+ Hierarchical block for sending packets
Packets to be sent are enqueued by calling send_pkt.
The output is the complex modulated signal at baseband.
@@ -54,29 +54,29 @@ class mod_pkts(gr.hier_block2):
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
"""
- gr.hier_block2.__init__(self, "mod_pkts",
- gr.io_signature(0, 0, 0), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
+ gr.hier_block2.__init__(self, "mod_pkts",
+ gr.io_signature(0, 0, 0), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
self._modulator = modulator
self._pad_for_usrp = pad_for_usrp
self._use_whitener_offset = use_whitener_offset
self._whitener_offset = 0
-
+
if access_code is None:
access_code = packet_utils.default_access_code
if not packet_utils.is_1_0_string(access_code):
- raise ValueError, "Invalid access_code %r. Must be string of 1's and 0's" % (access_code,)
+ raise ValueError("Invalid access_code %r. Must be string of 1's and 0's" % (access_code,))
self._access_code = access_code
-
+
if preamble is None:
preamble = packet_utils.default_preamble
if not packet_utils.is_1_0_string(preamble):
- raise ValueError, "Invalid preamble %r. Must be string of 1's and 0's" % (preamble,)
+ raise ValueError("Invalid preamble %r. Must be string of 1's and 0's" % (preamble,))
self._preamble = preamble
# accepts messages from the outside world
@@ -93,7 +93,7 @@ class mod_pkts(gr.hier_block2):
if eof:
msg = gr.message(1) # tell self._pkt_input we're not sending any more packets
else:
- # print "original_payload =", string_to_hex_list(payload)
+ # print("original_payload =", string_to_hex_list(payload))
pkt = packet_utils.make_packet(payload,
self._modulator.samples_per_symbol(),
self._modulator.bits_per_symbol(),
@@ -101,11 +101,11 @@ class mod_pkts(gr.hier_block2):
self._access_code,
self._pad_for_usrp,
self._whitener_offset)
- #print "pkt =", string_to_hex_list(pkt)
+ #print("pkt =", string_to_hex_list(pkt))
msg = gr.message_from_string(pkt)
if self._use_whitener_offset is True:
self._whitener_offset = (self._whitener_offset + 1) % 16
-
+
self._pkt_input.msgq().insert_tail(msg)
@@ -120,9 +120,9 @@ class demod_pkts(gr.hier_block2):
def __init__(self, demodulator, access_code=None, callback=None, threshold=-1):
"""
- Hierarchical block for demodulating and deframing packets.
+ Hierarchical block for demodulating and deframing packets.
- The input is the complex modulated signal at baseband.
+ The input is the complex modulated signal at baseband.
Demodulated packets are sent to the handler.
Args:
@@ -130,17 +130,17 @@ class demod_pkts(gr.hier_block2):
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",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
- gr.io_signature(0, 0, 0)) # Output signature
+ gr.hier_block2.__init__(self, "demod_pkts",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
+ gr.io_signature(0, 0, 0)) # Output signature
self._demodulator = demodulator
if access_code is None:
access_code = packet_utils.default_access_code
if not packet_utils.is_1_0_string(access_code):
- raise ValueError, "Invalid access_code %r. Must be string of 1's and 0's" % (access_code,)
+ raise ValueError("Invalid access_code %r. Must be string of 1's and 0's" % (access_code,))
self._access_code = access_code
if threshold == -1:
@@ -151,7 +151,7 @@ class demod_pkts(gr.hier_block2):
self.framer_sink = digital.framer_sink_1(self._rcvd_pktq)
self.connect(self, self._demodulator, self.correlator, self.framer_sink)
-
+
self._watcher = _queue_watcher_thread(self._rcvd_pktq, callback)
diff --git a/gr-digital/python/digital/psk.py b/gr-digital/python/digital/psk.py
index 0e0c65ea2b..5518ba55f3 100644
--- a/gr-digital/python/digital/psk.py
+++ b/gr-digital/python/digital/psk.py
@@ -1,36 +1,40 @@
#
# Copyright 2005,2006,2011 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
"""
PSK modulation and demodulation.
"""
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import unicode_literals
+
from math import pi, log
from cmath import exp
-import digital_swig
-import modulation_utils
-from utils import mod_codes, gray_code
-from generic_mod_demod import generic_mod, generic_demod
-from generic_mod_demod import shared_mod_args, shared_demod_args
+from . import digital_swig
+from . import modulation_utils
+from .utils import mod_codes, gray_code
+from .generic_mod_demod import generic_mod, generic_demod
+from .generic_mod_demod import shared_mod_args, shared_demod_args
# Default number of points in constellation.
_def_constellation_points = 4
@@ -56,7 +60,7 @@ def create_encodings(mod_code, arity, differential):
else:
raise ValueError('That modulation code is not implemented for this constellation.')
return (pre_diff_code, post_diff_code)
-
+
# /////////////////////////////////////////////////////////////////////////////
# PSK constellation
# /////////////////////////////////////////////////////////////////////////////
@@ -68,7 +72,7 @@ def psk_constellation(m=_def_constellation_points, mod_code=_def_mod_code,
"""
k = log(m) / log(2.0)
if (k != int(k)):
- raise StandardError('Number of constellation points must be a power of two.')
+ raise Exception('Number of constellation points must be a power of two.')
points = [exp(2*pi*(0+1j)*i/m) for i in range(0,m)]
pre_diff_code, post_diff_code = create_encodings(mod_code, m, differential)
if post_diff_code is not None:
@@ -84,7 +88,7 @@ def psk_constellation(m=_def_constellation_points, mod_code=_def_mod_code,
class psk_mod(generic_mod):
"""
Hierarchical block for RRC-filtered PSK modulation.
-
+
The input is a byte stream (unsigned char), treated as a series of packed
symbols. Symbols are grouped from MSB to LSB.
@@ -118,7 +122,7 @@ class psk_demod(generic_demod):
"""
Hierarchical block for RRC-filtered PSK modulation.
-
+
The input is a complex modulated signal at baseband.
The output is a stream of bytes, each representing a recovered bit.
diff --git a/gr-digital/python/digital/psk_constellations.py b/gr-digital/python/digital/psk_constellations.py
index ee3c2e6070..781b076f18 100755..100644
--- a/gr-digital/python/digital/psk_constellations.py
+++ b/gr-digital/python/digital/psk_constellations.py
@@ -20,8 +20,10 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import absolute_import
+from __future__ import unicode_literals
import numpy
-from constellation_map_generator import constellation_map_generator
+from .constellation_map_generator import constellation_map_generator
'''
Note on the naming scheme. Each constellation is named using a prefix
diff --git a/gr-digital/python/digital/qa_binary_slicer_fb.py b/gr-digital/python/digital/qa_binary_slicer_fb.py
index 93e12dbb8d..0b2879380b 100755..100644
--- a/gr-digital/python/digital/qa_binary_slicer_fb.py
+++ b/gr-digital/python/digital/qa_binary_slicer_fb.py
@@ -1,24 +1,25 @@
#!/usr/bin/env python
#
# Copyright 2011-2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
import random
@@ -33,8 +34,8 @@ class test_binary_slicer_fb(gr_unittest.TestCase):
self.tb = None
def test_binary_slicer_fb(self):
- expected_result = ( 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1)
- src_data = (-1, 1, -1, -1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1)
+ expected_result = ( 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1)
+ src_data = (-1, 1, -1, -1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1)
src_data = [s + (1 - random.random()) for s in src_data] # add some noise
src = blocks.vector_source_f(src_data)
op = digital.binary_slicer_fb()
@@ -45,11 +46,10 @@ class test_binary_slicer_fb(gr_unittest.TestCase):
self.tb.run() # run the graph and wait for it to finish
actual_result = dst.data() # fetch the contents of the sink
- #print "actual result", actual_result
- #print "expected result", expected_result
+ #print "actual result", actual_result
+ #print "expected result", expected_result
self.assertFloatTuplesAlmostEqual(expected_result, actual_result)
if __name__ == '__main__':
gr_unittest.run(test_binary_slicer_fb, "test_binary_slicer_fb.xml")
-
diff --git a/gr-digital/python/digital/qa_burst_shaper.py b/gr-digital/python/digital/qa_burst_shaper.py
index 36c6d06479..949a5f573d 100755..100644
--- a/gr-digital/python/digital/qa_burst_shaper.py
+++ b/gr-digital/python/digital/qa_burst_shaper.py
@@ -21,6 +21,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest
from gnuradio import blocks, digital
import pmt
@@ -121,7 +122,7 @@ class qa_burst_shaper (gr_unittest.TestCase):
window = np.concatenate((-2.0*np.ones(5), -4.0*np.ones(5)))
tags = (make_length_tag(0, length),)
phasing = np.zeros(5)
- for i in xrange(5):
+ for i in range(5):
phasing[i] = ((-1.0)**i)
expected = np.concatenate((np.zeros(prepad), phasing*window[0:5],
np.ones(length), phasing*window[5:10],
@@ -154,7 +155,7 @@ class qa_burst_shaper (gr_unittest.TestCase):
-4.0*np.ones(5, dtype=complex)))
tags = (make_length_tag(0, length),)
phasing = np.zeros(5, dtype=complex)
- for i in xrange(5):
+ for i in range(5):
phasing[i] = complex((-1.0)**i)
expected = np.concatenate((np.zeros(prepad, dtype=complex),
phasing*window[0:5],
@@ -264,7 +265,7 @@ class qa_burst_shaper (gr_unittest.TestCase):
# checks
self.assertFloatTuplesAlmostEqual(sink.data(), expected, 6)
- for i in xrange(len(etags)):
+ for i in range(len(etags)):
self.assertTrue(compare_tags(sink.tags()[i], etags[i]))
def test_tag_gap (self):
@@ -303,7 +304,7 @@ class qa_burst_shaper (gr_unittest.TestCase):
# checks
self.assertFloatTuplesAlmostEqual(sink.data(), expected, 6)
- for i in xrange(len(etags)):
+ for i in range(len(etags)):
self.assertTrue(compare_tags(sink.tags()[i], etags[i]))
def test_tag_propagation (self):
diff --git a/gr-digital/python/digital/qa_chunks_to_symbols.py b/gr-digital/python/digital/qa_chunks_to_symbols.py
index 0d80f71d6c..8a4266617f 100755..100644
--- a/gr-digital/python/digital/qa_chunks_to_symbols.py
+++ b/gr-digital/python/digital/qa_chunks_to_symbols.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
import pmt
from gnuradio import gr, gr_unittest, digital, blocks
@@ -138,12 +139,12 @@ class test_chunks_to_symbols(gr_unittest.TestCase):
def test_sf_callback(self):
- constA = [-3, -1, 1, 3]
+ constA = [-3, -1, 1, 3]
constB = [12, -12, 6, -6]
src_data = (0, 1, 2, 3, 3, 2, 1, 0)
expected_result=(12, -12, 6, -6, -6, 6, -12, 12)
- src = blocks.vector_source_s(src_data, False, 1, "")
+ src = blocks.vector_source_s(src_data, False, 1, "")
op = digital.chunks_to_symbols_sf(constA)
op.set_symbol_table(constB)
dst = blocks.vector_sink_f()
@@ -159,7 +160,7 @@ class test_chunks_to_symbols(gr_unittest.TestCase):
src_data = (0, 1, 2, 3, 3, 2, 1, 0)
expected_result=(12.0+1j, -12.0-1j, 6.0+1j, -6-1j, -6-1j, 6+1j, -12-1j, 12+1j)
- src = blocks.vector_source_s(src_data, False, 1, "")
+ src = blocks.vector_source_s(src_data, False, 1, "")
op = digital.chunks_to_symbols_sc(constA)
op.set_symbol_table(constB)
dst = blocks.vector_sink_c()
diff --git a/gr-digital/python/digital/qa_clock_recovery_mm.py b/gr-digital/python/digital/qa_clock_recovery_mm.py
index 878ea25c6c..0618ec321c 100755..100644
--- a/gr-digital/python/digital/qa_clock_recovery_mm.py
+++ b/gr-digital/python/digital/qa_clock_recovery_mm.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
import random
import cmath
diff --git a/gr-digital/python/digital/qa_cma_equalizer.py b/gr-digital/python/digital/qa_cma_equalizer.py
index 6da391f70c..228d951640 100755..100644
--- a/gr-digital/python/digital/qa_cma_equalizer.py
+++ b/gr-digital/python/digital/qa_cma_equalizer.py
@@ -1,48 +1,49 @@
#!/usr/bin/env python
#
# Copyright 2006,2007,2010,2011,2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
from gnuradio import gr, gr_unittest, digital, blocks
class test_cma_equalizer_fir(gr_unittest.TestCase):
def setUp(self):
- self.tb = gr.top_block()
+ self.tb = gr.top_block()
def tearDown(self):
- self.tb = None
-
+ self.tb = None
+
def transform(self, src_data):
- SRC = blocks.vector_source_c(src_data, False)
- EQU = digital.cma_equalizer_cc(4, 1.0, .001, 1)
- DST = blocks.vector_sink_c()
- self.tb.connect(SRC, EQU, DST)
- self.tb.run()
- return DST.data()
+ SRC = blocks.vector_source_c(src_data, False)
+ EQU = digital.cma_equalizer_cc(4, 1.0, .001, 1)
+ DST = blocks.vector_sink_c()
+ self.tb.connect(SRC, EQU, DST)
+ self.tb.run()
+ return DST.data()
def test_001_identity(self):
- # Constant modulus signal so no adjustments
- src_data = (1+0j, 0+1j, -1+0j, 0-1j)*1000
- expected_data = src_data
- result = self.transform(src_data)
+ # Constant modulus signal so no adjustments
+ src_data = (1+0j, 0+1j, -1+0j, 0-1j)*1000
+ expected_data = src_data
+ result = self.transform(src_data)
N = -500
self.assertComplexTuplesAlmostEqual(expected_data[N:], result[N:])
diff --git a/gr-digital/python/digital/qa_constellation.py b/gr-digital/python/digital/qa_constellation.py
index 42e49bb059..3436ce6f45 100644
--- a/gr-digital/python/digital/qa_constellation.py
+++ b/gr-digital/python/digital/qa_constellation.py
@@ -20,6 +20,8 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import division
+
import random, math
from cmath import exp, pi, log, sqrt
@@ -51,7 +53,7 @@ def twod_constell():
def threed_constell():
oned_points = ((1+0j), (0+1j), (-1+0j), (0-1j))
points = []
- r4 = range(0, 4)
+ r4 = list(range(0, 4))
for ia in r4:
for ib in r4:
for ic in r4:
@@ -143,7 +145,7 @@ def tested_constellations(easy=True, medium=True, difficult=True):
diff_poss = (True, False)
else:
diff_poss = (False,)
- poss_args = [[argname, argvalues, 0] for argname, argvalues in poss_args.items()]
+ poss_args = [[argname, argvalues, 0] for argname, argvalues in list(poss_args.items())]
for current_diff in diff_poss:
# Add an index into args to keep track of current position in argvalues
while True:
@@ -211,7 +213,7 @@ class test_constellation(gr_unittest.TestCase):
table = digital.soft_dec_table_generator(digital.sd_psk_4_0, prec, Es)
c.set_soft_dec_lut(table, prec)
- x = sqrt(2.0)/2.0
+ x = sqrt(2.0) / 2.0
step = (x.real+x.real) / (2**prec - 1)
samples = [ -x-x*1j, -x+x*1j,
x+x*1j, x-x*1j,
@@ -253,7 +255,7 @@ class test_constellation(gr_unittest.TestCase):
table = digital.soft_dec_table(constel, code, prec)
c.gen_soft_dec_lut(prec)
- x = sqrt(2.0)/2.0
+ x = sqrt(2.0) / 2.0
step = (x.real+x.real) / (2**prec - 1)
samples = [ -x-x*1j, -x+x*1j,
x+x*1j, x-x*1j,
@@ -293,7 +295,7 @@ class test_constellation(gr_unittest.TestCase):
table = digital.soft_dec_table(constel, code, prec)
c.gen_soft_dec_lut(prec)
- x = sqrt(2.0)/2.0
+ x = sqrt(2.0) / 2.0
step = (x.real+x.real) / (2**prec - 1)
samples = [ -x-x*1j, -x+x*1j,
x+x*1j, x-x*1j,
@@ -322,9 +324,9 @@ class mod_demod(gr.hier_block2):
# that they can work with shorts and ints as well as chars.
raise ValueError("Constellation cannot contain more than 256 points.")
- gr.hier_block2.__init__(self, "mod_demod",
- gr.io_signature(1, 1, gr.sizeof_char), # Input signature
- gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
+ gr.hier_block2.__init__(self, "mod_demod",
+ gr.io_signature(1, 1, gr.sizeof_char), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
arity = constellation.arity()
diff --git a/gr-digital/python/digital/qa_constellation_decoder_cb.py b/gr-digital/python/digital/qa_constellation_decoder_cb.py
index d3fbce91ba..e7350be553 100755..100644
--- a/gr-digital/python/digital/qa_constellation_decoder_cb.py
+++ b/gr-digital/python/digital/qa_constellation_decoder_cb.py
@@ -1,24 +1,25 @@
#!/usr/bin/env python
#
# Copyright 2004,2007,2010-2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
from gnuradio import gr, gr_unittest, digital, blocks
@@ -32,9 +33,9 @@ class test_constellation_decoder(gr_unittest.TestCase):
def test_constellation_decoder_cb_bpsk(self):
cnst = digital.constellation_bpsk()
- src_data = (0.5 + 0.5j, 0.1 - 1.2j, -0.8 - 0.1j, -0.45 + 0.8j,
+ src_data = (0.5 + 0.5j, 0.1 - 1.2j, -0.8 - 0.1j, -0.45 + 0.8j,
0.8 + 1.0j, -0.5 + 0.1j, 0.1 - 1.2j)
- expected_result = ( 1, 1, 0, 0,
+ expected_result = ( 1, 1, 0, 0,
1, 0, 1)
src = blocks.vector_source_c(src_data)
op = digital.constellation_decoder_cb(cnst.base())
@@ -45,18 +46,18 @@ class test_constellation_decoder(gr_unittest.TestCase):
self.tb.run() # run the graph and wait for it to finish
actual_result = dst.data() # fetch the contents of the sink
- #print "actual result", actual_result
- #print "expected result", expected_result
+ #print "actual result", actual_result
+ #print "expected result", expected_result
self.assertFloatTuplesAlmostEqual(expected_result, actual_result)
def _test_constellation_decoder_cb_qpsk(self):
cnst = digital.constellation_qpsk()
- src_data = (0.5 + 0.5j, 0.1 - 1.2j, -0.8 - 0.1j, -0.45 + 0.8j,
+ src_data = (0.5 + 0.5j, 0.1 - 1.2j, -0.8 - 0.1j, -0.45 + 0.8j,
0.8 + 1.0j, -0.5 + 0.1j, 0.1 - 1.2j)
- expected_result = ( 3, 1, 0, 2,
+ expected_result = ( 3, 1, 0, 2,
3, 2, 1)
src = blocks.vector_source_c(src_data)
- op = digital_swig.constellation_decoder_cb(cnst.base())
+ op = digital.constellation_decoder_cb(cnst.base())
dst = blocks.vector_sink_b()
self.tb.connect(src, op)
@@ -64,11 +65,10 @@ class test_constellation_decoder(gr_unittest.TestCase):
self.tb.run() # run the graph and wait for it to finish
actual_result = dst.data() # fetch the contents of the sink
- #print "actual result", actual_result
- #print "expected result", expected_result
+ #print "actual result", actual_result
+ #print "expected result", expected_result
self.assertFloatTuplesAlmostEqual(expected_result, actual_result)
if __name__ == '__main__':
gr_unittest.run(test_constellation_decoder, "test_constellation_decoder.xml")
-
diff --git a/gr-digital/python/digital/qa_constellation_receiver.py b/gr-digital/python/digital/qa_constellation_receiver.py
index f0d7275d34..4850863fa5 100755..100644
--- a/gr-digital/python/digital/qa_constellation_receiver.py
+++ b/gr-digital/python/digital/qa_constellation_receiver.py
@@ -1,24 +1,28 @@
#!/usr/bin/env python
#
# Copyright 2011,2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import absolute_import
+
import random
import math
@@ -53,12 +57,13 @@ TIMING_OFFSET = 1.0
FREQ_BW = 2*math.pi/100.0
PHASE_BW = 2*math.pi/100.0
+
class channel_model(gr.hier_block2):
def __init__(self, noise_voltage, freq, timing):
- gr.hier_block2.__init__(self, "channel_model",
- gr.io_signature(1, 1, gr.sizeof_gr_complex),
+ gr.hier_block2.__init__(self, "channel_model",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex),
gr.io_signature(1, 1, gr.sizeof_gr_complex))
-
+
timing_offset = filter.mmse_resampler_cc(0, timing)
noise_adder = blocks.add_cc()
@@ -74,16 +79,16 @@ class channel_model(gr.hier_block2):
self.connect(mixer_offset, (noise_adder,1))
self.connect(noise, (noise_adder,0))
self.connect(noise_adder, self)
-
+
class test_constellation_receiver(gr_unittest.TestCase):
-
+
# We ignore the first half of the output data since often it takes
# a while for the receiver to lock on.
ignore_fraction = 0.8
max_data_length = DATA_LENGTH * 6
max_num_samples = 1000
-
+
def test_basic(self):
"""
Tests a bunch of different constellations by using generic
@@ -172,7 +177,7 @@ class rec_test_tb(gr.top_block):
super(rec_test_tb, self).__init__()
# Transmission Blocks
if src_data is None:
- self.src_data = tuple([rndm.randint(0,1) for i in range(0, data_length)])
+ self.src_data = tuple([random.randint(0,1) for i in range(0, data_length)])
else:
self.src_data = src_data
packer = blocks.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST)
@@ -182,7 +187,7 @@ class rec_test_tb(gr.top_block):
if freq_offset:
channel = channel_model(NOISE_VOLTAGE, FREQUENCY_OFFSET, TIMING_OFFSET)
else:
- channel = channel_model(NOISE_VOLTAGE, 0, TIMING_OFFSET)
+ channel = channel_model(NOISE_VOLTAGE, 0, TIMING_OFFSET)
# Receiver Blocks
if freq_offset:
demod = generic_demod(constellation, differential=differential,
diff --git a/gr-digital/python/digital/qa_constellation_soft_decoder_cf.py b/gr-digital/python/digital/qa_constellation_soft_decoder_cf.py
index 872aed0157..629d52c0a4 100644
--- a/gr-digital/python/digital/qa_constellation_soft_decoder_cf.py
+++ b/gr-digital/python/digital/qa_constellation_soft_decoder_cf.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest, digital, blocks
from math import sqrt
from numpy import random, vectorize
@@ -36,7 +37,7 @@ class test_constellation_soft_decoder(gr_unittest.TestCase):
cnst_pts, code = const_gen()
Es = max([abs(c) for c in cnst_pts])
lut = digital.soft_dec_table_generator(const_sd_gen, prec, Es)
- expected_result = list()
+ expected_result = list()
for s in src_data:
res = digital.calc_soft_dec_from_table(s, lut, prec, sqrt(2.0))
expected_result += res
@@ -52,14 +53,14 @@ class test_constellation_soft_decoder(gr_unittest.TestCase):
self.tb.run()
actual_result = dst.data() # fetch the contents of the sink
- #print "actual result", actual_result
- #print "expected result", expected_result
+ #print "actual result", actual_result
+ #print "expected result", expected_result
self.assertFloatTuplesAlmostEqual(expected_result, actual_result, 5)
def helper_no_lut(self, prec, src_data, const_gen, const_sd_gen):
cnst_pts, code = const_gen()
cnst = digital.constellation_calcdist(cnst_pts, code, 2, 1)
- expected_result = list()
+ expected_result = list()
for s in src_data:
res = digital.calc_soft_dec(s, cnst.points(), code)
expected_result += res
@@ -73,8 +74,8 @@ class test_constellation_soft_decoder(gr_unittest.TestCase):
self.tb.run()
actual_result = dst.data() # fetch the contents of the sink
- #print "actual result", actual_result
- #print "expected result", expected_result
+ #print "actual result", actual_result
+ #print "expected result", expected_result
# Double vs. float precision issues between Python and C++, so
# use only 4 decimals in comparisons.
diff --git a/gr-digital/python/digital/qa_correlate_access_code.py b/gr-digital/python/digital/qa_correlate_access_code.py
index 0302e81313..405147b987 100755..100644
--- a/gr-digital/python/digital/qa_correlate_access_code.py
+++ b/gr-digital/python/digital/qa_correlate_access_code.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest, digital, blocks
default_access_code = '\xAC\xDD\xA4\xE2\xF2\x8C\x20\xFC'
@@ -35,7 +36,7 @@ def string_to_1_0_list(s):
return r
def to_1_0_string(L):
- return ''.join(map(lambda x: chr(x + ord('0')), L))
+ return ''.join([chr(x + ord('0')) for x in L])
class test_correlate_access_code(gr_unittest.TestCase):
diff --git a/gr-digital/python/digital/qa_correlate_access_code_XX_ts.py b/gr-digital/python/digital/qa_correlate_access_code_XX_ts.py
index 5429ce1e07..7666c3bda8 100755..100644
--- a/gr-digital/python/digital/qa_correlate_access_code_XX_ts.py
+++ b/gr-digital/python/digital/qa_correlate_access_code_XX_ts.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest, digital, blocks
import pmt
@@ -35,7 +36,7 @@ def string_to_1_0_list(s):
return r
def to_1_0_string(L):
- return ''.join(map(lambda x: chr(x + ord('0')), L))
+ return ''.join([chr(x + ord('0')) for x in L])
class test_correlate_access_code_XX_ts(gr_unittest.TestCase):
@@ -51,7 +52,7 @@ class test_correlate_access_code_XX_ts(gr_unittest.TestCase):
packet = header + payload
pad = (0,) * 64
src_data = (0, 0, 1, 1, 1, 1, 0, 1, 1) + tuple(string_to_1_0_list(packet)) + pad
- expected = tuple(map(long, src_data[9+32:-len(pad)]))
+ expected = tuple(map(int, src_data[9+32:-len(pad)]))
src = blocks.vector_source_b(src_data)
op = digital.correlate_access_code_bb_ts("1011", 0, "sync")
dst = blocks.vector_sink_b()
diff --git a/gr-digital/python/digital/qa_correlate_access_code_tag.py b/gr-digital/python/digital/qa_correlate_access_code_tag.py
index 378333c286..be5848d9a9 100755..100644
--- a/gr-digital/python/digital/qa_correlate_access_code_tag.py
+++ b/gr-digital/python/digital/qa_correlate_access_code_tag.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest, digital, blocks
default_access_code = '\xAC\xDD\xA4\xE2\xF2\x8C\x20\xFC'
@@ -35,7 +36,7 @@ def string_to_1_0_list(s):
return r
def to_1_0_string(L):
- return ''.join(map(lambda x: chr(x + ord('0')), L))
+ return ''.join([chr(x + ord('0')) for x in L])
class test_correlate_access_code(gr_unittest.TestCase):
diff --git a/gr-digital/python/digital/qa_costas_loop_cc.py b/gr-digital/python/digital/qa_costas_loop_cc.py
index e48f45cc22..283a9199df 100755..100644
--- a/gr-digital/python/digital/qa_costas_loop_cc.py
+++ b/gr-digital/python/digital/qa_costas_loop_cc.py
@@ -20,6 +20,8 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import division
+
import random
import cmath
@@ -57,7 +59,7 @@ class test_costas_loop_cc(gr_unittest.TestCase):
order = 2
self.test = digital.costas_loop_cc(natfreq, order)
- data = [complex(2*random.randint(0,1)-1, 0) for i in xrange(100)]
+ data = [complex(2*random.randint(0,1)-1, 0) for i in range(100)]
self.src = blocks.vector_source_c(data, False)
self.snk = blocks.vector_sink_c()
@@ -76,7 +78,7 @@ class test_costas_loop_cc(gr_unittest.TestCase):
self.test = digital.costas_loop_cc(natfreq, order)
rot = cmath.exp(0.2j) # some small rotation
- data = [complex(2*random.randint(0,1)-1, 0) for i in xrange(100)]
+ data = [complex(2*random.randint(0,1)-1, 0) for i in range(100)]
N = 40 # settling time
expected_result = data[N:]
@@ -102,7 +104,7 @@ class test_costas_loop_cc(gr_unittest.TestCase):
rot = cmath.exp(0.2j) # some small rotation
data = [complex(2*random.randint(0,1)-1, 2*random.randint(0,1)-1)
- for i in xrange(100)]
+ for i in range(100)]
N = 40 # settling time
expected_result = data[N:]
@@ -126,9 +128,9 @@ class test_costas_loop_cc(gr_unittest.TestCase):
order = 8
self.test = digital.costas_loop_cc(natfreq, order)
- rot = cmath.exp(-cmath.pi/8.0j) # rotate to match Costas rotation
+ rot = cmath.exp(-cmath.pi / 8.0j) # rotate to match Costas rotation
const = psk.psk_constellation(order)
- data = [random.randint(0,7) for i in xrange(100)]
+ data = [random.randint(0,7) for i in range(100)]
data = [2*rot*const.points()[d] for d in data]
N = 40 # settling time
diff --git a/gr-digital/python/digital/qa_cpm.py b/gr-digital/python/digital/qa_cpm.py
index 6468ed507b..47a6fa23b4 100755..100644
--- a/gr-digital/python/digital/qa_cpm.py
+++ b/gr-digital/python/digital/qa_cpm.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
import numpy
from gnuradio import gr, gr_unittest, digital, analog, blocks
diff --git a/gr-digital/python/digital/qa_crc32.py b/gr-digital/python/digital/qa_crc32.py
index 9252825ad6..6d3d2fa3ce 100755..100644
--- a/gr-digital/python/digital/qa_crc32.py
+++ b/gr-digital/python/digital/qa_crc32.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
import random
import cmath
diff --git a/gr-digital/python/digital/qa_crc32_bb.py b/gr-digital/python/digital/qa_crc32_bb.py
index 5e45bfb1b0..53ea6f3deb 100755..100644
--- a/gr-digital/python/digital/qa_crc32_bb.py
+++ b/gr-digital/python/digital/qa_crc32_bb.py
@@ -19,6 +19,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest, blocks, digital
import pmt
@@ -33,7 +34,7 @@ class qa_crc32_bb (gr_unittest.TestCase):
def test_001_crc_len (self):
""" Make sure the output of a CRC set is 4 bytes longer than the input. """
- data = range(16)
+ data = list(range(16))
src = blocks.vector_source_b(data)
crc = digital.crc32_bb(False, self.tsb_key)
sink = blocks.tsb_vector_sink_b(tsb_key=self.tsb_key)
@@ -69,7 +70,7 @@ class qa_crc32_bb (gr_unittest.TestCase):
def test_003_crc_correct_lentag (self):
tag_name = "length"
pack_len = 8
- packets = range(pack_len*2)
+ packets = list(range(pack_len*2))
tag1 = gr.tag_t()
tag1.offset = 0
tag1.key = pmt.string_to_symbol(tag_name)
@@ -107,7 +108,7 @@ class qa_crc32_bb (gr_unittest.TestCase):
tags_found = {'tag1': False, 'tag2': False, 'tag3': False}
for tag in sink.tags():
key = pmt.symbol_to_string(tag.key)
- if key in correct_offsets.keys():
+ if key in list(correct_offsets.keys()):
tags_found[key] = True
self.assertEqual(correct_offsets[key], tag.offset)
self.assertTrue(all(tags_found.values()))
@@ -160,7 +161,7 @@ class qa_crc32_bb (gr_unittest.TestCase):
def test_006_crc_len (self):
""" Make sure the output of a CRC set is 32 (unpacked) bytes longer than the input. """
- data = range(16)
+ data = list(range(16))
src = blocks.vector_source_b(data)
crc = digital.crc32_bb(False, self.tsb_key, False)
sink = blocks.tsb_vector_sink_b(tsb_key=self.tsb_key)
@@ -196,7 +197,7 @@ class qa_crc32_bb (gr_unittest.TestCase):
def test_008_crc_correct_lentag (self):
tag_name = "length"
pack_len = 8
- packets = range(pack_len*2)
+ packets = list(range(pack_len*2))
tag1 = gr.tag_t()
tag1.offset = 0
tag1.key = pmt.string_to_symbol(tag_name)
@@ -234,7 +235,7 @@ class qa_crc32_bb (gr_unittest.TestCase):
tags_found = {'tag1': False, 'tag2': False, 'tag3': False}
for tag in sink.tags():
key = pmt.symbol_to_string(tag.key)
- if key in correct_offsets.keys():
+ if key in list(correct_offsets.keys()):
tags_found[key] = True
self.assertEqual(correct_offsets[key], tag.offset)
self.assertTrue(all(tags_found.values()))
diff --git a/gr-digital/python/digital/qa_diff_encoder.py b/gr-digital/python/digital/qa_diff_encoder.py
index 410b937fbc..58d757d0c2 100755..100644
--- a/gr-digital/python/digital/qa_diff_encoder.py
+++ b/gr-digital/python/digital/qa_diff_encoder.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
import random
from gnuradio import gr, gr_unittest, digital, blocks
diff --git a/gr-digital/python/digital/qa_diff_phasor_cc.py b/gr-digital/python/digital/qa_diff_phasor_cc.py
index 7cae4870cc..72063cf92c 100755..100644
--- a/gr-digital/python/digital/qa_diff_phasor_cc.py
+++ b/gr-digital/python/digital/qa_diff_phasor_cc.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest, digital, blocks
class test_diff_phasor(gr_unittest.TestCase):
diff --git a/gr-digital/python/digital/qa_digital.py b/gr-digital/python/digital/qa_digital.py
index 63a167dece..d443b08fde 100755..100644
--- a/gr-digital/python/digital/qa_digital.py
+++ b/gr-digital/python/digital/qa_digital.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest, digital
class test_digital(gr_unittest.TestCase):
diff --git a/gr-digital/python/digital/qa_fll_band_edge.py b/gr-digital/python/digital/qa_fll_band_edge.py
index 17c5fa85f8..a4859565ec 100755..100644
--- a/gr-digital/python/digital/qa_fll_band_edge.py
+++ b/gr-digital/python/digital/qa_fll_band_edge.py
@@ -20,6 +20,8 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import division
+
import random
import math
@@ -48,7 +50,7 @@ class test_fll_band_edge_cc(gr_unittest.TestCase):
# Create a set of 1's and -1's, pulse shape and interpolate to sps
random.seed(0)
- data = [2.0*random.randint(0, 2) - 1.0 for i in xrange(200)]
+ data = [2.0*random.randint(0, 2) - 1.0 for i in range(200)]
self.src = blocks.vector_source_c(data, False)
self.rrc = filter.interp_fir_filter_ccf(sps, rrc_taps)
diff --git a/gr-digital/python/digital/qa_framer_sink.py b/gr-digital/python/digital/qa_framer_sink.py
index 4b260c14ec..555bc121f8 100755..100644
--- a/gr-digital/python/digital/qa_framer_sink.py
+++ b/gr-digital/python/digital/qa_framer_sink.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest, digital, blocks
default_access_code = '\xAC\xDD\xA4\xE2\xF2\x8C\x20\xFC'
@@ -34,7 +35,7 @@ def string_to_1_0_list(s):
return r
def to_1_0_string(L):
- return ''.join(map(lambda x: chr(x + ord('0')), L))
+ return ''.join([chr(x + ord('0')) for x in L])
class test_framker_sink(gr_unittest.TestCase):
diff --git a/gr-digital/python/digital/qa_glfsr_source.py b/gr-digital/python/digital/qa_glfsr_source.py
index f39c408198..2c1921e117 100755..100644
--- a/gr-digital/python/digital/qa_glfsr_source.py
+++ b/gr-digital/python/digital/qa_glfsr_source.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest, digital, blocks
class test_glfsr_source(gr_unittest.TestCase):
@@ -32,8 +33,8 @@ class test_glfsr_source(gr_unittest.TestCase):
def test_000_make_b(self):
src = digital.glfsr_source_b(16)
- self.assertEquals(src.mask(), 0x8016)
- self.assertEquals(src.period(), 2**16-1)
+ self.assertEqual(src.mask(), 0x8016)
+ self.assertEqual(src.period(), 2**16-1)
def test_001_degree_b(self):
self.assertRaises(RuntimeError,
@@ -46,11 +47,11 @@ class test_glfsr_source(gr_unittest.TestCase):
src = digital.glfsr_source_b(degree, False)
b2f = digital.chunks_to_symbols_bf((-1.0,1.0), 1)
dst = blocks.vector_sink_f()
- del self.tb # Discard existing top block
- self.tb = gr.top_block()
+ del self.tb # Discard existing top block
+ self.tb = gr.top_block()
self.tb.connect(src, b2f, dst)
self.tb.run()
- self.tb.disconnect_all()
+ self.tb.disconnect_all()
actual_result = dst.data()
R = auto_correlate(actual_result)
self.assertEqual(R[0], float(len(R))) # Auto-correlation peak at origin
@@ -59,8 +60,8 @@ class test_glfsr_source(gr_unittest.TestCase):
def test_003_make_f(self):
src = digital.glfsr_source_f(16)
- self.assertEquals(src.mask(), 0x8016)
- self.assertEquals(src.period(), 2**16-1)
+ self.assertEqual(src.mask(), 0x8016)
+ self.assertEqual(src.period(), 2**16-1)
def test_004_degree_f(self):
self.assertRaises(RuntimeError,
@@ -71,8 +72,8 @@ class test_glfsr_source(gr_unittest.TestCase):
for degree in range(1,11): # Higher degrees take too long to correlate
src = digital.glfsr_source_f(degree, False)
dst = blocks.vector_sink_f()
- del self.tb # Discard existing top block
- self.tb = gr.top_block()
+ del self.tb # Discard existing top block
+ self.tb = gr.top_block()
self.tb.connect(src, dst)
self.tb.run()
diff --git a/gr-digital/python/digital/qa_hdlc_framer.py b/gr-digital/python/digital/qa_hdlc_framer.py
index 6fed264546..4aa8280e83 100755..100644
--- a/gr-digital/python/digital/qa_hdlc_framer.py
+++ b/gr-digital/python/digital/qa_hdlc_framer.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest, digital, blocks
import pmt
import numpy
@@ -45,7 +46,7 @@ class test_hdlc_framer(gr_unittest.TestCase):
self.tb.msg_connect(deframe, "out", debug, "store")
self.tb.start()
msg = pmt.cons(pmt.PMT_NIL, pmt.init_u8vector(len(src_data),src_data))
- for i in xrange(npkts):
+ for i in range(npkts):
frame.to_basic_block()._post(pmt.intern("in"), msg)
sleep(0.2)
self.tb.stop()
@@ -53,7 +54,7 @@ class test_hdlc_framer(gr_unittest.TestCase):
rxmsg = debug.get_message(0)
result_len = pmt.blob_length(pmt.cdr(rxmsg))
msg_data = []
- for j in xrange(result_len):
+ for j in range(result_len):
msg_data.append(pmt.u8vector_ref(pmt.cdr(rxmsg), j))
self.assertEqual(src_data, msg_data)
diff --git a/gr-digital/python/digital/qa_header_payload_demux.py b/gr-digital/python/digital/qa_header_payload_demux.py
index f36d71067c..d77f7c689d 100755..100644
--- a/gr-digital/python/digital/qa_header_payload_demux.py
+++ b/gr-digital/python/digital/qa_header_payload_demux.py
@@ -20,15 +20,19 @@
#
from __future__ import print_function
+from __future__ import division
+
import time
import random
import numpy
+
from gnuradio import gr
from gnuradio import gr_unittest
from gnuradio import digital
from gnuradio import blocks
import pmt
+
def make_tag(key, value, offset):
tag = gr.tag_t()
tag.offset = offset
@@ -55,7 +59,7 @@ class HeaderToMessageBlock(gr.sync_block):
self.msg_count = 0
def work(self, input_items, output_items):
- for i in xrange(len(input_items[0])/self.header_len):
+ for i in range(len(input_items[0]) // self.header_len):
msg = self.messages[self.msg_count] or False
#print("Sending message: {0}".format(msg))
self.message_port_pub(pmt.intern('header_data'), pmt.to_pmt(msg))
@@ -227,7 +231,7 @@ class qa_header_payload_demux (gr_unittest.TestCase):
header_padding = 1
payload = tuple(range(5, 20))
data_signal = (0,) * n_zeros + header + payload
- trigger_signal = [0,] * len(data_signal)
+ trigger_signal = [0] * len(data_signal)
trigger_signal[n_zeros] = 1
# This is dropped:
testtag1 = make_tag('tag1', 0, 0)
@@ -296,7 +300,7 @@ class qa_header_payload_demux (gr_unittest.TestCase):
payload_offset = -1
payload = tuple(range(5, 20))
data_signal = (0,) * n_zeros + header + payload + (0,) * 100
- trigger_signal = [0,] * len(data_signal)
+ trigger_signal = [0] * len(data_signal)
trigger_signal[n_zeros] = 1
# This goes on output 1, item 3 + 1 (for payload offset)
testtag4 = make_tag('tag4', 314, n_zeros + len(header) + 3)
@@ -379,13 +383,13 @@ class qa_header_payload_demux (gr_unittest.TestCase):
data_src = blocks.vector_source_f(data_signal, False, tags=(testtag1, testtag2, testtag3, testtag4))
trigger_src = blocks.vector_source_b(trigger_signal, False)
hpd = digital.header_payload_demux(
- len(header) / items_per_symbol, # Header length (in symbols)
- items_per_symbol, # Items per symbols
- gi, # Items per guard time
- "frame_len", # Frame length tag key
- "detect", # Trigger tag key
- True, # Output symbols (not items)
- gr.sizeof_float # Bytes per item
+ len(header) // items_per_symbol, # Header length (in symbols)
+ items_per_symbol, # Items per symbols
+ gi, # Items per guard time
+ "frame_len", # Frame length tag key
+ "detect", # Trigger tag key
+ True, # Output symbols (not items)
+ gr.sizeof_float # Bytes per item
)
self.assertEqual(pmt.length(hpd.message_ports_in()), 2) #extra system port defined for you
header_sink = blocks.vector_sink_f(items_per_symbol)
@@ -548,7 +552,7 @@ class qa_header_payload_demux (gr_unittest.TestCase):
indexes = []
burst_sizes = []
total_payload_len = 0
- for burst_count in xrange(n_bursts):
+ for burst_count in range(n_bursts):
gap_size = random.randint(0, max_gap)
signal += [0] * gap_size
is_failure = random.random() < fail_rate
@@ -577,7 +581,7 @@ class qa_header_payload_demux (gr_unittest.TestCase):
### Go, go, go
# The divide-by-20 means we'll usually get the same random seed
# between the first run and the XML run.
- random_seed = int(time.time()/20)
+ random_seed = int(time.time() / 20)
random.seed(random_seed)
print("Random seed: {0}".format(random_seed))
n_bursts = 400
@@ -621,4 +625,3 @@ class qa_header_payload_demux (gr_unittest.TestCase):
if __name__ == '__main__':
gr_unittest.run(qa_header_payload_demux, "qa_header_payload_demux.xml")
-
diff --git a/gr-digital/python/digital/qa_lfsr.py b/gr-digital/python/digital/qa_lfsr.py
index 8b8872ab3b..8cc97a0185 100755..100644
--- a/gr-digital/python/digital/qa_lfsr.py
+++ b/gr-digital/python/digital/qa_lfsr.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
import math
from gnuradio import gr, gr_unittest, digital
@@ -37,7 +38,7 @@ class test_lfsr(gr_unittest.TestCase):
l = digital.lfsr(1, 1, reglen)
result_data = []
- for i in xrange(4*(reglen+1)):
+ for i in range(4*(reglen+1)):
result_data.append(l.next_bit())
expected_result = 4*([1,] + reglen*[0,])
diff --git a/gr-digital/python/digital/qa_lms_equalizer.py b/gr-digital/python/digital/qa_lms_equalizer.py
index 7768c1f078..fa79993f84 100755..100644
--- a/gr-digital/python/digital/qa_lms_equalizer.py
+++ b/gr-digital/python/digital/qa_lms_equalizer.py
@@ -1,51 +1,52 @@
#!/usr/bin/env python
#
# Copyright 2006,2007,2010,2011,2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
from gnuradio import gr, gr_unittest, digital, blocks
class test_lms_dd_equalizer(gr_unittest.TestCase):
def setUp(self):
- self.tb = gr.top_block()
+ self.tb = gr.top_block()
def tearDown(self):
- self.tb = None
-
+ self.tb = None
+
def transform(self, src_data, gain, const):
- SRC = blocks.vector_source_c(src_data, False)
- EQU = digital.lms_dd_equalizer_cc(4, gain, 1, const.base())
- DST = blocks.vector_sink_c()
- self.tb.connect(SRC, EQU, DST)
- self.tb.run()
- return DST.data()
+ SRC = blocks.vector_source_c(src_data, False)
+ EQU = digital.lms_dd_equalizer_cc(4, gain, 1, const.base())
+ DST = blocks.vector_sink_c()
+ self.tb.connect(SRC, EQU, DST)
+ self.tb.run()
+ return DST.data()
def test_001_identity(self):
- # Constant modulus signal so no adjustments
+ # Constant modulus signal so no adjustments
const = digital.constellation_qpsk()
- src_data = const.points()*1000
+ src_data = const.points()*1000
N = 100 # settling time
- expected_data = src_data[N:]
- result = self.transform(src_data, 0.1, const)[N:]
+ expected_data = src_data[N:]
+ result = self.transform(src_data, 0.1, const)[N:]
N = -500
self.assertComplexTuplesAlmostEqual(expected_data[N:], result[N:], 5)
diff --git a/gr-digital/python/digital/qa_map.py b/gr-digital/python/digital/qa_map.py
index 604fa084d9..0b71b2814a 100755..100644
--- a/gr-digital/python/digital/qa_map.py
+++ b/gr-digital/python/digital/qa_map.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest, digital, blocks
class test_map(gr_unittest.TestCase):
@@ -32,7 +33,7 @@ class test_map(gr_unittest.TestCase):
def helper(self, symbols):
src_data = [0, 1, 2, 3, 0, 1, 2, 3]
- expected_data = map(lambda x: symbols[x], src_data)
+ expected_data = [symbols[x] for x in src_data]
src = blocks.vector_source_b(src_data)
op = digital.map_bb(symbols)
dst = blocks.vector_sink_b()
diff --git a/gr-digital/python/digital/qa_mpsk_snr_est.py b/gr-digital/python/digital/qa_mpsk_snr_est.py
index 97d31c7686..dcc7dcc694 100755..100644
--- a/gr-digital/python/digital/qa_mpsk_snr_est.py
+++ b/gr-digital/python/digital/qa_mpsk_snr_est.py
@@ -19,6 +19,7 @@
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
#
+
import random
from gnuradio import gr, gr_unittest, digital, blocks
@@ -34,15 +35,15 @@ class test_mpsk_snr_est(gr_unittest.TestCase):
random.seed(0) # make repeatable
N = 10000
- self._noise = [get_n_cplx() for i in xrange(N)]
- self._bits = [get_cplx() for i in xrange(N)]
+ self._noise = [get_n_cplx() for i in range(N)]
+ self._bits = [get_cplx() for i in range(N)]
def tearDown(self):
self.tb = None
def mpsk_snr_est_setup(self, op):
result = []
- for i in xrange(1,6):
+ for i in range(1,6):
src_data = [b+(i*n) for b,n in zip(self._bits, self._noise)]
src = blocks.vector_source_c(src_data)
@@ -57,7 +58,7 @@ class test_mpsk_snr_est(gr_unittest.TestCase):
return result
def test_mpsk_snr_est_simple(self):
- expected_result = [8.20, 4.99, 3.23, 2.01, 1.03]
+ expected_result = [8.20, 4.99, 3.23, 2.01, 1.03]
N = 10000
alpha = 0.001
@@ -67,7 +68,7 @@ class test_mpsk_snr_est(gr_unittest.TestCase):
self.assertFloatTuplesAlmostEqual(expected_result, actual_result, 2)
def test_mpsk_snr_est_skew(self):
- expected_result = [8.31, 1.83, -1.68, -3.56, -4.68]
+ expected_result = [8.31, 1.83, -1.68, -3.56, -4.68]
N = 10000
alpha = 0.001
@@ -77,7 +78,7 @@ class test_mpsk_snr_est(gr_unittest.TestCase):
self.assertFloatTuplesAlmostEqual(expected_result, actual_result, 2)
def test_mpsk_snr_est_m2m4(self):
- expected_result = [8.01, 3.19, 1.97, 2.15, 2.65]
+ expected_result = [8.01, 3.19, 1.97, 2.15, 2.65]
N = 10000
alpha = 0.001
@@ -87,7 +88,7 @@ class test_mpsk_snr_est(gr_unittest.TestCase):
self.assertFloatTuplesAlmostEqual(expected_result, actual_result, 2)
def test_mpsk_snr_est_svn(self):
- expected_result = [7.91, 3.01, 1.77, 1.97, 2.49]
+ expected_result = [7.91, 3.01, 1.77, 1.97, 2.49]
N = 10000
alpha = 0.001
@@ -97,10 +98,10 @@ class test_mpsk_snr_est(gr_unittest.TestCase):
self.assertFloatTuplesAlmostEqual(expected_result, actual_result, 2)
def test_probe_mpsk_snr_est_m2m4(self):
- expected_result = [8.01, 3.19, 1.97, 2.15, 2.65]
+ expected_result = [8.01, 3.19, 1.97, 2.15, 2.65]
actual_result = []
- for i in xrange(1,6):
+ for i in range(1,6):
src_data = [b+(i*n) for b,n in zip(self._bits, self._noise)]
src = blocks.vector_source_c(src_data)
diff --git a/gr-digital/python/digital/qa_ofdm_carrier_allocator_cvc.py b/gr-digital/python/digital/qa_ofdm_carrier_allocator_cvc.py
index befb15ac4a..4ffe61b8ea 100755..100644
--- a/gr-digital/python/digital/qa_ofdm_carrier_allocator_cvc.py
+++ b/gr-digital/python/digital/qa_ofdm_carrier_allocator_cvc.py
@@ -1,23 +1,24 @@
#!/usr/bin/env python
# Copyright 2012-2014 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
from gnuradio import gr, gr_unittest, digital, blocks
import pmt
@@ -41,7 +42,7 @@ class qa_digital_carrier_allocator_cvc (gr_unittest.TestCase):
pilot_symbols = ((1j,),)
occupied_carriers = ((0, 1, 2),)
pilot_carriers = ((3,),)
- sync_word = (range(fft_len),)
+ sync_word = (list(range(fft_len)),)
expected_result = tuple(sync_word[0] + [1j, 0, 0, 1, 2, 3])
# ^ DC carrier
src = blocks.vector_source_c(tx_symbols, False, 1)
@@ -164,7 +165,7 @@ class qa_digital_carrier_allocator_cvc (gr_unittest.TestCase):
- add some random tags
- don't shift
"""
- tx_symbols = range(1, 16); # 15 symbols
+ tx_symbols = list(range(1, 16)); # 15 symbols
pilot_symbols = ((1j, 2j), (3j, 4j))
occupied_carriers = ((1, 3, 4, 11, 12, 14), (1, 2, 4, 11, 13, 14),)
pilot_carriers = ((2, 13), (3, 12))
@@ -203,7 +204,7 @@ class qa_digital_carrier_allocator_cvc (gr_unittest.TestCase):
correct_offsets = {'tag1': 0, 'tag2': 1, 'tag3': 3, 'tag4': 5}
for tag in sink.tags():
key = pmt.symbol_to_string(tag.key)
- if key in tags_found.keys():
+ if key in list(tags_found.keys()):
tags_found[key] = True
self.assertEqual(correct_offsets[key], tag.offset)
self.assertTrue(all(tags_found.values()))
diff --git a/gr-digital/python/digital/qa_ofdm_chanest_vcvc.py b/gr-digital/python/digital/qa_ofdm_chanest_vcvc.py
index d63b65d018..e39247da0a 100755..100644
--- a/gr-digital/python/digital/qa_ofdm_chanest_vcvc.py
+++ b/gr-digital/python/digital/qa_ofdm_chanest_vcvc.py
@@ -19,6 +19,8 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import division
+
import sys
import numpy
import random
@@ -203,7 +205,7 @@ class qa_ofdm_chanest_vcvc (gr_unittest.TestCase):
tx_data = shift_tuple(sync_symbol1, carr_offset) + \
shift_tuple(sync_symbol2, carr_offset) + \
shift_tuple(data_symbol, carr_offset)
- channel = range(fft_len)
+ channel = list(range(fft_len))
src = blocks.vector_source_c(tx_data, False, fft_len)
chan = blocks.multiply_const_vcc(channel)
chanest = digital.ofdm_chanest_vcvc(sync_symbol1, sync_symbol2, 1)
@@ -234,7 +236,7 @@ class qa_ofdm_chanest_vcvc (gr_unittest.TestCase):
n_iter = 20 # The more the accurater
def run_flow_graph(sync_sym1, sync_sym2, data_sym):
top_block = gr.top_block()
- carr_offset = random.randint(-max_offset/2, max_offset/2) * 2
+ carr_offset = random.randint(-max_offset / 2, max_offset / 2) * 2
tx_data = shift_tuple(sync_sym1, carr_offset) + \
shift_tuple(sync_sym2, carr_offset) + \
shift_tuple(data_sym, carr_offset)
@@ -265,14 +267,14 @@ class qa_ofdm_chanest_vcvc (gr_unittest.TestCase):
rx_sym_est[i] = (sink.data()[i] / channel_est[i]).real
return (carr_offset, list(shift_tuple(rx_sym_est, -carr_offset_hat)))
bit_errors = 0
- for k in xrange(n_iter):
+ for k in range(n_iter):
sync_sym = [(random.randint(0, 1) * 2 - 1) * syncsym_mask[i] for i in range(fft_len)]
ref_sym = [(random.randint(0, 1) * 2 - 1) * carrier_mask[i] for i in range(fft_len)]
data_sym = [(random.randint(0, 1) * 2 - 1) * carrier_mask[i] for i in range(fft_len)]
data_sym[26] = 1
(carr_offset, rx_sym) = run_flow_graph(sync_sym, ref_sym, data_sym)
rx_sym_est = [0,] * fft_len
- for i in xrange(fft_len):
+ for i in range(fft_len):
if carrier_mask[i] == 0:
continue
rx_sym_est[i] = {True: 1, False: -1}[rx_sym[i] > 0]
diff --git a/gr-digital/python/digital/qa_ofdm_cyclic_prefixer.py b/gr-digital/python/digital/qa_ofdm_cyclic_prefixer.py
index ecc1c426d6..fc486fa6a2 100755..100644
--- a/gr-digital/python/digital/qa_ofdm_cyclic_prefixer.py
+++ b/gr-digital/python/digital/qa_ofdm_cyclic_prefixer.py
@@ -20,6 +20,8 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import division
+
from gnuradio import gr, gr_unittest, digital, blocks
import pmt
@@ -37,7 +39,7 @@ class test_ofdm_cyclic_prefixer (gr_unittest.TestCase):
cp_len = 2
expected_result = (6, 7, 0, 1, 2, 3, 4, 5, 6, 7,
6, 7, 0, 1, 2, 3, 4, 5, 6, 7)
- src = blocks.vector_source_c(range(fft_len) * 2, False, fft_len)
+ src = blocks.vector_source_c(list(range(fft_len)) * 2, False, fft_len)
cp = digital.ofdm_cyclic_prefixer(fft_len, fft_len + cp_len)
sink = blocks.vector_sink_c()
self.tb.connect(src, cp, sink)
@@ -49,9 +51,9 @@ class test_ofdm_cyclic_prefixer (gr_unittest.TestCase):
fft_len = 8
cp_len = 2
rolloff = 2
- expected_result = (7.0/2, 8, 1, 2, 3, 4, 5, 6, 7, 8, # 1.0/2
- 7.0/2+1.0/2, 8, 1, 2, 3, 4, 5, 6, 7, 8)
- src = blocks.vector_source_c(range(1, fft_len+1) * 2, False, fft_len)
+ expected_result = (7.0 / 2, 8, 1, 2, 3, 4, 5, 6, 7, 8, # 1.0/2
+ 7.0 / 2+1.0 / 2, 8, 1, 2, 3, 4, 5, 6, 7, 8)
+ src = blocks.vector_source_c(list(range(1, fft_len+1)) * 2, False, fft_len)
cp = digital.ofdm_cyclic_prefixer(fft_len, fft_len + cp_len, rolloff)
sink = blocks.vector_sink_c()
self.tb.connect(src, cp, sink)
@@ -63,13 +65,13 @@ class test_ofdm_cyclic_prefixer (gr_unittest.TestCase):
fft_len = 8
cp_len = 2
tag_name = "ts_last"
- expected_result = (7.0/2, 8, 1, 2, 3, 4, 5, 6, 7, 8, # 1.0/2
- 7.0/2+1.0/2, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1.0/2)
+ expected_result = (7.0 / 2, 8, 1, 2, 3, 4, 5, 6, 7, 8, # 1.0/2
+ 7.0 / 2+1.0 / 2, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1.0 / 2)
tag2 = gr.tag_t()
tag2.offset = 1
tag2.key = pmt.string_to_symbol("random_tag")
tag2.value = pmt.from_long(42)
- src = blocks.vector_source_c(range(1, fft_len+1) * 2, False, fft_len, (tag2,))
+ src = blocks.vector_source_c(list(range(1, fft_len+1)) * 2, False, fft_len, (tag2,))
cp = digital.ofdm_cyclic_prefixer(fft_len, fft_len + cp_len, 2, tag_name)
sink = blocks.tsb_vector_sink_c(tsb_key=tag_name)
self.tb.connect(src, blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, 2, tag_name), cp, sink)
diff --git a/gr-digital/python/digital/qa_ofdm_frame_equalizer_vcvc.py b/gr-digital/python/digital/qa_ofdm_frame_equalizer_vcvc.py
index 1b3ffb7738..482147e33a 100755..100644
--- a/gr-digital/python/digital/qa_ofdm_frame_equalizer_vcvc.py
+++ b/gr-digital/python/digital/qa_ofdm_frame_equalizer_vcvc.py
@@ -1,23 +1,25 @@
#!/usr/bin/env python
# Copyright 2012,2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import division
import numpy
@@ -220,7 +222,7 @@ class qa_ofdm_frame_equalizer_vcvc (gr_unittest.TestCase):
eq = digital.ofdm_frame_equalizer_vcvc(equalizer.base(), 0, self.tsb_key, True)
self.tb.connect(
src,
- blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, len(tx_data)/fft_len, self.tsb_key),
+ blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, len(tx_data) // fft_len, self.tsb_key),
eq,
sink
)
@@ -278,7 +280,7 @@ class qa_ofdm_frame_equalizer_vcvc (gr_unittest.TestCase):
sink = blocks.tsb_vector_sink_c(vlen=fft_len, tsb_key=self.tsb_key)
self.tb.connect(
src,
- blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, len(tx_data)/fft_len, self.tsb_key),
+ blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, len(tx_data) // fft_len, self.tsb_key),
eq,
sink
)
@@ -360,7 +362,7 @@ class qa_ofdm_frame_equalizer_vcvc (gr_unittest.TestCase):
sink = blocks.tsb_vector_sink_c(fft_len, tsb_key=self.tsb_key)
self.tb.connect(
src,
- blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, len(tx_data)/fft_len, self.tsb_key),
+ blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, len(tx_data) // fft_len, self.tsb_key),
eq,
sink
)
diff --git a/gr-digital/python/digital/qa_ofdm_serializer_vcc.py b/gr-digital/python/digital/qa_ofdm_serializer_vcc.py
index 8a60b97882..a53aafccb6 100755..100644
--- a/gr-digital/python/digital/qa_ofdm_serializer_vcc.py
+++ b/gr-digital/python/digital/qa_ofdm_serializer_vcc.py
@@ -1,24 +1,26 @@
#!/usr/bin/env python
#
# Copyright 2012-2014 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import division
import numpy
@@ -42,7 +44,7 @@ class qa_ofdm_serializer_vcc (gr_unittest.TestCase):
0, 13, 1j, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 2j, 0, 0)
expected_result = tuple(range(1, 16)) + (0, 0, 0)
occupied_carriers = ((1, 3, 4, 11, 12, 14), (1, 2, 4, 11, 13, 14),)
- n_syms = len(tx_symbols)/fft_len
+ n_syms = len(tx_symbols) // fft_len
src = blocks.vector_source_c(tx_symbols, False, fft_len)
serializer = digital.ofdm_serializer_vcc(fft_len, occupied_carriers, self.tsb_key, "", 0, "", False)
sink = blocks.tsb_vector_sink_c(tsb_key=self.tsb_key)
@@ -60,7 +62,7 @@ class qa_ofdm_serializer_vcc (gr_unittest.TestCase):
)
expected_result = tuple(range(18))
occupied_carriers = ((13, 14, 15, 1, 2, 3), (-4, -2, -1, 1, 2, 4),)
- n_syms = len(tx_symbols)/fft_len
+ n_syms = len(tx_symbols) // fft_len
src = blocks.vector_source_c(tx_symbols, False, fft_len)
serializer = digital.ofdm_serializer_vcc(fft_len, occupied_carriers, self.tsb_key)
sink = blocks.tsb_vector_sink_c(tsb_key=self.tsb_key)
@@ -71,14 +73,14 @@ class qa_ofdm_serializer_vcc (gr_unittest.TestCase):
def test_002_with_offset (self):
""" Standard test, carrier offset """
fft_len = 16
- tx_symbols = range(1, 16);
+ tx_symbols = list(range(1, 16));
tx_symbols = (0, 0, 1, 1j, 2, 3, 0, 0, 0, 0, 0, 0, 4, 5, 2j, 6,
0, 0, 7, 8, 3j, 9, 0, 0, 0, 0, 0, 0, 10, 4j, 11, 12,
0, 0, 13, 1j, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 2j, 0)
carr_offset = 1 # Compare this with tx_symbols from the previous test
expected_result = tuple(range(1, 16)) + (0, 0, 0)
occupied_carriers = ((1, 3, 4, 11, 12, 14), (1, 2, 4, 11, 13, 14),)
- n_syms = len(tx_symbols)/fft_len
+ n_syms = len(tx_symbols) // fft_len
offsettag = gr.tag_t()
offsettag.offset = 0
offsettag.key = pmt.string_to_symbol("ofdm_sync_carr_offset")
@@ -156,7 +158,7 @@ class qa_ofdm_serializer_vcc (gr_unittest.TestCase):
pilot_carriers,
pilot_symbols, (),
self.tsb_key)
- tx_ifft = fft.fft_vcc(fft_len, False, (1.0/fft_len,)*fft_len, True)
+ tx_ifft = fft.fft_vcc(fft_len, False, (1.0 / fft_len,)*fft_len, True)
oscillator = analog.sig_source_c(1.0, analog.GR_COS_WAVE, freq_offset, 1.0)
mixer = blocks.multiply_cc()
rx_fft = fft.fft_vcc(fft_len, True, (), True)
@@ -182,13 +184,13 @@ class qa_ofdm_serializer_vcc (gr_unittest.TestCase):
def test_005_packet_len_tag (self):
""" Standard test """
fft_len = 16
- tx_symbols = range(1, 16);
+ tx_symbols = list(range(1, 16));
tx_symbols = (0, 1, 1j, 2, 3, 0, 0, 0, 0, 0, 0, 4, 5, 2j, 6, 0,
0, 7, 8, 3j, 9, 0, 0, 0, 0, 0, 0, 10, 4j, 11, 12, 0,
0, 13, 1j, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 2j, 0, 0)
expected_result = tuple(range(1, 16))
occupied_carriers = ((1, 3, 4, 11, 12, 14), (1, 2, 4, 11, 13, 14),)
- n_syms = len(tx_symbols)/fft_len
+ n_syms = len(tx_symbols) // fft_len
packet_len_tsb_key = "packet_len"
tag2 = gr.tag_t()
tag2.offset = 0
diff --git a/gr-digital/python/digital/qa_ofdm_sync_sc_cfb.py b/gr-digital/python/digital/qa_ofdm_sync_sc_cfb.py
index 1558c5d51f..610d883b6c 100755..100644
--- a/gr-digital/python/digital/qa_ofdm_sync_sc_cfb.py
+++ b/gr-digital/python/digital/qa_ofdm_sync_sc_cfb.py
@@ -1,24 +1,26 @@
#!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import division
import numpy
import random
@@ -44,7 +46,7 @@ class qa_ofdm_sync_sc_cfb (gr_unittest.TestCase):
fft_len = 32
cp_len = 4
sig_len = (fft_len + cp_len) * 10
- sync_symbol = [(random.randint(0, 1)*2)-1 for x in range(fft_len/2)] * 2
+ sync_symbol = [(random.randint(0, 1)*2)-1 for x in range(fft_len // 2)] * 2
tx_signal = [0,] * n_zeros + \
sync_symbol[-cp_len:] + \
sync_symbol + \
@@ -60,8 +62,8 @@ class qa_ofdm_sync_sc_cfb (gr_unittest.TestCase):
self.tb.connect((sync, 0), sink_freq)
self.tb.connect((sync, 1), sink_detect)
self.tb.run()
- sig1_detect = sink_detect.data()[0:len(tx_signal)/2]
- sig2_detect = sink_detect.data()[len(tx_signal)/2:]
+ sig1_detect = sink_detect.data()[0:len(tx_signal) // 2]
+ sig2_detect = sink_detect.data()[len(tx_signal) // 2:]
self.assertTrue(abs(sig1_detect.index(1) - (n_zeros + fft_len + cp_len)) < cp_len)
self.assertTrue(abs(sig2_detect.index(1) - (n_zeros + fft_len + cp_len)) < cp_len)
self.assertEqual(numpy.sum(sig1_detect), 1)
@@ -75,7 +77,7 @@ class qa_ofdm_sync_sc_cfb (gr_unittest.TestCase):
max_freq_offset = 2*numpy.pi/fft_len # Otherwise, it's coarse
freq_offset = ((2 * random.random()) - 1) * max_freq_offset
sig_len = (fft_len + cp_len) * 10
- sync_symbol = [(random.randint(0, 1)*2)-1 for x in range(fft_len/2)] * 2
+ sync_symbol = [(random.randint(0, 1)*2)-1 for x in range(fft_len // 2)] * 2
tx_signal = sync_symbol[-cp_len:] + \
sync_symbol + \
[(random.randint(0, 1)*2)-1 for x in range(sig_len)]
@@ -99,8 +101,8 @@ class qa_ofdm_sync_sc_cfb (gr_unittest.TestCase):
fft_len = 32
cp_len = 4
tx_signal = []
- for i in xrange(n_bursts):
- sync_symbol = [(random.randint(0, 1)*2)-1 for x in range(fft_len/2)] * 2
+ for i in range(n_bursts):
+ sync_symbol = [(random.randint(0, 1)*2)-1 for x in range(fft_len // 2)] * 2
tx_signal += [0,] * random.randint(0, 2*fft_len) + \
sync_symbol[-cp_len:] + \
sync_symbol + \
@@ -139,8 +141,8 @@ Detection error was: %d """ % (numpy.sum(sink_detect.data()) - n_bursts)
tagname = "packet_length"
min_packet_length = 10
max_packet_length = 50
- sync_sequence = [random.randint(0, 1)*2-1 for x in range(fft_len/2)]
- for i in xrange(n_bursts):
+ sync_sequence = [random.randint(0, 1)*2-1 for x in range(fft_len // 2)]
+ for i in range(n_bursts):
packet_length = random.randint(min_packet_length,
max_packet_length+1)
packet = [random.randint(0, 255) for i in range(packet_length)]
diff --git a/gr-digital/python/digital/qa_ofdm_txrx.py b/gr-digital/python/digital/qa_ofdm_txrx.py
index ac267d2389..2e8d101317 100755..100644
--- a/gr-digital/python/digital/qa_ofdm_txrx.py
+++ b/gr-digital/python/digital/qa_ofdm_txrx.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
import random
import numpy
diff --git a/gr-digital/python/digital/qa_packet_format.py b/gr-digital/python/digital/qa_packet_format.py
index ae1a79f1f4..6b2e9e958e 100644
--- a/gr-digital/python/digital/qa_packet_format.py
+++ b/gr-digital/python/digital/qa_packet_format.py
@@ -21,6 +21,8 @@
#
import time, struct
+import six
+
import pmt
from gnuradio import gr, gr_unittest, digital, blocks
from gnuradio.digital import packet_utils
@@ -57,6 +59,7 @@ class test_packet_format_fb(gr_unittest.TestCase):
self.tb.start()
while (snk_hdr.num_messages() < 1) and (snk_pld.num_messages() < 1):
time.sleep(0.1)
+
self.tb.stop()
self.tb.wait()
@@ -65,14 +68,14 @@ class test_packet_format_fb(gr_unittest.TestCase):
result_hdr = pmt.u8vector_elements(result_hdr_pmt)
result_pld = pmt.u8vector_elements(result_pld_pmt)
- header = "".join([chr(r) for r in result_hdr])
- payload = "".join([chr(r) for r in result_pld])
+ header = "".join(chr(r) for r in result_hdr)
+ payload = "".join(chr(r) for r in result_pld)
access_code = packet_utils.conv_1_0_string_to_packed_binary_string(packet_utils.default_access_code)[0]
rx_access_code = header[0:len(access_code)]
length = len(send_str)
- rx_length = struct.unpack_from("!H", header, len(access_code))[0]
+ rx_length = struct.unpack_from(b"!H", six.b(header), len(access_code))[0]
self.assertEqual(access_code, rx_access_code)
self.assertEqual(length, rx_length)
@@ -158,16 +161,16 @@ class test_packet_format_fb(gr_unittest.TestCase):
result_hdr = pmt.u8vector_elements(result_hdr_pmt)
result_pld = pmt.u8vector_elements(result_pld_pmt)
- header = "".join([chr(r) for r in result_hdr])
- payload = "".join([chr(r) for r in result_pld])
+ header = "".join(chr(r) for r in result_hdr)
+ payload = "".join(chr(r) for r in result_pld)
access_code = packet_utils.conv_1_0_string_to_packed_binary_string(packet_utils.default_access_code)[0]
rx_access_code = header[0:len(access_code)]
length = len(send_str)
- rx_length = struct.unpack_from("!H", header, len(access_code))[0]
- rx_bps = struct.unpack_from("!H", header, len(access_code)+4)[0]
- rx_counter = struct.unpack_from("!H", header, len(access_code)+6)[0]
+ rx_length = struct.unpack_from(b"!H", six.b(header), len(access_code))[0]
+ rx_bps = struct.unpack_from(b"!H", six.b(header), len(access_code)+4)[0]
+ rx_counter = struct.unpack_from(b"!H", six.b(header), len(access_code)+6)[0]
self.assertEqual(access_code, rx_access_code)
self.assertEqual(length, rx_length)
diff --git a/gr-digital/python/digital/qa_packet_headergenerator_bb.py b/gr-digital/python/digital/qa_packet_headergenerator_bb.py
index d2677ce220..1ca0e85d8d 100755..100644
--- a/gr-digital/python/digital/qa_packet_headergenerator_bb.py
+++ b/gr-digital/python/digital/qa_packet_headergenerator_bb.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest, digital, blocks
from gnuradio.gr import packet_utils
import pmt
diff --git a/gr-digital/python/digital/qa_packet_headerparser_b.py b/gr-digital/python/digital/qa_packet_headerparser_b.py
index fb4226d6fd..3e22fa9100 100755..100644
--- a/gr-digital/python/digital/qa_packet_headerparser_b.py
+++ b/gr-digital/python/digital/qa_packet_headerparser_b.py
@@ -19,6 +19,7 @@
# Boston, MA 02110-1301, USA.
#
+
import time
import random
@@ -77,7 +78,7 @@ class qa_packet_headerparser_b (gr_unittest.TestCase):
header_len = 32
packet_len_tagname = "packet_len"
packet_lengths = [random.randint(1, 100) for x in range(N)]
- data, tags = tagged_streams.packets_to_vectors([range(packet_lengths[i]) for i in range(N)], packet_len_tagname)
+ data, tags = tagged_streams.packets_to_vectors([list(range(packet_lengths[i])) for i in range(N)], packet_len_tagname)
src = blocks.vector_source_b(data, False, 1, tags)
header_gen = digital.packet_headergenerator_bb(header_len, packet_len_tagname)
header_parser = digital.packet_headerparser_b(header_len, packet_len_tagname)
@@ -89,7 +90,7 @@ class qa_packet_headerparser_b (gr_unittest.TestCase):
self.tb.stop()
self.tb.wait()
self.assertEqual(sink.num_messages(), N)
- for i in xrange(N):
+ for i in range(N):
msg = pmt.to_python(sink.get_message(i))
self.assertEqual(msg, {'packet_len': packet_lengths[i], 'packet_num': i})
@@ -110,7 +111,7 @@ class qa_packet_headerparser_b (gr_unittest.TestCase):
frame_len_tagname = "frame_len"
src = blocks.vector_source_b(encoded_headers)
header_formatter = digital.packet_header_ofdm(
- (range(32),range(4),range(8)), # 32/4/8 carriers are occupied (which doesn't matter here)
+ (list(range(32)),list(range(4)),list(range(8))), # 32/4/8 carriers are occupied (which doesn't matter here)
1, # 1 OFDM symbol per header (= 32 bits)
packet_len_tagname,
frame_len_tagname,
@@ -141,10 +142,10 @@ class qa_packet_headerparser_b (gr_unittest.TestCase):
packet_length = 23
packet_len_tagname = "packet_len"
frame_len_tagname = "frame_len"
- data, tags = tagged_streams.packets_to_vectors([range(packet_length),range(packet_length),], packet_len_tagname)
+ data, tags = tagged_streams.packets_to_vectors([list(range(packet_length)),list(range(packet_length)),], packet_len_tagname)
src = blocks.vector_source_b(data, False, 1, tags)
header_formatter = digital.packet_header_ofdm(
- (range(32),), # 32 carriers are occupied (which doesn't matter here)
+ (list(range(32)),), # 32 carriers are occupied (which doesn't matter here)
1, # 1 OFDM symbol per header (= 32 bits)
packet_len_tagname,
frame_len_tagname,
diff --git a/gr-digital/python/digital/qa_pfb_clock_sync.py b/gr-digital/python/digital/qa_pfb_clock_sync.py
index e16a99338e..77980d19e5 100755..100644
--- a/gr-digital/python/digital/qa_pfb_clock_sync.py
+++ b/gr-digital/python/digital/qa_pfb_clock_sync.py
@@ -20,6 +20,8 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import division
+
import random
import cmath
import time
@@ -39,9 +41,9 @@ class test_pfb_clock_sync(gr_unittest.TestCase):
excess_bw = 0.35
sps = 4
- loop_bw = cmath.pi/100.0
+ loop_bw = cmath.pi / 100.0
nfilts = 32
- init_phase = nfilts/2
+ init_phase = nfilts / 2
max_rate_deviation = 0.5
osps = 1
@@ -92,9 +94,9 @@ class test_pfb_clock_sync(gr_unittest.TestCase):
excess_bw = 0.35
sps = 4
- loop_bw = cmath.pi/100.0
+ loop_bw = cmath.pi / 100.0
nfilts = 32
- init_phase = nfilts/2
+ init_phase = nfilts / 2
max_rate_deviation = 0.5
osps = 1
@@ -146,9 +148,9 @@ class test_pfb_clock_sync(gr_unittest.TestCase):
excess_bw1 = 0.22
sps = 4
- loop_bw = cmath.pi/100.0
+ loop_bw = cmath.pi / 100.0
nfilts = 32
- init_phase = nfilts/2
+ init_phase = nfilts / 2
max_rate_deviation = 0.5
osps = 1
@@ -184,9 +186,9 @@ class test_pfb_clock_sync(gr_unittest.TestCase):
excess_bw1 = 0.22
sps = 4
- loop_bw = cmath.pi/100.0
+ loop_bw = cmath.pi / 100.0
nfilts = 32
- init_phase = nfilts/2
+ init_phase = nfilts / 2
max_rate_deviation = 0.5
osps = 1
diff --git a/gr-digital/python/digital/qa_pn_correlator_cc.py b/gr-digital/python/digital/qa_pn_correlator_cc.py
index 92041d9eda..111801b5c9 100755..100644
--- a/gr-digital/python/digital/qa_pn_correlator_cc.py
+++ b/gr-digital/python/digital/qa_pn_correlator_cc.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest, digital, blocks
class test_pn_correlator_cc(gr_unittest.TestCase):
diff --git a/gr-digital/python/digital/qa_probe_density.py b/gr-digital/python/digital/qa_probe_density.py
index 752d95da3e..e4450cd092 100755..100644
--- a/gr-digital/python/digital/qa_probe_density.py
+++ b/gr-digital/python/digital/qa_probe_density.py
@@ -20,6 +20,8 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import print_function
+
from gnuradio import gr, gr_unittest, digital, blocks
class test_probe_density(gr_unittest.TestCase):
@@ -62,7 +64,7 @@ class test_probe_density(gr_unittest.TestCase):
self.tb.run()
result_data = op.density()
- print result_data
+ print(result_data)
self.assertAlmostEqual(expected_data, result_data, 5)
if __name__ == '__main__':
diff --git a/gr-digital/python/digital/qa_scrambler.py b/gr-digital/python/digital/qa_scrambler.py
index 522b23245f..93f77a9ef7 100755..100644
--- a/gr-digital/python/digital/qa_scrambler.py
+++ b/gr-digital/python/digital/qa_scrambler.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest, digital, blocks
import pmt
@@ -29,7 +30,7 @@ def additive_scramble_lfsr(mask, seed, reglen, bpb, data):
out = []
for d in data:
scramble_word = 0
- for i in xrange(0,bpb):
+ for i in range(0,bpb):
scramble_word ^= l.next_bit() << i
out.append(d ^ scramble_word)
return tuple(out)
@@ -121,7 +122,7 @@ class test_scrambler(gr_unittest.TestCase):
reset_tag3 = gr.tag_t()
reset_tag3.key = pmt.string_to_symbol(reset_tag_key)
reset_tag3.offset = 20
- src = blocks.vector_source_b(src_data * 3, False, 1, (reset_tag1, reset_tag2, reset_tag3))
+ src = blocks.vector_source_b([s * 3 for s in src_data], False, 1, (reset_tag1, reset_tag2, reset_tag3))
scrambler = digital.additive_scrambler_bb(0x8a, 0x7f, 7, 0, 8, reset_tag_key)
dst = blocks.vector_sink_b()
self.tb.connect(src, scrambler, dst)
diff --git a/gr-digital/python/digital/qa_simple_correlator.py b/gr-digital/python/digital/qa_simple_correlator.py
index f39fb62dda..9c0352e896 100755..100644
--- a/gr-digital/python/digital/qa_simple_correlator.py
+++ b/gr-digital/python/digital/qa_simple_correlator.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest, blocks, filter, digital
class test_simple_correlator(gr_unittest.TestCase):
diff --git a/gr-digital/python/digital/qa_simple_framer.py b/gr-digital/python/digital/qa_simple_framer.py
index cf9934648b..fb1ac0dfd6 100755..100644
--- a/gr-digital/python/digital/qa_simple_framer.py
+++ b/gr-digital/python/digital/qa_simple_framer.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest, digital, blocks
class test_simple_framer(gr_unittest.TestCase):
diff --git a/gr-digital/python/digital/qam.py b/gr-digital/python/digital/qam.py
index 518be78941..be4b7efa74 100644
--- a/gr-digital/python/digital/qam.py
+++ b/gr-digital/python/digital/qam.py
@@ -1,37 +1,40 @@
#
# Copyright 2005,2006,2011,2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
"""
QAM modulation and demodulation.
"""
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import unicode_literals
from math import pi, sqrt, log
from gnuradio import gr
-from generic_mod_demod import generic_mod, generic_demod
-from generic_mod_demod import shared_mod_args, shared_demod_args
-from utils.gray_code import gray_code
-from utils import mod_codes
-import modulation_utils
-import digital_swig as digital
+from .generic_mod_demod import generic_mod, generic_demod
+from .generic_mod_demod import shared_mod_args, shared_demod_args
+from .utils.gray_code import gray_code
+from .utils import mod_codes
+from . import modulation_utils
+from . import digital_swig as digital
# Default number of points in constellation.
_def_constellation_points = 16
@@ -42,7 +45,7 @@ _def_differential = True
_def_mod_code = mod_codes.NO_CODE
def is_power_of_four(x):
- v = log(x)/log(4)
+ v = log(x) / log(4)
return int(v) == v
def get_bit(x, n):
@@ -52,7 +55,7 @@ def get_bit(x, n):
def get_bits(x, n, k):
""" Get the k bits of integer x starting at bit n(from little end)."""
# Remove the n smallest bits
- v = x >> n
+ v = x >> n
# Remove all bits bigger than n+k-1
return v % pow(2, k)
@@ -74,7 +77,7 @@ def make_differential_constellation(m, gray_coded):
k = int(log(m) / log(2.0))
# First create a constellation for one quadrant containing m/4 points.
# The quadrant has 'side' points along each side of a quadrant.
- side = int(sqrtm/2)
+ side = int(sqrtm / 2)
if gray_coded:
# Number rows and columns using gray codes.
gcs = gray_code(side)
@@ -83,7 +86,7 @@ def make_differential_constellation(m, gray_coded):
else:
i_gcs = dict([(i, i) for i in range(0, side)])
# The distance between points is found.
- step = 1/(side-0.5)
+ step = 1 / (side-0.5)
gc_to_x = [(i_gcs[gc]+0.5)*step for gc in range(0, side)]
@@ -100,7 +103,7 @@ def make_differential_constellation(m, gray_coded):
return complex(-gc_to_x[gc_x], -gc_to_x[gc_y])
if quad == 3:
return complex(gc_to_x[gc_y], -gc_to_x[gc_x])
- raise StandardError("Impossible!")
+ raise Exception("Impossible!")
# First two bits determine quadrant.
# Next (k-2)/2 bits determine x position.
@@ -108,8 +111,8 @@ def make_differential_constellation(m, gray_coded):
# How x and y relate to real and imag depends on quadrant (see get_c function).
const_map = []
for i in range(m):
- y = get_bits(i, 0, (k-2)/2)
- x = get_bits(i, (k-2)/2, (k-2)/2)
+ y = get_bits(i, 0, (k-2) // 2)
+ x = get_bits(i, (k-2) // 2, (k-2) // 2)
quad = get_bits(i, k-2, 2)
const_map.append(get_c(x, y, quad))
@@ -127,17 +130,17 @@ def make_non_differential_constellation(m, gray_coded):
# Get inverse gray codes.
i_gcs = mod_codes.invert_code(gcs)
else:
- i_gcs = range(0, side)
+ i_gcs = list(range(0, side))
# The distance between points is found.
- step = 2.0/(side-1)
+ step = 2.0 / (side-1)
gc_to_x = [-1 + i_gcs[gc]*step for gc in range(0, side)]
# First k/2 bits determine x position.
# Following k/2 bits determine y position.
const_map = []
for i in range(m):
- y = gc_to_x[get_bits(i, 0, k/2)]
- x = gc_to_x[get_bits(i, k/2, k/2)]
+ y = gc_to_x[get_bits(i, 0, k // 2)]
+ x = gc_to_x[get_bits(i, k // 2, k // 2)]
const_map.append(complex(x,y))
return const_map
@@ -170,7 +173,7 @@ def qam_constellation(constellation_points=_def_constellation_points,
else:
points = make_non_differential_constellation(constellation_points, gray_coded)
side = int(sqrt(constellation_points))
- width = 2.0/(side-1)
+ width = 2.0 / (side-1)
# No pre-diff code
# Should add one so that we can gray-code the quadrant bits too.
@@ -242,8 +245,8 @@ def large_ampls_to_corners_mapping(side, points, width):
sector = real_x * side + imag_x
# If this sector is a normal constellation sector then
# use the center point.
- c = ((real_x-side/2.0+0.5)*width +
- (imag_x-side/2.0+0.5)*width*1j)
+ c = ((real_x-side / 2.0+0.5)*width +
+ (imag_x-side / 2.0+0.5)*width*1j)
if (real_x >= extra_layers and real_x < side-extra_layers
and imag_x >= extra_layers and imag_x < side-extra_layers):
# This is not an edge row/column. Find closest point.
@@ -254,7 +257,7 @@ def large_ampls_to_corners_mapping(side, points, width):
sector_values.append(index)
return sector_values
-
+
# /////////////////////////////////////////////////////////////////////////////
# QAM modulator
# /////////////////////////////////////////////////////////////////////////////
@@ -262,10 +265,10 @@ def large_ampls_to_corners_mapping(side, points, width):
class qam_mod(generic_mod):
"""
Hierarchical block for RRC-filtered QAM modulation.
-
+
The input is a byte stream (unsigned char) and the
output is the complex modulated signal at baseband.
-
+
Args:
constellation_points: Number of constellation points (must be a power of four) (integer).
mod_code: Whether to use a gray_code (digital.mod_codes.GRAY_CODE) or not (digital.mod_codes.NO_CODE).
@@ -280,10 +283,10 @@ class qam_mod(generic_mod):
*args, **kwargs):
"""
- Hierarchical block for RRC-filtered QAM modulation.
+ Hierarchical block for RRC-filtered QAM modulation.
- The input is a byte stream (unsigned char) and the
- output is the complex modulated signal at baseband.
+ The input is a byte stream (unsigned char) and the
+ output is the complex modulated signal at baseband.
Args:
constellation_points: Number of constellation points.
@@ -292,7 +295,7 @@ class qam_mod(generic_mod):
if we want gray coding, see digital.utils.mod_codes)
See generic_mod block for list of additional parameters.
- """
+ """
constellation = qam_constellation(constellation_points, differential,
mod_code)
@@ -309,10 +312,10 @@ class qam_mod(generic_mod):
class qam_demod(generic_demod):
"""
Hierarchical block for RRC-filtered QAM modulation.
-
+
The input is a byte stream (unsigned char) and the
output is the complex modulated signal at baseband.
-
+
Args:
constellation_points: Number of constellation points (must be a power of four) (integer).
mod_code: Whether to use a gray_code (digital.mod_codes.GRAY_CODE) or not (digital.mod_codes.NO_CODE).
@@ -327,10 +330,10 @@ class qam_demod(generic_demod):
large_ampls_to_corner = False,
*args, **kwargs):
"""
- Hierarchical block for RRC-filtered QAM modulation.
+ Hierarchical block for RRC-filtered QAM modulation.
- The input is a byte stream (unsigned char) and the
- output is the complex modulated signal at baseband.
+ The input is a byte stream (unsigned char) and the
+ output is the complex modulated signal at baseband.
Args:
constellation_points: Number of constellation points.
diff --git a/gr-digital/python/digital/qam_constellations.py b/gr-digital/python/digital/qam_constellations.py
index cd895c590b..c0d7805f87 100755..100644
--- a/gr-digital/python/digital/qam_constellations.py
+++ b/gr-digital/python/digital/qam_constellations.py
@@ -20,8 +20,11 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import unicode_literals
import numpy
-from constellation_map_generator import constellation_map_generator
+from .constellation_map_generator import constellation_map_generator
'''
Note on the naming scheme. Each constellation is named using a prefix
@@ -242,8 +245,8 @@ def sd_qam_16_0x0_0_1_2_3(x, Es=1):
'''
dist = Es*numpy.sqrt(2)
- boundary = dist/3.0
- dist0 = dist/6.0
+ boundary = dist / 3.0
+ dist0 = dist / 6.0
# print "Sample: ", x
# print "Es: ", Es
# print "Distance: ", dist
@@ -270,7 +273,7 @@ def sd_qam_16_0x0_0_1_2_3(x, Es=1):
b2 = -abs(x_re) + boundary
b0 = -abs(x_im) + boundary
- return [(Es/2.0)*b3, (Es/2.0)*b2, (Es/2.0)*b1, (Es/2.0)*b0]
+ return [(Es / 2.0)*b3, (Es / 2.0)*b2, (Es / 2.0)*b1, (Es / 2.0)*b0]
sd_qam_16 = sd_qam_16_0x0_0_1_2_3
sd_qam_16_0 = sd_qam_16
diff --git a/gr-digital/python/digital/qamlike.py b/gr-digital/python/digital/qamlike.py
index 2f8c855339..286eabd898 100644
--- a/gr-digital/python/digital/qamlike.py
+++ b/gr-digital/python/digital/qamlike.py
@@ -1,33 +1,35 @@
# Copyright 2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
"""
This file contains constellations that are similar to QAM, but are not perfect squares.
"""
+from __future__ import absolute_import
+from __future__ import unicode_literals
-import digital_swig
-from qam import large_ampls_to_corners_mapping
+from . import digital_swig
+from .qam import large_ampls_to_corners_mapping
def qam32_holeinside_constellation(large_ampls_to_corners=False):
# First make constellation for one quadrant.
- # 0 1 2
+ # 0 1 2
# 2 - 010 111 110
# 1 - 011 101 100
# 0 - 000 001
@@ -72,4 +74,3 @@ def qam32_holeinside_constellation(large_ampls_to_corners=False):
constellation = digital_swig.constellation_expl_rect(
points, pre_diff_code, 4, side, side, width, width, sector_values)
return constellation
-
diff --git a/gr-digital/python/digital/qpsk.py b/gr-digital/python/digital/qpsk.py
index c5230ef24d..8303883992 100644
--- a/gr-digital/python/digital/qpsk.py
+++ b/gr-digital/python/digital/qpsk.py
@@ -24,13 +24,15 @@ QPSK modulation.
Demodulation is not included since the generic_mod_demod
"""
+from __future__ import absolute_import
+from __future__ import unicode_literals
from gnuradio import gr
from gnuradio.digital.generic_mod_demod import generic_mod, generic_demod
from gnuradio.digital.generic_mod_demod import shared_mod_args, shared_demod_args
-from utils import mod_codes
-import digital_swig as digital
-import modulation_utils
+from .utils import mod_codes
+from . import digital_swig as digital
+from . import modulation_utils
# The default encoding (e.g. gray-code, set-partition)
_def_mod_code = mod_codes.GRAY_CODE
diff --git a/gr-digital/python/digital/soft_dec_lut_gen.py b/gr-digital/python/digital/soft_dec_lut_gen.py
index f517277702..fc69f7f678 100644
--- a/gr-digital/python/digital/soft_dec_lut_gen.py
+++ b/gr-digital/python/digital/soft_dec_lut_gen.py
@@ -20,6 +20,10 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
+
import numpy
def soft_dec_table_generator(soft_dec_gen, prec, Es=1):
@@ -123,6 +127,7 @@ def soft_dec_table(constel, symbols, prec, npwr=1):
xrng = numpy.linspace(re_min, re_max, npts)
table = []
+
for y in yrng:
for x in xrng:
pt = complex(x, y)
@@ -196,8 +201,8 @@ def calc_soft_dec(sample, constel, symbols, npwr=1):
M = len(constel)
k = int(numpy.log2(M))
- tmp = 2*k*[0,]
- s = k*[0,]
+ tmp = 2*k*[0]
+ s = k*[0]
for i in range(M):
# Calculate the distance between the sample and the current
@@ -206,7 +211,7 @@ def calc_soft_dec(sample, constel, symbols, npwr=1):
# Calculate the probability factor from the distance and the
# scaled noise power.
- d = numpy.exp(-dist/npwr)
+ d = numpy.exp(-dist / npwr)
for j in range(k):
# Get the bit at the jth index
@@ -235,21 +240,21 @@ def show_table(table):
pp = ""
subi = 1
subj = 0
- for i in reversed(xrange(prec+1)):
+ for i in reversed(list(range(prec+1))):
if(i == prec//2):
pp += "-----" + prec*((nbits*8)+3)*"-" + "\n"
subi = 0
continue
- for j in xrange(prec+1):
+ for j in range(prec+1):
if(j == prec//2):
pp += "| "
subj = 1
else:
item = table[prec*(i-subi) + (j-subj)]
pp += "( "
- for t in xrange(nbits-1, -1, -1):
+ for t in range(nbits-1, -1, -1):
pp += "{0: .4f} ".format(item[t])
pp += ") "
pp += "\n"
subj = 0
- print pp
+ print(pp)
diff --git a/gr-digital/python/digital/test_soft_decisions.py b/gr-digital/python/digital/test_soft_decisions.py
index 878058ebbc..eba31bab76 100755..100644
--- a/gr-digital/python/digital/test_soft_decisions.py
+++ b/gr-digital/python/digital/test_soft_decisions.py
@@ -1,30 +1,35 @@
#!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+
+from __future__ import print_function
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import unicode_literals
import numpy, pylab, sys
from gnuradio import digital
-from soft_dec_lut_gen import soft_dec_table, calc_soft_dec_from_table, calc_soft_dec
-from psk_constellations import psk_4_0, psk_4_1, psk_4_2, psk_4_3, psk_4_4, psk_4_5, psk_4_6, psk_4_7, sd_psk_4_0, sd_psk_4_1, sd_psk_4_2, sd_psk_4_3, sd_psk_4_4, sd_psk_4_5, sd_psk_4_6, sd_psk_4_7
-from qam_constellations import qam_16_0, sd_qam_16_0
+from .soft_dec_lut_gen import soft_dec_table, calc_soft_dec_from_table, calc_soft_dec
+from .psk_constellations import psk_4_0, psk_4_1, psk_4_2, psk_4_3, psk_4_4, psk_4_5, psk_4_6, psk_4_7, sd_psk_4_0, sd_psk_4_1, sd_psk_4_2, sd_psk_4_3, sd_psk_4_4, sd_psk_4_5, sd_psk_4_6, sd_psk_4_7
+from .qam_constellations import qam_16_0, sd_qam_16_0
def test_qpsk(i, sample, prec):
qpsk_const_list = [psk_4_0, psk_4_1, psk_4_2, psk_4_3,
@@ -61,7 +66,7 @@ def test_qpsk(i, sample, prec):
y_cpp_table, y_cpp_raw_calc, constel, code, c)
def test_qam16(i, sample, prec):
- sample = sample/1
+ sample = sample / 1
qam_const_list = [qam_16_0, ]
qam_lut_gen_list = [sd_qam_16_0, ]
@@ -114,12 +119,12 @@ if __name__ == "__main__":
k = numpy.log2(len(constel))
- print "Sample: ", x
- print "Python Generator Calculated: ", (y_python_gen_calc)
- print "Python Generator Table: ", (y_python_table)
- print "Python Raw calc: ", (y_python_raw_calc)
- print "C++ Table calc: ", (y_cpp_table)
- print "C++ Raw calc: ", (y_cpp_raw_calc)
+ print("Sample: ", x)
+ print("Python Generator Calculated: ", (y_python_gen_calc))
+ print("Python Generator Table: ", (y_python_table))
+ print("Python Raw calc: ", (y_python_raw_calc))
+ print("C++ Table calc: ", (y_cpp_table))
+ print("C++ Raw calc: ", (y_cpp_raw_calc))
fig = pylab.figure(1)
sp1 = fig.add_subplot(1,1,1)
diff --git a/gr-digital/python/digital/utils/alignment.py b/gr-digital/python/digital/utils/alignment.py
index f3ad3781e2..e9292a4bcc 100644
--- a/gr-digital/python/digital/utils/alignment.py
+++ b/gr-digital/python/digital/utils/alignment.py
@@ -41,6 +41,8 @@ This module contains functions for aligning sequences.
(100, -20)
"""
+from __future__ import division
+from __future__ import unicode_literals
import random
@@ -63,7 +65,7 @@ def compare_sequences(d1, d2, offset, sample_indices=None):
"""
max_index = min(len(d1), len(d2)+offset)
if sample_indices is None:
- sample_indices = range(0, max_index)
+ sample_indices = list(range(0, max_index))
correct = 0
total = 0
for i in sample_indices:
@@ -84,8 +86,8 @@ def random_sample(size, num_samples=def_num_samples, seed=None):
if num_samples > size:
indices = set(range(0, size))
else:
- if num_samples > size/2:
- num_samples = num_samples/2
+ if num_samples > size / 2:
+ num_samples = num_samples / 2
indices = set([])
while len(indices) < num_samples:
index = rndm.randint(0, size-1)
@@ -119,8 +121,8 @@ def align_sequences(d1, d2,
best_offset = None
best_compared = None
best_correct = None
- pos_range = range(0, min(len(d1), max_offset))
- neg_range = range(-1, -min(len(d2), max_offset), -1)
+ pos_range = list(range(0, min(len(d1), max_offset)))
+ neg_range = list(range(-1, -min(len(d2), max_offset), -1))
# Interleave the positive and negative offsets.
int_range = [item for items in zip(pos_range, neg_range) for item in items]
for offset in int_range:
diff --git a/gr-digital/python/digital/utils/gray_code.py b/gr-digital/python/digital/utils/gray_code.py
index 926a1ded10..ad88274087 100644
--- a/gr-digital/python/digital/utils/gray_code.py
+++ b/gr-digital/python/digital/utils/gray_code.py
@@ -1,25 +1,27 @@
#!/usr/bin/env python
#
# Copyright 2011 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
+from __future__ import division
+from __future__ import unicode_literals
class GrayCodeGenerator(object):
"""
Generates and caches gray codes.
@@ -41,7 +43,7 @@ class GrayCodeGenerator(object):
if len(self.gcs) < length:
self.generate_new_gray_code(length)
return self.gcs[:length]
-
+
def generate_new_gray_code(self, length):
"""
Generates new gray code and places into cache.
@@ -49,7 +51,7 @@ class GrayCodeGenerator(object):
while len(self.gcs) < length:
if self.i == self.lp2:
# if i is a power of two then gray number is of form 1100000...
- result = self.i + self.i/2
+ result = self.i + self.i // 2
else:
# if not we take advantage of the symmetry of all but the last bit
# around a power of two.
diff --git a/gr-digital/python/digital/utils/mod_codes.py b/gr-digital/python/digital/utils/mod_codes.py
index f55fe41b8b..586ab1999a 100644
--- a/gr-digital/python/digital/utils/mod_codes.py
+++ b/gr-digital/python/digital/utils/mod_codes.py
@@ -21,6 +21,7 @@
#
# Constants used to represent what coding to use.
+from __future__ import unicode_literals
GRAY_CODE = 'gray'
SET_PARTITION_CODE = 'set-partition'
NO_CODE = 'none'
diff --git a/gr-digital/python/digital/utils/tagged_streams.py b/gr-digital/python/digital/utils/tagged_streams.py
index 4b393bfc20..68267a293e 100644
--- a/gr-digital/python/digital/utils/tagged_streams.py
+++ b/gr-digital/python/digital/utils/tagged_streams.py
@@ -1,27 +1,30 @@
#!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
# DEPRECATED -- Marked for removal in 3.8
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
from gnuradio import gr
import pmt
@@ -30,9 +33,9 @@ def make_lengthtags(lengths, offsets, tagname='length', vlen=1):
assert(len(offsets) == len(lengths))
for offset, length in zip(offsets, lengths):
tag = gr.tag_t()
- tag.offset = offset/vlen
+ tag.offset = offset / vlen
tag.key = pmt.string_to_symbol(tagname)
- tag.value = pmt.from_long(length/vlen)
+ tag.value = pmt.from_long(length / vlen)
tags.append(tag)
return tags
@@ -75,7 +78,7 @@ def count_bursts(data, tags, lengthtagname, vlen=1):
if pos in lengths:
if in_packet:
print("Got tag at pos {0} current packet_pos is {1}".format(pos, packet_pos))
- raise StandardError("Received packet tag while in packet.")
+ raise Exception("Received packet tag while in packet.")
packet_pos = -1
packet_length = lengths[pos]
in_packet = True
@@ -127,9 +130,9 @@ def packets_to_vectors(packets, lengthtagname, vlen=1):
for packet in packets:
data.extend(packet)
tag = gr.tag_t()
- tag.offset = offset/vlen
+ tag.offset = offset // vlen
tag.key = pmt.string_to_symbol(lengthtagname)
- tag.value = pmt.from_long(len(packet)/vlen)
+ tag.value = pmt.from_long(len(packet) // vlen)
tags.append(tag)
offset = offset + len(packet)
return data, tags
diff --git a/gr-digital/swig/digital_swig.py.in b/gr-digital/swig/digital_swig.py.in
index d5d55a0f4e..a4326d1343 100644
--- a/gr-digital/swig/digital_swig.py.in
+++ b/gr-digital/swig/digital_swig.py.in
@@ -19,6 +19,8 @@
# Boston, MA 02110-1301, USA.
#
-from digital_swig0 import *
-from digital_swig1 import *
-from digital_swig2 import *
+from __future__ import absolute_import
+
+from .digital_swig0 import *
+from .digital_swig1 import *
+from .digital_swig2 import *