vivyd.excitation.NoiseGenerator#

class NoiseGenerator(n, dt, psd_tab)[source]#

Bases: object

A class for generating one or more noise signals with a specified two-sided power spectral density function.

Parameters:
  • n (int) – Window size of the generated noise signal.

  • dt (float) – Time step of the generated noise signal. Governs the maximum frequency that can be represented in the signal (Nyquist frequency): \(f_N = \dfrac{1}{2 \text{dt}}\).

  • psd_tab (Sequence[Callable[[arrf64], arrf64]]) – A sequence of N two-sided power spectral density functions, one for each noise signal to be generated. Each function should take an array of frequencies as input and return an array of the same shape containing the corresponding power spectral density values.

Caution

The package assumes that the power spectral density functions are two-sided. Therefore, some expressions for the power spectral density functions may need to be adjusted by a factor of 0.5 and made symmetric.

Methods#

NoiseGenerator.generate()[source]#

Generate an N Excitation objects containing a realization of noise with the corresponding power spectral density function.

Returns:

A tuple of Excitation objects containing the generated noise signal(s).

Return type:

tuple[Excitation, …]

NoiseGenerator.__call__()[source]#

Call self as a function.

Return type:

tuple[Excitation, …]

static NoiseGenerator.deterministic()[source]#
Returns:

A power spectral density function that corresponds to a deterministic signal, that is, \(S(f) = 0, \forall f \in \mathbb{R}\).

Return type:

psd_func

static NoiseGenerator.none()[source]#

Same as deterministic().

Return type:

psd_func

static NoiseGenerator.white(s=1.0)[source]#
Parameters:

s (float, optional) – The constant power spectral density value for all frequencies (default is 1.0).

Returns:

A power spectral density function that corresponds to white noise, which has a constant power spectral density across all frequencies, that is, \(S(f) = s, \forall f \in \mathbb{R}\).

Return type:

psd_func

static NoiseGenerator.generalized(sigma2, U, Lu, A, B, mu)[source]#
Parameters:
  • sigma2 (float) – The variance of the noise.

  • U (float) – The mean velocity.

  • Lu (float) – The integral length scale of turbulence.

  • A (float) – The numerator scaling factor.

  • B (float) – The denominator scaling factor.

  • mu (float) – The spectral exponent.

Returns:

A generalized power spectral density function that can represent various types of noise by adjusting its parameters. This function is based on the model described in [SP01], in Equations (9)-(14), that is, \(S(f) = 0.5 \ \sigma^2 \dfrac{A \dfrac{L_u}{U}}{\left(1 + B \left| \dfrac{f L_u}{U} \right|^\mu \right)^{5/(3 \mu)}}\).

Return type:

psd_func

static NoiseGenerator.von_karman(sigma2, U, Lu)[source]#
Parameters:
  • sigma2 (float) – The variance of the noise.

  • U (float) – The mean velocity.

  • Lu (float) – The integral length scale of turbulence.

Returns:

A power spectral density function that corresponds to the von Kármán spectrum (see [VKarman48]), that is, \(S(f) = 0.5 \ \sigma^2 \dfrac{4 \dfrac{L_u}{U}}{\left(1 + 70.8 \left| \dfrac{f L_u}{U} \right|^2 \right)^{5/6}}\).

Return type:

psd_func