torchsig.signals.signal_types.SignalMetadata¶
- class torchsig.signals.signal_types.SignalMetadata(dataset_metadata: DatasetMetadata = None, center_freq: float = None, bandwidth: float = None, start_in_samples: int = None, duration_in_samples: int = None, snr_db: float = None, class_name: str = None, class_index: int = None)[source]¶
Bases:
objectRepresents metadata associated with a signal.
- dataset_metadata¶
The dataset metadata for the signal. Defaults to None.
- Type:
Methods
Returns a deep copy of itself
Returns SignalMetadata as a full dictionary
Verifies Signal Metadata fields
Attributes
Returns the dataset metadata for the signal.
Signal duration (normalized)
Calculates the lower frequency of a signal
Signal number of IQ samples
Calculates the oversampling rate for a signal
Signal sample rate
Signal start normalized to duration of signal
Signal stop normalized to duration of signal
Signal stop in samples
Calculates the upper frequency of a signal
- __init__(dataset_metadata: DatasetMetadata = None, center_freq: float = None, bandwidth: float = None, start_in_samples: int = None, duration_in_samples: int = None, snr_db: float = None, class_name: str = None, class_index: int = None)[source]¶
Initializes the SignalMetadata object.
- Parameters:
dataset_metadata (DatasetMetadata, optional) – Metadata related to the dataset. Defaults to None.
center_freq (float, optional) – The center frequency of the signal in Hz. Defaults to 0.0.
bandwidth (float, optional) – The bandwidth of the signal in Hz. Defaults to 0.0.
start_in_samples (int, optional) – The start time in samples. Defaults to 0.
duration_in_samples (int, optional) – The duration in samples. Defaults to 0.
snr_db (float, optional) – The signal-to-noise ratio in decibels. Defaults to 0.0.
class_name (str, optional) – The class name of the signal. Defaults to “None”.
class_index (int, optional) – The class index of the signal. Defaults to -1.
- property dataset_metadata: DatasetMetadata¶
Returns the dataset metadata for the signal.
- Returns:
The dataset metadata.
- Return type:
- property start: float¶
Signal start normalized to duration of signal
Returns signal start as a percentage of total time, ex: start=0.5 means the signal starts 50% of the way into the dataset IQ samples.
- Returns:
signal start
- Return type:
- property stop: float¶
Signal stop normalized to duration of signal
Returns signal stop as a percentage of total time, ex: stop=0.5 means the signal stops 50% of the way into the dataset IQ samples.
- Returns:
signal stop
- Return type:
- property duration: float¶
Signal duration (normalized)
Returns signal duration normalized from 0.0 to 1.0
- Returns:
signal duration
- Return type:
- property stop_in_samples: int¶
Signal stop in samples
Returns the index where the signal stops in the dataset IQ.
- Returns:
signal stop
- Return type:
- property upper_freq: float¶
Calculates the upper frequency of a signal
Calculates the upper frequency edge, or highest frequency, associated with the bandwidth of the signal.
- Returns:
upper frequency
- Return type:
- property lower_freq: float¶
Calculates the lower frequency of a signal
Calculates the lower frequency edge, or lowest frequency, associated with the bandwidth of the signal.
- Returns:
lower frequency
- Return type:
- property oversampling_rate: float¶
Calculates the oversampling rate for a signal
Calculates the oversampling rate for a signal. If a signal’s bandwidth is 1/2 the sampling rate, the oversampling rate is 2.
- Returns:
oversampling rate
- Return type:
- deepcopy() SignalMetadata[source]¶
Returns a deep copy of itself
- Returns:
Deep copy of SignalMetadata
- Return type: