pynrc.simul.ngNRC.pink_noise¶
- pynrc.simul.ngNRC.pink_noise(nstep_out, pow_spec=None, f=None, fmin=None, alpha=- 1, **kwargs)[source]¶
Generate random pink noise
- Parameters
nstep_out (int) – Desired size of the output noise array. If smaller than pow_spec then it just truncates the results to the appropriate size. If larger, then pow_spec gets padded by the specified pad_mode.
pow_spec (ndarray) – Option to input the power spectrum instead of regenerating it every time. Make sure this was generated with powers of 2 for faster processing.
f (ndarray or None) – An array the same size as pow_spec. If set to None, then will create an array of appropriate size assuming a delta time of unity.
fmin (float or None) – Low-frequency cutoff. Power spectrum values below this cut-off point get set equal to the power spectrum value at fmin.
alpha (float) – Power spectrum index to generate if pow_spec is not specified directly.
- Keyword Arguments
pad_mode (str or function) –
One of the following string values or a user supplied function. Default is ‘edge’.
- ’constant’ (default)
Pads with a constant value.
- ’edge’
Pads with the edge values of array.
- ’linear_ramp’
Pads with the linear ramp between end_value and the array edge value.
- ’maximum’
Pads with the maximum value of all or part of the vector along each axis.
- ’mean’
Pads with the mean value of all or part of the vector along each axis.
- ’median’
Pads with the median value of all or part of the vector along each axis.
- ’minimum’
Pads with the minimum value of all or part of the vector along each axis.
- ’reflect’
Pads with the reflection of the vector mirrored on the first and last values of the vector along each axis.
- ’symmetric’
Pads with the reflection of the vector mirrored along the edge of the array.
- ’wrap’
Pads with the wrap of the vector along the axis. The first values are used to pad the end and the end values are used to pad the beginning.
rand_seed (None or int) – Seed value to initialize random number generator to obtain repeatable values.