Source code for RsSmw.Implementations.Source.Awgn

from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import enums


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class AwgnCls:
	"""
	| Commands in total: 22
	| Subgroups: 5
	| Direct child commands: 5
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("awgn", core, parent)

	@property
	def bandwidth(self):
		"""
		| Commands in total: 4
		| Subgroups: 1
		| Direct child commands: 3
		"""
		if not hasattr(self, '_bandwidth'):
			from .Bandwidth import BandwidthCls
			self._bandwidth = BandwidthCls(self._core, self._cmd_group)
		return self._bandwidth

	@property
	def cmode(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_cmode'):
			from .Cmode import CmodeCls
			self._cmode = CmodeCls(self._core, self._cmd_group)
		return self._cmode

	@property
	def disp(self):
		"""
		| Commands in total: 2
		| Subgroups: 0
		| Direct child commands: 2
		"""
		if not hasattr(self, '_disp'):
			from .Disp import DispCls
			self._disp = DispCls(self._core, self._cmd_group)
		return self._disp

	@property
	def frequency(self):
		"""
		| Commands in total: 3
		| Subgroups: 1
		| Direct child commands: 2
		"""
		if not hasattr(self, '_frequency'):
			from .Frequency import FrequencyCls
			self._frequency = FrequencyCls(self._core, self._cmd_group)
		return self._frequency

	@property
	def power(self):
		"""
		| Commands in total: 7
		| Subgroups: 2
		| Direct child commands: 3
		"""
		if not hasattr(self, '_power'):
			from .Power import PowerCls
			self._power = PowerCls(self._core, self._cmd_group)
		return self._power

[docs] def get_brate(self) -> float: """ ``[SOURce<HW>]:AWGN:BRATe`` \n Snippet: ``value: float = driver.source.awgn.get_brate()`` \n Sets the bit rate used for calculation of bit energy to noise power ratio. Valid units are bps, kbps and mabps as well as b/s, kb/s and mab/s. :return: brate: float Range: 400 to depends on options """ response = self._core.io.query_str('SOURce<HwInstance>:AWGN:BRATe?') return Conversions.str_to_float(response)
[docs] def set_brate(self, brate: float) -> None: """ ``[SOURce<HW>]:AWGN:BRATe`` \n Snippet: ``driver.source.awgn.set_brate(brate = 1.0)`` \n Sets the bit rate used for calculation of bit energy to noise power ratio. Valid units are bps, kbps and mabps as well as b/s, kb/s and mab/s. :param brate: float Range: 400 to depends on options """ param = Conversions.decimal_value_to_str(brate) self._core.io.write(f'SOURce<HwInstance>:AWGN:BRATe {param}')
[docs] def get_cn_ratio(self) -> float: """ ``[SOURce<HW>]:AWGN:CNRatio`` \n Snippet: ``value: float = driver.source.awgn.get_cn_ratio()`` \n Sets the carrier/interferer ratio. :return: cn_ratio: float Range: -50 to depends on options """ response = self._core.io.query_str('SOURce<HwInstance>:AWGN:CNRatio?') return Conversions.str_to_float(response)
[docs] def set_cn_ratio(self, cn_ratio: float) -> None: """ ``[SOURce<HW>]:AWGN:CNRatio`` \n Snippet: ``driver.source.awgn.set_cn_ratio(cn_ratio = 1.0)`` \n Sets the carrier/interferer ratio. :param cn_ratio: float Range: -50 to depends on options """ param = Conversions.decimal_value_to_str(cn_ratio) self._core.io.write(f'SOURce<HwInstance>:AWGN:CNRatio {param}')
[docs] def get_en_ratio(self) -> float: """ ``[SOURce<HW>]:AWGN:ENRatio`` \n Snippet: ``value: float = driver.source.awgn.get_en_ratio()`` \n Sets the ratio of bit energy to noise power density. :return: en_ratio: float Range: -50 to depends on options, Unit: dB """ response = self._core.io.query_str('SOURce<HwInstance>:AWGN:ENRatio?') return Conversions.str_to_float(response)
[docs] def set_en_ratio(self, en_ratio: float) -> None: """ ``[SOURce<HW>]:AWGN:ENRatio`` \n Snippet: ``driver.source.awgn.set_en_ratio(en_ratio = 1.0)`` \n Sets the ratio of bit energy to noise power density. :param en_ratio: float Range: -50 to depends on options, Unit: dB """ param = Conversions.decimal_value_to_str(en_ratio) self._core.io.write(f'SOURce<HwInstance>:AWGN:ENRatio {param}')
# noinspection PyTypeChecker
[docs] def get_mode(self) -> enums.NoisAwgnMode: """ ``[SOURce<HW>]:AWGN:MODE`` \n Snippet: ``value: enums.NoisAwgnMode = driver.source.awgn.get_mode()`` \n Determines how the interfering signal is generated. :return: mode: ONLY | ADD | CW ADD The AWGN noise signal is added to the baseband signal. ONLY The pure AWGN noise signal is modulated to the carrier. The connection to the baseband is interrupted CW The sine interfering signal is added to the baseband signal. """ response = self._core.io.query_str('SOURce<HwInstance>:AWGN:MODE?') return Conversions.str_to_scalar_enum(response, enums.NoisAwgnMode)
[docs] def set_mode(self, mode: enums.NoisAwgnMode) -> None: """ ``[SOURce<HW>]:AWGN:MODE`` \n Snippet: ``driver.source.awgn.set_mode(mode = enums.NoisAwgnMode.ADD)`` \n Determines how the interfering signal is generated. :param mode: ONLY | ADD | CW ADD The AWGN noise signal is added to the baseband signal. ONLY The pure AWGN noise signal is modulated to the carrier. The connection to the baseband is interrupted CW The sine interfering signal is added to the baseband signal. """ param = Conversions.enum_scalar_to_str(mode, enums.NoisAwgnMode) self._core.io.write(f'SOURce<HwInstance>:AWGN:MODE {param}')
[docs] def get_state(self) -> bool: """ ``[SOURce<HW>]:AWGN:STATe`` \n Snippet: ``value: bool = driver.source.awgn.get_state()`` \n Activates or deactivates the AWGN generator or the corresponding stream. See also 'Suffixes in the keywords ENTity<ch> and SOURce<hw>'. :return: state: 1 | ON | 0| OFF """ response = self._core.io.query_str('SOURce<HwInstance>:AWGN:STATe?') return Conversions.str_to_bool(response)
[docs] def set_state(self, state: bool) -> None: """ ``[SOURce<HW>]:AWGN:STATe`` \n Snippet: ``driver.source.awgn.set_state(state = False)`` \n Activates or deactivates the AWGN generator or the corresponding stream. See also 'Suffixes in the keywords ENTity<ch> and SOURce<hw>'. :param state: 1 | ON | 0| OFF """ param = Conversions.bool_to_str(state) self._core.io.write(f'SOURce<HwInstance>:AWGN:STATe {param}')
def clone(self) -> 'AwgnCls': """ Clones the group by creating new object from it and its whole existing subgroups. Also copies all the existing default Repeated Capabilities setting, which you can change independently without affecting the original group. """ new_group = AwgnCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group