Exemplo n.º 1
0
 def get_band_shape(self):
     """implement IDemodulator"""
     return BandShape.bandpass_transition(
         low=-self.__cutoff,
         high=self.__cutoff,
         transition=self.__transition_width,
     )
Exemplo n.º 2
0
 def get_band_shape(self):
     """implement IDemodulator"""
     return BandShape.bandpass_transition(
         low=-self.__cutoff,
         high=self.__cutoff,
         transition=self.__transition_width,
     )
Exemplo n.º 3
0
 def get_band_shape(self):
     """implement IDemodulator"""
     return BandShape.bandpass_transition(
         low=self.__low_cutoff,
         high=self.__high_cutoff,
         transition=self.__transition_width,
         markers={
             -self.__spacing: u'S',
             0: u'M',
         })
Exemplo n.º 4
0
 def get_band_shape(self):
     """implement IDemodulator"""
     return BandShape.bandpass_transition(
         low=self.__low_cutoff,
         high=self.__high_cutoff,
         transition=self.__transition_width,
         markers={
             -self.__spacing: u'S',
             0: u'M',
         })
Exemplo n.º 5
0
 def __init__(self, mode, **kwargs):
     if mode == 'LSB':
         lsb = True
         cw = False
     elif mode == 'USB':
         lsb = False
         cw = False
     elif mode == 'CW':
         lsb = False
         cw = True
     else:
         raise ValueError('Not an SSB mode: %r' % (mode,))
     
     demod_rate = 8000  # round number close to SSB bandwidth * 2
     
     SimpleAudioDemodulator.__init__(self,
         mode=mode,
         audio_rate=demod_rate,
         demod_rate=demod_rate,
         band_filter=demod_rate / 2,  # note narrower filter applied later
         band_filter_transition=demod_rate / 2,
         **kwargs)
     
     if cw:
         self.__offset = 1500  # CW beat frequency
         half_bandwidth = self.half_bandwidth = 500
         band_filter_width = 120
         band_mid = 0
         agc_reference = dB(-10)
         agc_rate = 1e-1
     else:
         self.__offset = 0
         half_bandwidth = self.half_bandwidth = 2800 / 2  # standard SSB bandwidth
         band_filter_width = half_bandwidth / 5
         if lsb:
             band_mid = -200 - half_bandwidth
         else:
             band_mid = 200 + half_bandwidth
         agc_reference = dB(-8)
         agc_rate = 8e-1
     
     band_filter_low = band_mid - half_bandwidth
     band_filter_high = band_mid + half_bandwidth
     sharp_filter_block = grfilter.fir_filter_ccc(
         1,
         firdes.complex_band_pass(1.0, demod_rate,
             band_filter_low + self.__offset,
             band_filter_high + self.__offset,
             band_filter_width,
             firdes.WIN_HAMMING))
     self.__filter_shape = BandShape.bandpass_transition(
         low=band_filter_low,
         high=band_filter_high,
         transition=band_filter_width,
         markers={})
     
     self.agc_block = analog.agc2_cc(reference=agc_reference)
     self.agc_block.set_attack_rate(agc_rate)
     self.agc_block.set_decay_rate(agc_rate)
     self.agc_block.set_max_gain(dB(_ssb_max_agc))
     
     ssb_demod_block = blocks.complex_to_real(1)
     
     self.connect(
         self,
         self.band_filter_block,
         sharp_filter_block,
         # TODO: We would like to have a squelch which does not interfere with the AGC, but this is impossible without combining the squelch and AGC
         self.rf_squelch_block,
         self.agc_block,
         ssb_demod_block)
     self.connect(sharp_filter_block, self.rf_probe_block)
     self.connect_audio_output(ssb_demod_block)
Exemplo n.º 6
0
    def __init__(self, mode, **kwargs):
        if mode == 'LSB':
            lsb = True
            cw = False
        elif mode == 'USB':
            lsb = False
            cw = False
        elif mode == 'CW':
            lsb = False
            cw = True
        else:
            raise ValueError('Not an SSB mode: %r' % (mode, ))

        demod_rate = 8000  # round number close to SSB bandwidth * 2

        SimpleAudioDemodulator.__init__(
            self,
            mode=mode,
            audio_rate=demod_rate,
            demod_rate=demod_rate,
            band_filter=demod_rate / 2,  # note narrower filter applied later
            band_filter_transition=demod_rate / 2,
            **kwargs)

        if cw:
            self.__offset = 1500  # CW beat frequency
            half_bandwidth = self.half_bandwidth = 500
            band_filter_width = 120
            band_mid = 0
            agc_reference = dB(-10)
            agc_rate = 1e-1
        else:
            self.__offset = 0
            half_bandwidth = self.half_bandwidth = 2800 / 2  # standard SSB bandwidth
            band_filter_width = half_bandwidth / 5
            if lsb:
                band_mid = -200 - half_bandwidth
            else:
                band_mid = 200 + half_bandwidth
            agc_reference = dB(-8)
            agc_rate = 8e-1

        band_filter_low = band_mid - half_bandwidth
        band_filter_high = band_mid + half_bandwidth
        sharp_filter_block = grfilter.fir_filter_ccc(
            1,
            firdes.complex_band_pass(1.0, demod_rate,
                                     band_filter_low + self.__offset,
                                     band_filter_high + self.__offset,
                                     band_filter_width, firdes.WIN_HAMMING))
        self.__filter_shape = BandShape.bandpass_transition(
            low=band_filter_low,
            high=band_filter_high,
            transition=band_filter_width,
            markers={})

        self.agc_block = analog.agc2_cc(reference=agc_reference)
        self.agc_block.set_attack_rate(agc_rate)
        self.agc_block.set_decay_rate(agc_rate)
        self.agc_block.set_max_gain(dB(_ssb_max_agc))

        ssb_demod_block = blocks.complex_to_real(1)

        self.connect(
            self,
            self.band_filter_block,
            sharp_filter_block,
            # TODO: We would like to have a squelch which does not interfere with the AGC, but this is impossible without combining the squelch and AGC
            self.rf_squelch_block,
            self.agc_block,
            ssb_demod_block)
        self.connect(sharp_filter_block, self.rf_probe_block)
        self.connect_audio_output(ssb_demod_block)