Пример #1
0
    def sync_pulse_duration(self, value):
        if not is_scalar_numeric(value):
            raise LayerMisconfigured(
                "sync pulse duration must be a scalar numeric value")
        if value < 0.0:
            raise LayerMisconfigured(
                "sync pulse duration must be 0 or positive")

        self._sync_pulse_duration = value
Пример #2
0
    def N_factor(self, value):
        if not is_scalar_numeric(value):
            raise LayerMisconfigured("N factor must be a scalar numeric value")

        self._N_factor = int(value)
Пример #3
0
 def sampling_period(self, value):
     """Set the sampling period"""
     if not is_scalar_numeric(value):
         raise LayerMisconfigured(
             "sampling_period must be an integer of float")
     self._sampling_period = value
Пример #4
0
 def validate(self) -> t.NoReturn:
     """Implementation of Configurable's `validate`"""
     if not is_scalar_numeric(self.config.subsymbol_rate):
         raise LayerMisconfigured("subsymbol_rate must be a numeric value")
     if not is_scalar_numeric(self.config.symbol_rate):
         raise LayerMisconfigured("symbol_rate must be a numeric value")
Пример #5
0
 def num_bits_to_num_syms(self, num_bits: t.Union[float, int]):
     assert is_scalar_numeric(num_bits), "num_bits must be float or int"
     return math.ceil(num_bits / self.compression_factor)
Пример #6
0
 def bitrate_to_symrate(self, bitrate: t.Union[float, int]):
     assert is_scalar_numeric(bitrate), "bitrate must be float or int"
     return bitrate / self.compression_factor
Пример #7
0
 def symrate_to_bitrate(self, symrate: t.Union[float, int]):
     assert is_scalar_numeric(symrate), "symrate must be float or int"
     return symrate * self.compression_factor