summaryrefslogtreecommitdiff
path: root/gr-digital/python
diff options
context:
space:
mode:
authorMarcus Müller <marcus@hostalia.de>2018-08-17 20:48:35 +0200
committerMarcus Müller <marcus@hostalia.de>2018-08-23 22:47:38 +0200
commit9fa00984d8e5d04bf911f8d6d1ca818ca8e9fd1f (patch)
treed2e38f7ea428b4e06e1daf16fa0b1c933fb40dda /gr-digital/python
parentb219a8d183e339b6fec2d81284a988037a2d0180 (diff)
Delete deprecated (q)d/qpsk and qam python hier blocks.
Fixes #1081. These blocks were just overly specific wrappers for RRC + constellation decoders/encoders. With the nice constellation objects, no need to keep these around. Note that they are still in use as *possible* constellations (runtime-detected) in examples like narrowband/tunnel.py, but reducing these in functionality is inavoidable at this point. Progress of updating them is tracked in #1956.
Diffstat (limited to 'gr-digital/python')
-rw-r--r--gr-digital/python/digital/bpsk.py97
-rw-r--r--gr-digital/python/digital/qam.py103
-rw-r--r--gr-digital/python/digital/qpsk.py126
3 files changed, 0 insertions, 326 deletions
diff --git a/gr-digital/python/digital/bpsk.py b/gr-digital/python/digital/bpsk.py
index 6193622be8..3f26bafe94 100644
--- a/gr-digital/python/digital/bpsk.py
+++ b/gr-digital/python/digital/bpsk.py
@@ -43,112 +43,15 @@ def bpsk_constellation():
return digital_swig.constellation_bpsk()
# /////////////////////////////////////////////////////////////////////////////
-# BPSK modulator
-# /////////////////////////////////////////////////////////////////////////////
-
-class bpsk_mod(generic_mod):
- """
- Hierarchical block for RRC-filtered BPSK modulation.
-
- The input is a byte stream (unsigned char) and the
- output is the complex modulated signal at baseband.
-
- Args:
- mod_code: Argument is not used. It exists purely to simplify generation of the block in grc.
- differential: Whether to use differential encoding (boolean).
- """
- # See generic_mod for additional arguments
- __doc__ += shared_mod_args
-
- def __init__(self, mod_code=None, differential=False, *args, **kwargs):
-
- constellation = digital_swig.constellation_bpsk()
- super(bpsk_mod, self).__init__(constellation=constellation,
- differential=differential, *args, **kwargs)
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# BPSK demodulator
-#
-# /////////////////////////////////////////////////////////////////////////////
-
-class bpsk_demod(generic_demod):
- """
- Hierarchical block for RRC-filtered BPSK demodulation.
-
- The input is the complex modulated signal at baseband and the
- output is a stream of bits packed 1 bit per byte (LSB)
-
- Args:
- mod_code: Argument is not used. It exists purely to simplify generation of the block in grc.
- differential: whether to use differential encoding (boolean)
- """
- # See generic_demod for additional arguments
- __doc__ += shared_demod_args
-
- def __init__(self, mod_code=None, differential=False, *args, **kwargs):
- constellation = digital_swig.constellation_bpsk()
- super(bpsk_demod, self).__init__(constellation=constellation,
- differential=differential, *args, **kwargs)
-#bpsk_demod.__doc__ += shared_demod_args
-
-
-# /////////////////////////////////////////////////////////////////////////////
# DBPSK constellation
# /////////////////////////////////////////////////////////////////////////////
def dbpsk_constellation():
return digital_swig.constellation_dbpsk()
-# /////////////////////////////////////////////////////////////////////////////
-# DBPSK modulator
-# /////////////////////////////////////////////////////////////////////////////
-
-class dbpsk_mod(bpsk_mod):
- """
- Hierarchical block for RRC-filtered DBPSK modulation.
-
- The input is a byte stream (unsigned char) and the
- output is the complex modulated signal at baseband.
-
- Args:
- mod_code: Argument is not used. It exists purely to simplify generation of the block in grc.
- """
- # See generic_mod for additional arguments
- __doc__ += shared_mod_args
-
- def __init__(self, mod_code=None, *args, **kwargs):
-
- super(dbpsk_mod, self).__init__(differential=True, *args, **kwargs)
-
-# /////////////////////////////////////////////////////////////////////////////
-# DBPSK demodulator
-#
-# /////////////////////////////////////////////////////////////////////////////
-
-class dbpsk_demod(bpsk_demod):
- """
- Hierarchical block for RRC-filtered DBPSK demodulation.
-
- The input is the complex modulated signal at baseband and the
- output is a stream of bits packed 1 bit per byte (LSB)
-
- Args:
- mod_code: Argument is not used. It exists purely to simplify generation of the block in grc.
- """
- # See generic_demod for additional arguments
- __doc__ += shared_demod_args
-
- def __init__(self, mod_code=None, *args, **kwargs):
-
- super(dbpsk_demod, self).__init__(differential=True, *args, **kwargs)
#
# Add these to the mod/demod registry
#
-modulation_utils.add_type_1_mod('bpsk', bpsk_mod)
-modulation_utils.add_type_1_demod('bpsk', bpsk_demod)
modulation_utils.add_type_1_constellation('bpsk', bpsk_constellation)
-modulation_utils.add_type_1_mod('dbpsk', dbpsk_mod)
-modulation_utils.add_type_1_demod('dbpsk', dbpsk_demod)
modulation_utils.add_type_1_constellation('dbpsk', dbpsk_constellation)
diff --git a/gr-digital/python/digital/qam.py b/gr-digital/python/digital/qam.py
index be4b7efa74..2da58246cc 100644
--- a/gr-digital/python/digital/qam.py
+++ b/gr-digital/python/digital/qam.py
@@ -257,107 +257,4 @@ def large_ampls_to_corners_mapping(side, points, width):
sector_values.append(index)
return sector_values
-
-# /////////////////////////////////////////////////////////////////////////////
-# QAM modulator
-# /////////////////////////////////////////////////////////////////////////////
-
-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).
- differential: Whether to use differential encoding (boolean).
- """
- # See generic_mod for additional arguments
- __doc__ += shared_mod_args
-
- def __init__(self, constellation_points=_def_constellation_points,
- differential=_def_differential,
- mod_code=_def_mod_code,
- *args, **kwargs):
-
- """
- 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 4.
- mod_code: Specifies an encoding to use (typically used to indicated
- 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)
- # We take care of the gray coding in the constellation
- # generation so it doesn't need to be done in the block.
- super(qam_mod, self).__init__(constellation, differential=differential,
- *args, **kwargs)
-
-# /////////////////////////////////////////////////////////////////////////////
-# QAM demodulator
-#
-# /////////////////////////////////////////////////////////////////////////////
-
-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).
- differential: Whether to use differential encoding (boolean).
- """
- # See generic_demod for additional arguments
- __doc__ += shared_mod_args
-
- def __init__(self, constellation_points=_def_constellation_points,
- differential=_def_differential,
- mod_code=_def_mod_code,
- large_ampls_to_corner = False,
- *args, **kwargs):
- """
- 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 4.
- mod_code: Specifies an encoding to use (typically used to indicated
- if we want gray coding, see digital.utils.mod_codes)
- large_ampls_to_corners: If this is set to True then when the
- constellation is making decisions, points that are far outside
- the constellation are mapped to the closest corner rather than
- the closet constellation point. This can help with phase
- locking.
-
- See generic_demod block for list of additional parameters.
- """
- constellation = qam_constellation(constellation_points, differential,
- mod_code)
- # We take care of the gray coding in the constellation
- # generation so it doesn't need to be done in the block.
- super(qam_demod, self).__init__(constellation, differential=differential,
- *args, **kwargs)
-
-#
-# Add these to the mod/demod registry
-#
-modulation_utils.add_type_1_mod('qam', qam_mod)
-modulation_utils.add_type_1_demod('qam', qam_demod)
modulation_utils.add_type_1_constellation('qam', qam_constellation)
diff --git a/gr-digital/python/digital/qpsk.py b/gr-digital/python/digital/qpsk.py
index 8303883992..b8ad4cbd90 100644
--- a/gr-digital/python/digital/qpsk.py
+++ b/gr-digital/python/digital/qpsk.py
@@ -50,83 +50,6 @@ def qpsk_constellation(mod_code=_def_mod_code):
return digital.constellation_qpsk()
# /////////////////////////////////////////////////////////////////////////////
-# QPSK modulator
-# /////////////////////////////////////////////////////////////////////////////
-
-class qpsk_mod(generic_mod):
- """
- Hierarchical block for RRC-filtered QPSK modulation.
-
- The input is a byte stream (unsigned char) and the
- output is the complex modulated signal at baseband.
-
- Args:
- mod_code: Whether to use a gray_code (digital.mod_codes.GRAY_CODE) or not (digital.mod_codes.NO_CODE).
- differential: Whether to use differential encoding (boolean).
- """
- # See generic_mod for additional arguments
- __doc__ += shared_mod_args
-
- def __init__(self, mod_code=_def_mod_code, differential=False, *args, **kwargs):
- pre_diff_code = True
- if not differential:
- constellation = digital.constellation_qpsk()
- if mod_code != mod_codes.GRAY_CODE:
- raise ValueError("This QPSK mod/demod works only for gray-coded constellations.")
- else:
- constellation = digital.constellation_dqpsk()
- if mod_code not in set([mod_codes.GRAY_CODE, mod_codes.NO_CODE]):
- raise ValueError("That mod_code is not supported for DQPSK mod/demod.")
- if mod_code == mod_codes.NO_CODE:
- pre_diff_code = False
-
- super(qpsk_mod, self).__init__(constellation=constellation,
- differential=differential,
- pre_diff_code=pre_diff_code,
- *args, **kwargs)
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# QPSK demodulator
-#
-# /////////////////////////////////////////////////////////////////////////////
-
-class qpsk_demod(generic_demod):
- """
- Hierarchical block for RRC-filtered QPSK demodulation.
-
- The input is the complex modulated signal at baseband and the
- output is a stream of bits packed 1 bit per byte (LSB)
-
- Args:
- mod_code: Whether to use a gray_code (digital.mod_codes.GRAY_CODE) or not (digital.mod_codes.NO_CODE).
- differential: Whether to use differential encoding (boolean).
- """
- # See generic_mod for additional arguments
- __doc__ += shared_demod_args
-
- def __init__(self, mod_code=_def_mod_code, differential=False,
- *args, **kwargs):
- pre_diff_code = True
- if not differential:
- constellation = digital.constellation_qpsk()
- if mod_code != mod_codes.GRAY_CODE:
- raise ValueError("This QPSK mod/demod works only for gray-coded constellations.")
- else:
- constellation = digital.constellation_dqpsk()
- if mod_code not in set([mod_codes.GRAY_CODE, mod_codes.NO_CODE]):
- raise ValueError("That mod_code is not supported for DQPSK mod/demod.")
- if mod_code == mod_codes.NO_CODE:
- pre_diff_code = False
-
- super(qpsk_demod, self).__init__(constellation=constellation,
- differential=differential,
- pre_diff_code=pre_diff_code,
- *args, **kwargs)
-
-
-
-# /////////////////////////////////////////////////////////////////////////////
# DQPSK constellation
# /////////////////////////////////////////////////////////////////////////////
@@ -135,57 +58,8 @@ def dqpsk_constellation(mod_code=_def_mod_code):
raise ValueError("The DQPSK constellation is only generated for gray_coding. But it can be used for non-grayed coded modulation if one doesn't use the pre-differential code.")
return digital.constellation_dqpsk()
-# /////////////////////////////////////////////////////////////////////////////
-# DQPSK modulator
-# /////////////////////////////////////////////////////////////////////////////
-
-class dqpsk_mod(qpsk_mod):
- """
- Hierarchical block for RRC-filtered DQPSK modulation.
-
- The input is a byte stream (unsigned char) and the
- output is the complex modulated signal at baseband.
-
- Args:
- mod_code: Whether to use a gray_code (digital.mod_codes.GRAY_CODE) or not (digital.mod_codes.NO_CODE).
- """
- # See generic_mod for additional arguments
- __doc__ += shared_mod_args
-
- def __init__(self, mod_code=_def_mod_code, *args, **kwargs):
- super(dqpsk_mod, self).__init__(mod_code=mod_code,
- differential=True,
- *args, **kwargs)
-
-# /////////////////////////////////////////////////////////////////////////////
-# DQPSK demodulator
-#
-# /////////////////////////////////////////////////////////////////////////////
-
-class dqpsk_demod(qpsk_demod):
- """
- Hierarchical block for RRC-filtered DQPSK demodulation.
-
- The input is the complex modulated signal at baseband and the
- output is a stream of bits packed 1 bit per byte (LSB)
-
- Args:
- mod_code: Whether to use a gray_code (digital.mod_codes.GRAY_CODE) or not (digital.mod_codes.NO_CODE).
- """
- # See generic_mod for additional arguments
- __doc__ += shared_demod_args
-
- def __init__(self, mod_code=_def_mod_code, *args, **kwargs):
- super(dqpsk_demod, self).__init__(mod_code=mod_code,
- differential=True,
- *args, **kwargs)
-
#
# Add these to the mod/demod registry
#
-modulation_utils.add_type_1_mod('qpsk', qpsk_mod)
-modulation_utils.add_type_1_demod('qpsk', qpsk_demod)
modulation_utils.add_type_1_constellation('qpsk', qpsk_constellation)
-modulation_utils.add_type_1_mod('dqpsk', dqpsk_mod)
-modulation_utils.add_type_1_demod('dqpsk', dqpsk_demod)
modulation_utils.add_type_1_constellation('dqpsk', dqpsk_constellation)