torchsig.signals.builders.ofdm.ofdm_modulator

torchsig.signals.builders.ofdm.ofdm_modulator(num_subcarriers: int, bandwidth: float, sample_rate: float, num_samples: int, rng: Generator | None = None) ndarray[source]

Modulator for OFDM signals.

Parameters:
  • num_subcarriers – Number of subcarriers to use.

  • bandwidth – Desired 3 dB bandwidth of the signal (Hz).

  • sample_rate – Sampling rate for the IQ signal (Hz).

  • num_samples – Number of IQ samples to produce.

  • rng – Random number generator for reproducibility. If None, creates a new default generator.

Returns:

OFDM modulated signal at the appropriate bandwidth.

Return type:

np.ndarray

Raises:
  • ValueError – If bandwidth or sample_rate are not positive.

  • ValueError – If bandwidth exceeds sample_rate/2.

  • ValueError – If num_samples is not positive.