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(stop_low=-250,
                      pass_low=-100,
                      stop_high=250,
                      pass_high=100,
                      markers=[])
Exemplo n.º 4
0
 def __init__(self, stage_designs, freq_xlate_stage, cutoff_freq, transition_width, taps=None):
     self.__stage_designs = stage_designs
     self.__taps = taps if taps is not None else [None for _ in stage_designs]
     self.__freq_xlate_stage = freq_xlate_stage
     self.__cutoff_freq = float(cutoff_freq)
     self.__transition_width = float(transition_width)
     self.__band_shape = BandShape.lowpass_transition(
         cutoff=self.__cutoff_freq,
         transition=self.__transition_width)
Exemplo n.º 5
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.º 6
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.º 7
0
 def get_band_shape(self):
     """implement IDemodulator"""
     halfbw = self.__input_rate * 0.5
     offset = self.__rec_freq_input
     epsilon = 1  # don't be invalid in case of floating-point error
     return BandShape(stop_low=-halfbw - offset,
                      stop_high=halfbw - offset,
                      pass_low=-halfbw - offset + epsilon,
                      pass_high=-halfbw - offset + epsilon,
                      markers={})
Exemplo n.º 8
0
 def get_band_shape(self):
     """implements IDemodulator"""
     if self.__band_filter:
         return self.__band_filter.get_shape()
     else:
         # TODO Reuse UnselectiveAMDemodulator's approach to this
         return BandShape(stop_low=0,
                          pass_low=0,
                          pass_high=0,
                          stop_high=0,
                          markers={})
Exemplo n.º 9
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.º 10
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)