torchsig.utils.dsp.noise_generator

torchsig.utils.dsp.noise_generator(num_samples: int = 1024, power: float = 1.0, color: str = 'white', continuous: bool = True, rng: Generator | None = None) ndarray[source]

Generates additive complex noise of specified power and type.

Parameters:
  • num_samples (int) – number of noise samples to generate. Default to 1024

  • power (float) – Desired noise power (linear, positive). Defaults to 1.0 W (0 dBW).

  • color (str) – Noise color, supports ‘white’, ‘pink’, or ‘red’ noise frequency spectrum types. Defaults to ‘white’.

  • continuous (bool) – Sets noise to continuous (True) or impulsive (False). Defaults to True.

  • rng (np.random.Generator, optional) – Random number generator. Defaults to np.random.default_rng(seed=None).

Raises:
  • ValueError – If invalid noise power specified.

  • ValueError – If unsupported noise type specified.

Returns:

Complex noise samples with specified power.

Return type:

np.ndarray