Esempio n. 1
0
    def __init__(self,
                 if_rate=None,
                 filter_type=None,
                 excess_bw=_def_excess_bw,
                 symbol_rate=_def_symbol_rate):
        """
	Hierarchical block for P25 demodulation base class

		@param if_rate: sample rate of complex input channel
		@type if_rate: int
	"""
        self.if_rate = if_rate
        self.symbol_rate = symbol_rate
        self.bb_sink = None

        self.null_sink = blocks.null_sink(gr.sizeof_float)
        self.baseband_amp = blocks.multiply_const_ff(_def_bb_gain)
        coeffs = op25_c4fm_mod.c4fm_taps(
            sample_rate=self.if_rate,
            span=9,
            generator=op25_c4fm_mod.transfer_function_rx).generate()
        sps = self.if_rate / 4800
        if filter_type == 'rrc':
            ntaps = 7 * sps
            if ntaps & 1 == 0:
                ntaps += 1
            coeffs = filter.firdes.root_raised_cosine(1.0, if_rate,
                                                      symbol_rate, excess_bw,
                                                      ntaps)
        if filter_type == 'gmsk':
            # lifted from gmsk.py
            _omega = sps
            _gain_mu = _def_gmsk_mu
            _mu = _def_mu
            if not _gain_mu:
                _gain_mu = 0.175
            _gain_omega = .25 * _gain_mu * _gain_mu  # critically damped
            self.symbol_filter = blocks.multiply_const_ff(1.0)
            self.fsk4_demod = digital.clock_recovery_mm_ff(
                _omega, _gain_omega, _mu, _gain_mu, _def_omega_relative_limit)
            self.slicer = digital.binary_slicer_fb()
        elif filter_type == 'fsk4mm':
            self.symbol_filter = filter.fir_filter_fff(1, coeffs)
            _omega = sps
            _gain_mu = _def_gmsk_mu
            _mu = _def_mu
            if not _gain_mu:
                _gain_mu = 0.0175
            _gain_omega = .25 * _gain_mu * _gain_mu  # critically damped
            self.fsk4_demod = digital.clock_recovery_mm_ff(
                _omega, _gain_omega, _mu, _gain_mu, _def_omega_relative_limit)
            levels = [-2.0, 0.0, 2.0, 4.0]
            self.slicer = op25_repeater.fsk4_slicer_fb(levels)
        else:
            self.symbol_filter = filter.fir_filter_fff(1, coeffs)
            autotuneq = gr.msg_queue(2)
            self.fsk4_demod = op25.fsk4_demod_ff(autotuneq, self.if_rate,
                                                 self.symbol_rate)
            levels = [-2.0, 0.0, 2.0, 4.0]
            self.slicer = op25_repeater.fsk4_slicer_fb(levels)
Esempio n. 2
0
    def __init__(self,
                 if_rate=None,
                 filter_type=None,
                 excess_bw=_def_excess_bw,
                 symbol_rate=_def_symbol_rate):
        """
	Hierarchical block for P25 demodulation base class

        @param if_rate: sample rate of complex input channel
        @type if_rate: int
	"""
        self.if_rate = if_rate
        self.symbol_rate = symbol_rate
        self.bb_sink = None

        self.baseband_amp = blocks.multiply_const_ff(_def_bb_gain)
        coeffs = op25_c4fm_mod.c4fm_taps(
            sample_rate=self.if_rate,
            span=9,
            generator=op25_c4fm_mod.transfer_function_rx).generate()
        if filter_type == 'rrc':
            sps = self.if_rate / 4800
            ntaps = 7 * sps
            if ntaps & 1 == 0:
                ntaps += 1
            coeffs = filter.firdes.root_raised_cosine(1.0, if_rate,
                                                      symbol_rate, excess_bw,
                                                      ntaps)
        self.symbol_filter = filter.fir_filter_fff(1, coeffs)
        autotuneq = gr.msg_queue(2)
        self.fsk4_demod = op25.fsk4_demod_ff(autotuneq, self.if_rate,
                                             self.symbol_rate)

        levels = [-2.0, 0.0, 2.0, 4.0]
        self.slicer = op25_repeater.fsk4_slicer_fb(levels)
Esempio n. 3
0
    def __init__(self,
                 if_rate	= None,
                 symbol_rate	= _def_symbol_rate):
        """
	Hierarchical block for P25 demodulation base class

        @param if_rate: sample rate of complex input channel
        @type if_rate: int
	"""
        self.if_rate = if_rate
        self.symbol_rate = symbol_rate
        self.bb_sink = None

        self.baseband_amp = blocks.multiply_const_ff(_def_bb_gain)
        coeffs = op25_c4fm_mod.c4fm_taps(sample_rate=self.if_rate, span=9, generator=op25_c4fm_mod.transfer_function_rx).generate()
        self.symbol_filter = filter.fir_filter_fff(1, coeffs)
        autotuneq = gr.msg_queue(2)
        self.fsk4_demod = op25.fsk4_demod_ff(autotuneq, self.if_rate, self.symbol_rate)

        levels = [ -2.0, 0.0, 2.0, 4.0 ]
        self.slicer = op25_repeater.fsk4_slicer_fb(levels)
Esempio n. 4
0
    def __init__(self,
                 if_rate	= None,
                 symbol_rate	= _def_symbol_rate):
        """
	Hierarchical block for P25 demodulation base class

        @param if_rate: sample rate of complex input channel
        @type if_rate: int
	"""
        self.if_rate = if_rate
        self.symbol_rate = symbol_rate
        self.bb_sink = None

        self.baseband_amp = blocks.multiply_const_ff(_def_bb_gain)
        coeffs = op25_c4fm_mod.c4fm_taps(sample_rate=self.if_rate, span=9, generator=op25_c4fm_mod.transfer_function_rx).generate()
        self.symbol_filter = filter.fir_filter_fff(1, coeffs)
        autotuneq = gr.msg_queue(2)
        self.fsk4_demod = op25.fsk4_demod_ff(autotuneq, self.if_rate, self.symbol_rate)

        levels = [ -2.0, 0.0, 2.0, 4.0 ]
        self.slicer = op25_repeater.fsk4_slicer_fb(levels)
Esempio n. 5
0
    def __init__(self,
                 if_rate     = None,
                 filter_type = None,
                 excess_bw   = _def_excess_bw,
                 symbol_rate = _def_symbol_rate):
        """
        Hierarchical block for P25 demodulation base class

        @param if_rate: sample rate of complex input channel
        @type if_rate: int
        """
        self.if_rate = if_rate
        self.symbol_rate = symbol_rate
        self.bb_sink = {}
        self.bb_tuner_sink = {}
        self.spiir = filter.single_pole_iir_filter_ff(0.0001)

        self.null_sink = blocks.null_sink(gr.sizeof_float)
        self.baseband_amp = blocks.multiply_const_ff(_def_bb_gain)
        coeffs = op25_c4fm_mod.c4fm_taps(sample_rate=self.if_rate, span=9, generator=op25_c4fm_mod.transfer_function_rx).generate()
        sps = self.if_rate // self.symbol_rate
        if filter_type == 'rrc':
            ntaps = 7 * sps
            if ntaps & 1 == 0:
                ntaps += 1
            coeffs = filter.firdes.root_raised_cosine(1.0, self.if_rate, self.symbol_rate, excess_bw, ntaps)
        if filter_type == 'nxdn':
            coeffs = op25_c4fm_mod.c4fm_taps(sample_rate=self.if_rate, span=9, generator=op25_c4fm_mod.transfer_function_nxdn, symbol_rate=self.symbol_rate).generate()
            gain_adj = 1.8	# for nxdn48 6.25 KHz
            if self.symbol_rate == 4800:
               gain_adj = 0.77	# nxdn96 12.5 KHz
            coeffs = [x * gain_adj for x in coeffs]
        if filter_type == 'gmsk':
            # lifted from gmsk.py
            _omega = sps
            _gain_mu = _def_gmsk_mu
            _mu = _def_mu
            if not _gain_mu:
                _gain_mu = 0.175
            _gain_omega = .25 * _gain_mu * _gain_mu        # critically damped
            self.symbol_filter = blocks.multiply_const_ff(1.0)
            self.fsk4_demod = digital.clock_recovery_mm_ff(_omega, _gain_omega,
                                                           _mu, _gain_mu,
                                                           _def_omega_relative_limit)
            self.slicer = digital.binary_slicer_fb()
        elif filter_type == 'fsk4mm':
            self.symbol_filter = filter.fir_filter_fff(1, coeffs)
            _omega = sps
            _gain_mu = _def_gmsk_mu
            _mu = _def_mu
            if not _gain_mu:
                _gain_mu = 0.0175
            _gain_omega = .25 * _gain_mu * _gain_mu        # critically damped
            self.fsk4_demod = digital.clock_recovery_mm_ff(_omega, _gain_omega,
                                                           _mu, _gain_mu,
                                                           _def_omega_relative_limit)
            levels = [ -2.0, 0.0, 2.0, 4.0 ]
            self.slicer = op25_repeater.fsk4_slicer_fb(levels)
        elif filter_type == 'fsk2mm':
            ntaps = 7 * sps
            if ntaps & 1 == 0:
                ntaps += 1
            coeffs = filter.firdes.root_raised_cosine(1.0, self.if_rate, self.symbol_rate, excess_bw, ntaps)
            self.fsk4_demod = digital.clock_recovery_mm_ff(sps, 0.1, 0.5, 0.05, 0.005)
            self.baseband_amp = op25_repeater.rmsagc_ff(alpha=0.01, k=1.0)
            self.symbol_filter = filter.fir_filter_fff(1, coeffs)
            self.slicer = digital.binary_slicer_fb()
        elif filter_type == 'fsk2':
            ntaps = 7 * sps
            if ntaps & 1 == 0:
                ntaps += 1
            coeffs = filter.firdes.root_raised_cosine(1.0, self.if_rate, self.symbol_rate, excess_bw, ntaps)
            autotuneq = gr.msg_queue(2)
            self.fsk4_demod = op25.fsk4_demod_ff(autotuneq, self.if_rate, self.symbol_rate, True)
            self.baseband_amp = op25_repeater.rmsagc_ff(alpha=0.01, k=1.0)
            self.symbol_filter = filter.fir_filter_fff(1, coeffs)
            self.slicer = digital.binary_slicer_fb()
        elif filter_type == "widepulse":
            coeffs = op25_c4fm_mod.c4fm_taps(sample_rate=self.if_rate, span=9, generator=op25_c4fm_mod.transfer_function_rx).generate(rate_multiplier = 2.0)
            self.symbol_filter = filter.fir_filter_fff(1, coeffs)
            autotuneq = gr.msg_queue(2)
            self.fsk4_demod = op25.fsk4_demod_ff(autotuneq, self.if_rate, self.symbol_rate)
            levels = [ -2.0, 0.0, 2.0, 4.0 ]
            self.slicer = op25_repeater.fsk4_slicer_fb(levels)
        else:
            self.symbol_filter = filter.fir_filter_fff(1, coeffs)
            autotuneq = gr.msg_queue(2)
            self.fsk4_demod = op25.fsk4_demod_ff(autotuneq, self.if_rate, self.symbol_rate)
            levels = [ -2.0, 0.0, 2.0, 4.0 ]
            self.slicer = op25_repeater.fsk4_slicer_fb(levels)