torchsig.signals.builders.lfm.LFMSignalBuilder

class torchsig.signals.builders.lfm.LFMSignalBuilder(dataset_metadata: DatasetMetadata, class_name: str = 'lfm_data', **kwargs)[source]

Bases: SignalBuilder

Implements SignalBuilder() for linear frequency modulation (LFM) waveform.

dataset_metadata

Parameters describing the dataset required for signal generation.

Type:

DatasetMetadata

supported_classes

List of supported signal classes. Set to [“lfm_data”].

Type:

List[str]

Methods

add_parent

Add parent Seedable object and set up RNGs accordingly

build

Builds and returns Signal

get_distribution

get_second_seed

Gets second seed, usually used to seed both torch and numpy generators with slightly different seeds

reset

Resets _signal according to defaults defined by dataset metadata.

seed

Seed number generators with given seed.

setup_rngs

Initialize torch and numpy number generators, and update its children.

update_from_parent

Update numpy and torch number generators with parent seed

Attributes

supported_classes

__init__(dataset_metadata: DatasetMetadata, class_name: str = 'lfm_data', **kwargs)[source]

Initializes LFM Signal Builder. Sets class_name= “lfm_data”.

Parameters:
  • dataset_metadata (DatasetMetadata) – Dataset metadata.

  • class_name (str, optional) – Class name.

__repr__()

Return repr(self).

add_parent(parent) None

Add parent Seedable object and set up RNGs accordingly

build() Signal

Builds and returns Signal

The Builder() __init__ calls reset() which initializes the signal metadata according to default values defined within dataset metadata. _update_metadata() then updates signal-specific metadata fields as needed. _update_data() creates the IQ samples and assigns them to the Signal() data field. _correct_bandwidth_and_snr() sets the power of the signal based on the PSD estimate to have the appropriate SNR and then estimates the total occupied bandwidth of the signal, including sidelobes, to develop a more accurate bounding box. .verify() ensures that the metadata values are within the appropriate bounds. The Signal() object is then stored for the return call, and reset() is called to reset the signal metadata fields to their dataset metadata defaults.

In order, calls: - reset() - _update_metadata() - _update_data() - _correct_bandwidth_and_snr() - _signal.verify()

Returns:

Signal being built.

Return type:

Signal

get_second_seed(seed: int) int

Gets second seed, usually used to seed both torch and numpy generators with slightly different seeds

Parameters:

seed (int) – Seed to use.

Returns:

New seed.

Return type:

int

reset() None

Resets _signal according to defaults defined by dataset metadata.

Signal metadata is generated according to the default values as defined by the dataset metadata. The signal data is set to noise samples.

These metadata value can be overridden if a particular modulator or special signal requires it. For example, the bandwidth of a tone is dependent on the signal duration and therefore requires recalculation and an update to the signal metadata inside _update_metadata() in the tone builder class. Similarly, the minimum duration for a constellation based signal must be at least 1 symbol, which requires recomputation in the _update_metadata() field for the constellation builder class.

This method is called by the parent Builder() __init__ and after build().

seed(seed: int) None

Seed number generators with given seed.

Parameters:

seed (int) – Seed to use.

setup_rngs() None

Initialize torch and numpy number generators, and update its children.

update_from_parent() None

Update numpy and torch number generators with parent seed