Source code for RsSmw.Implementations.Source.Bb.Ofdm

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


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class OfdmCls:
	"""
	| Commands in total: 122
	| Subgroups: 16
	| Direct child commands: 21
	"""

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

	@property
	def alloc(self):
		"""
		| Commands in total: 33
		| Subgroups: 19
		| Direct child commands: 0
		"""
		if not hasattr(self, '_alloc'):
			from .Alloc import AllocCls
			self._alloc = AllocCls(self._core, self._cmd_group)
		return self._alloc

	@property
	def clock(self):
		"""
		| Commands in total: 4
		| Subgroups: 1
		| Direct child commands: 3
		"""
		if not hasattr(self, '_clock'):
			from .Clock import ClockCls
			self._clock = ClockCls(self._core, self._cmd_group)
		return self._clock

	@property
	def cpLength(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_cpLength'):
			from .CpLength import CpLengthCls
			self._cpLength = CpLengthCls(self._core, self._cmd_group)
		return self._cpLength

	@property
	def csLength(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_csLength'):
			from .CsLength import CsLengthCls
			self._csLength = CsLengthCls(self._core, self._cmd_group)
		return self._csLength

	@property
	def dfts(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_dfts'):
			from .Dfts import DftsCls
			self._dfts = DftsCls(self._core, self._cmd_group)
		return self._dfts

	@property
	def filterPy(self):
		"""
		| Commands in total: 9
		| Subgroups: 0
		| Direct child commands: 9
		"""
		if not hasattr(self, '_filterPy'):
			from .FilterPy import FilterPyCls
			self._filterPy = FilterPyCls(self._core, self._cmd_group)
		return self._filterPy

	@property
	def fofdm(self):
		"""
		| Commands in total: 2
		| Subgroups: 0
		| Direct child commands: 2
		"""
		if not hasattr(self, '_fofdm'):
			from .Fofdm import FofdmCls
			self._fofdm = FofdmCls(self._core, self._cmd_group)
		return self._fofdm

	@property
	def gfdm(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_gfdm'):
			from .Gfdm import GfdmCls
			self._gfdm = GfdmCls(self._core, self._cmd_group)
		return self._gfdm

	@property
	def modPreset(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_modPreset'):
			from .ModPreset import ModPresetCls
			self._modPreset = ModPresetCls(self._core, self._cmd_group)
		return self._modPreset

	@property
	def notch(self):
		"""
		| Commands in total: 8
		| Subgroups: 4
		| Direct child commands: 3
		"""
		if not hasattr(self, '_notch'):
			from .Notch import NotchCls
			self._notch = NotchCls(self._core, self._cmd_group)
		return self._notch

	@property
	def setting(self):
		"""
		| Commands in total: 4
		| Subgroups: 0
		| Direct child commands: 4
		"""
		if not hasattr(self, '_setting'):
			from .Setting import SettingCls
			self._setting = SettingCls(self._core, self._cmd_group)
		return self._setting

	@property
	def symbolRate(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_symbolRate'):
			from .SymbolRate import SymbolRateCls
			self._symbolRate = SymbolRateCls(self._core, self._cmd_group)
		return self._symbolRate

	@property
	def trigger(self):
		"""
		| Commands in total: 27
		| Subgroups: 7
		| Direct child commands: 5
		"""
		if not hasattr(self, '_trigger'):
			from .Trigger import TriggerCls
			self._trigger = TriggerCls(self._core, self._cmd_group)
		return self._trigger

	@property
	def ufmc(self):
		"""
		| Commands in total: 2
		| Subgroups: 0
		| Direct child commands: 2
		"""
		if not hasattr(self, '_ufmc'):
			from .Ufmc import UfmcCls
			self._ufmc = UfmcCls(self._core, self._cmd_group)
		return self._ufmc

	@property
	def user(self):
		"""
		| Commands in total: 5
		| Subgroups: 5
		| Direct child commands: 0
		"""
		if not hasattr(self, '_user'):
			from .User import UserCls
			self._user = UserCls(self._core, self._cmd_group)
		return self._user

	@property
	def waveform(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_waveform'):
			from .Waveform import WaveformCls
			self._waveform = WaveformCls(self._core, self._cmd_group)
		return self._waveform

[docs] def get_acp_length(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:ACPLength`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_acp_length()`` \n For f-OFDM/OFDM, enables additional alternative CP. :return: cp_length: integer Range: 0 to 8192 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:ACPLength?') return Conversions.str_to_int(response)
[docs] def get_acp_symbols(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:ACPSymbols`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_acp_symbols()`` \n For f-OFDM/OFDM, defines number of symbols on that the cyclic prefix/the alternative cyclic prefix is applied. :return: cp_symbols: integer Range: 0 to 8192 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:ACPSymbols?') return Conversions.str_to_int(response)
[docs] def get_bw_occupied(self) -> float: """ ``[SOURce<HW>]:BB:OFDM:BWOCcupied`` \n Snippet: ``value: float = driver.source.bb.ofdm.get_bw_occupied()`` \n Queries the occupied bandwidth. :return: occ_bw: float Range: 0.001 to 1000, Unit: MHz """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:BWOCcupied?') return Conversions.str_to_float(response)
[docs] def get_cp_symbols(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:CPSYmbols`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_cp_symbols()`` \n For f-OFDM/OFDM, defines number of symbols on that the cyclic prefix/the alternative cyclic prefix is applied. :return: cp_symbols: integer Range: 0 to 8192 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:CPSYmbols?') return Conversions.str_to_int(response)
# noinspection PyTypeChecker
[docs] def get_dc_mode(self) -> enums.C5GdcMode: """ ``[SOURce<HW>]:BB:OFDM:DCMode`` \n Snippet: ``value: enums.C5GdcMode = driver.source.bb.ofdm.get_dc_mode()`` \n Sets the DC subcarrier mode. :return: dc_mode: UTIL | PUNC | SKIP UTIL Uses the DC subcarrier for all allocations. PUNC Replaces the DC subcarrier by zeroes for all allocations. SKIP Skips the DC subcarrier in the discrete Fourier transformation (DFT) . """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:DCMode?') return Conversions.str_to_scalar_enum(response, enums.C5GdcMode)
[docs] def get_lguard(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:LGUard`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_lguard()`` \n Queries the number of left guard subcarriers. :return: left_guard_sc: integer Range: 0 to 1000 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:LGUard?') return Conversions.str_to_int(response)
# noinspection PyTypeChecker
[docs] def get_modulation(self) -> enums.C5Gmod: """ ``[SOURce<HW>]:BB:OFDM:MODulation`` \n Snippet: ``value: enums.C5Gmod = driver.source.bb.ofdm.get_modulation()`` \n Selects the modulation type. :return: mod_type: UFMC | FBMC | GFDM | FOFDm | OFDM UFMC Universal Filtered Multi-Carrier modulation, see 'UFMC'. FBMC Filter Bank Multi-Carrier modulation, see 'FBMC'. GFDM Generalized Frequency Division Multiplexing, see 'GFDM'. FOFDm Filtered-OFDM modulation, see 'f-OFDM'. OFDM Orthogonal Frequency-Division Multiplexing modulation, see 'OFDM'. """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:MODulation?') return Conversions.str_to_scalar_enum(response, enums.C5Gmod)
[docs] def get_nalloc(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:NALLoc`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_nalloc()`` \n Sets the number of scheduled allocations. :return: no_of_alloc: integer Range: 0 to 500 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:NALLoc?') return Conversions.str_to_int(response)
[docs] def get_noccupied(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:NOCCupied`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_noccupied()`` \n Sets the number of occupied subcarriers. :return: num_occ_sc: integer Range: 1 to 13107 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:NOCCupied?') return Conversions.str_to_int(response)
[docs] def get_nsubcarriers(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:NSUBcarriers`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_nsubcarriers()`` \n Sets the number of available subcarriers. :return: no_of_sub_carr: integer Range: 64 to 16384 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:NSUBcarriers?') return Conversions.str_to_int(response)
[docs] def get_offset(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:OFFSet`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_offset()`` \n Requires OFDM modulation type: SOURce1:BB:OFDM:MODulation OFDM Sets the symbol offset that is the number of skipped symbols before inserting the zero padding samples. The maximum offset equals the sequence length minus one symbol, see method ``RsSmw.source.bb.ofdm.seq_length()`` . :return: offset: integer Range: 0 to 2399 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:OFFSet?') return Conversions.str_to_int(response)
[docs] def get_out_path(self) -> str: """ ``[SOURce<HW>]:BB:OFDM:OUTPath`` \n Snippet: ``value: str = driver.source.bb.ofdm.get_out_path()`` \n Specifies the output path and output file of the exported OFDM signal generation settings. By default, the output path is /var/user/K114-Export and the output file is Exported_K114_settings_K96.xml. See also Example 'Default 'Exported_K114_settings_K96.xml' file'. :return: k_114_output_path: string """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:OUTPath?') return trim_str_response(response)
[docs] def preset(self) -> None: """ ``[SOURce<HW>]:BB:OFDM:PRESet`` \n Snippet: ``driver.source.bb.ofdm.preset()`` \n Sets the parameters of the digital standard to their default values (``*RST`` values specified for the commands) . Not affected is the state set with the command SOURce<hw>:BB:OFDM:STATe. """ self._core.io.write(f'SOURce<HwInstance>:BB:OFDM:PRESet')
[docs] def preset_with_opc(self, opc_timeout_ms: int = -1) -> None: """ ``[SOURce<HW>]:BB:OFDM:PRESet`` \n Snippet: ``driver.source.bb.ofdm.preset_with_opc()`` \n Sets the parameters of the digital standard to their default values (``*RST`` values specified for the commands) . Not affected is the state set with the command SOURce<hw>:BB:OFDM:STATe. Same as preset, but waits for the operation to complete before continuing further. Use the RsSmw.utilities.opc_timeout_set() to set the timeout value. :param opc_timeout_ms: Maximum time to wait in milliseconds, valid only for this call. """ self._core.io.write_with_opc(f'SOURce<HwInstance>:BB:OFDM:PRESet', opc_timeout_ms)
[docs] def get_rguard(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:RGUard`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_rguard()`` \n Queries the number of right guard subcarriers. :return: right_guard_sc: integer Range: 0 to 1000 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:RGUard?') return Conversions.str_to_int(response)
[docs] def get_rsamples(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:RSAMples`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_rsamples()`` \n Requires OFDM modulation type: SOURce1:BB:OFDM:MODulation OFDM Sets the repetition of inserted zero samples. This repetition defines the number of symbols between repeating zero samples. The maximum number of repetitions equals the sequence length, see method ``RsSmw.source.bb.ofdm.seq_length()`` . :return: rep_for_samples: integer Range: 1 to 2400 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:RSAMples?') return Conversions.str_to_int(response)
[docs] def get_sampling(self) -> float: """ ``[SOURce<HW>]:BB:OFDM:SAMPling`` \n Snippet: ``value: float = driver.source.bb.ofdm.get_sampling()`` \n Queries the sampling rate. :return: samp_rate: float Range: 0.001 to 1000, Unit: MHz """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:SAMPling?') return Conversions.str_to_float(response)
[docs] def get_sc_space(self) -> float: """ ``[SOURce<HW>]:BB:OFDM:SCSPace`` \n Snippet: ``value: float = driver.source.bb.ofdm.get_sc_space()`` \n Sets the frequency distance between the carrier frequencies of the subcarriers. :return: sub_car_sp: float Range: 0.001 to 2, Unit: MHz """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:SCSPace?') return Conversions.str_to_float(response)
[docs] def get_seq_length(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:SEQLength`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_seq_length()`` \n Sets the sequence length of the signal in number of symbols. :return: seq_len: integer Range: 1 to 1000 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:SEQLength?') return Conversions.str_to_int(response)
[docs] def get_state(self) -> bool: """ ``[SOURce<HW>]:BB:OFDM:STATe`` \n Snippet: ``value: bool = driver.source.bb.ofdm.get_state()`` \n Activates the standard. :return: state: 1 | ON | 0| OFF """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:STATe?') return Conversions.str_to_bool(response)
[docs] def get_subcarriers(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:SUBCarriers`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_subcarriers()`` \n Queries the number of subcarriers per subband. :return: subc_per_subband: integer Range: 1 to 16384 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:SUBCarriers?') return Conversions.str_to_int(response)
[docs] def get_zsamples(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:ZSAMples`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_zsamples()`` \n Requires OFDM modulation type: SOURce1:BB:OFDM:MODulation OFDM Sets the number of samples for zero padding. The instrument inserts these zero samples before the modulation symbols. See also 'Padding with zero samples'. The maximum number equals the total number of subcarriers minus one sample, see method ``RsSmw.source.bb.ofdm.nsubcarriers()`` . :return: zero_samples: integer Range: 0 to 16384 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:ZSAMples?') return Conversions.str_to_int(response)
def clone(self) -> 'OfdmCls': """ 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 = OfdmCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group