Skip to content

AddGaussianNoise

Added in v0.1.0

Add gaussian noise to the samples

Input-output example

Here we add some gaussian noise (with amplitude 0.01) to a speech recording.

Input-output waveforms and spectrograms

Input sound Transformed sound

Usage example

from audiomentations import AddGaussianNoise

transform = AddGaussianNoise(
    min_amplitude=0.001,
    max_amplitude=0.015,
    p=1.0
)

augmented_sound = transform(my_waveform_ndarray, sample_rate=16000)

AddGaussianNoise API

min_amplitude: float • unit: linear amplitude
Default: 0.001. Minimum noise amplification factor.
max_amplitude: float • unit: linear amplitude
Default: 0.015. Maximum noise amplification factor.
p: float • range: [0.0, 1.0]
Default: 0.5. The probability of applying this transform.

Source code

audiomentations/augmentations/add_gaussian_noise.py