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. See generic_demod block for list of 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) # adding member variable to simplify logging self._mod_code = mod_code # # 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)
# # ///////////////////////////////////////////////////////////////////////////// class qam_demod(generic_demod): 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. See generic_demod block for list of 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)
# DBPSK demodulator # # ///////////////////////////////////////////////////////////////////////////// class dbpsk_demod(bpsk_demod): """ 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_demod for additional arguments __doc__ += shared_demod_args def __init__(self, mod_code=None, *args, **kwargs): super(dbpsk_demod, self).__init__(*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)
# ///////////////////////////////////////////////////////////////////////////// # PSK demodulator # # ///////////////////////////////////////////////////////////////////////////// class psk_demod(generic_demod): def __init__(self, constellation_points=_def_constellation_points, mod_code=_def_mod_code, *args, **kwargs): """ Hierarchical block for RRC-filtered PSK modulation. The input is a byte stream (unsigned char) and the output is the complex modulated signal at baseband. See generic_demod block for list of parameters. """ constellation = psk_constellation(constellation_points, mod_code) super(psk_demod, self).__init__(constellation, *args, **kwargs) # # Add these to the mod/demod registry # modulation_utils.add_type_1_mod('psk', psk_mod) modulation_utils.add_type_1_demod('psk', psk_demod) modulation_utils.add_type_1_constellation('psk', psk_constellation)
gr.file_sink(gr.sizeof_char, "slicer.dat")) def add_options(parser): """ Adds GFSK demodulation-specific options to the standard parser """ parser.add_option("", "--gain-mu", type="float", default=_def_gain_mu, help="M&M clock recovery gain mu [default=%default] (GFSK/PSK)") parser.add_option("", "--mu", type="float", default=_def_mu, help="M&M clock recovery mu [default=%default] (GFSK/PSK)") parser.add_option("", "--omega-relative-limit", type="float", default=_def_omega_relative_limit, help="M&M clock recovery omega relative limit [default=%default] (GFSK/PSK)") parser.add_option("", "--freq-error", type="float", default=_def_freq_error, help="M&M clock recovery frequency error [default=%default] (GFSK)") add_options=staticmethod(add_options) def extract_kwargs_from_options(options): """ Given command line options, create dictionary suitable for passing to __init__ """ return modulation_utils.extract_kwargs_from_options(gfsk_demod.__init__, ('self',), options) extract_kwargs_from_options=staticmethod(extract_kwargs_from_options) # # Add these to the mod/demod registry # modulation_utils.add_type_1_mod('gfsk', gfsk_mod) modulation_utils.add_type_1_demod('gfsk', gfsk_demod)
type="float", default=_def_omega_relative_limit, help= "M&M clock recovery omega relative limit [default=%default] (GMSK/PSK)" ) parser.add_option( "", "--freq-error", type="float", default=_def_freq_error, help="M&M clock recovery frequency error [default=%default] (GMSK)" ) add_options = staticmethod(add_options) def extract_kwargs_from_options(options): """ Given command line options, create dictionary suitable for passing to __init__ """ return modulation_utils.extract_kwargs_from_options( gmsk_demod.__init__, ('self', ), options) extract_kwargs_from_options = staticmethod(extract_kwargs_from_options) # # Add these to the mod/demod registry # modulation_utils.add_type_1_mod('gmsk', gmsk_mod) modulation_utils.add_type_1_demod('gmsk', gmsk_demod)
*args, **kwargs): """ 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. See generic_demod block for list of parameters. """ constellation_points = _def_constellation_points constellation = digital_swig.constellation_dqpsk() if constellation_points != 4: raise ValueError( 'Number of constellation points must be 4 for DQPSK.') super(dqpsk_demod, self).__init__(constellation=constellation, 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)
# ///////////////////////////////////////////////////////////////////////////// class dqpsk_demod(qpsk_demod): """ 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_demod_args def __init__(self, mod_code=_def_mod_code, *args, **kwargs): super(dqpsk_demod, self).__init__(mod_code, *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)
class qam_demod(generic_demod): 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. See generic_demod block for list of 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)
def __init__(self, constellation_points=_def_constellation_points, differential=True, *args, **kwargs): """ 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. See generic_demod block for list of parameters. """ constellation_points = _def_constellation_points constellation = digital_swig.constellation_dqpsk() if constellation_points != 4: raise ValueError('Number of constellation points must be 4 for DQPSK.') super(dqpsk_demod, self).__init__(constellation=constellation, 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)
"", "--omega-relative-limit", type="float", default=_def_omega_relative_limit, help="M&M clock recovery omega relative limit [default=%default] (GFSK/PSK)", ) parser.add_option( "", "--freq-error", type="float", default=_def_freq_error, help="M&M clock recovery frequency error [default=%default] (GFSK)", ) add_options = staticmethod(add_options) def extract_kwargs_from_options(options): """ Given command line options, create dictionary suitable for passing to __init__ """ return modulation_utils.extract_kwargs_from_options(gfsk_demod.__init__, ("self",), options) extract_kwargs_from_options = staticmethod(extract_kwargs_from_options) # # Add these to the mod/demod registry # modulation_utils.add_type_1_mod("gfsk", gfsk_mod) modulation_utils.add_type_1_demod("gfsk", gfsk_demod)