Noise models

In real-world applications, the noise is always present in the measured data. The noise can be due to various reasons such as the sensor noise, the environmental noise, the quantization noise, etc. The noise can be modeled as a random process. The package implements various type of noise in order to cover a wide range of practical situations.

1 Additive Gaussian White noise

When a signal, real or complex, \(x\) is corrupted by an additive Gaussian white noise \(n\), the measured signal \(y\) can be written as: \[ y = x + n \] where \(n \sim \mathcal{N}(n| 0, \sigma^2)\)

agwn


agwn(x, snr_dB; rst = true)

Adds a Gaussian White Noise (AGWN) to a signal x with a given SNR.

Inputs

  • x: Signal (Real or Complex)

  • snr_dB: signal to noise ratio [dB]

  • rst: Reset the random number generator - Bool

Output

  • y: Noisy signal

# Noiseless signal
Δt = 1e-4
t = 0:Δt:1
x = sin.(2π*5*t)

# Signal to noise ratio
snr_dB = 25.

# Noisy signal
y = agwn(x, snr_dB)

2 Additive Colored noise

When a signal, real or complex, \(x\) is corrupted by an additive colored noise \(n\), the measured signal \(y\) can be written as: \[ y = x + n, \] where \(n\) is a colored noise defined as in Excitation models - Colored noise.

acn - Real signal


acn(x, snr_dB, fs, color = :pink; band_freq = Float64[], rst = true)

Adds a complex Colored Noise (ACN) to a signal x with a given SNR

Inputs

  • x: Signal

  • snr_dB: Signal to noise ratio [dB]

  • fs: Sampling frequency [Hz]

  • color: Color of the noise

    • :white

    • :pink (default)

    • :blue

    • :brown

    • :purple

  • band_freq: Frequencies used to defined the bandpass filter applied to the colored noise

  • rst: Reset the random number generator

Output

  • y: Noisy signal

acn - Complex signal


acn(x, snr_dB, freq, color = :pink; rst = true)

Adds a complex Random Colored Noise (ACN) to a signal x with a given SNR

Inputs

  • x::VecOrMat{Real}: Signal

  • snr_dB: Signal to noise ratio [dB]

  • freq::AbstractVector: Frequency range of interest

  • color: Color of the noise

    • :white

    • :pink (default)

    • :blue

    • :brown

    • :purple

  • rst::Bool: Reset the random number generator

Output

  • y: Noisy signal

acn(x, snr_dB, fs, color = :pink; band_freq = Float64[], rst = true)

Adds a complex Colored Noise (ACN) to a signal x with a given SNR

Inputs

  • x: Signal

  • snr_dB: Signal to noise ratio [dB]

  • fs: Sampling frequency [Hz]

  • color: Color of the noise

    • :white

    • :pink (default)

    • :blue

    • :brown

    • :purple

  • band_freq: Frequencies used to defined the bandpass filter applied to the colored noise

  • rst: Reset the random number generator

Output

  • y: Noisy signal

# Noiseless signal
Δt = 1e-4
fs = 1/Δt
t = 0:Δt:1
x = sin.(2π*5*t)

# Signal to noise ratio
snr_dB = 25.

# Noisy signal
y = acn(x, snr_dB, fs, :blue)

3 Multiplicative Gaussian White noise

When a signal, real or complex, \(x\) is corrupted by a multiplicative Gaussian white noise \(n\), the measured signal \(y\) can be written as: \[ y = (1 + n)x \]

mgwn


mgwn(x, snr_dB; rst = true)

Adds a multiplicative Gaussian White Noise (MGWN) to a signal x with a given SNR

Inputs

  • x: Signal

  • snr_dB: Signal to noise ratio [dB]

  • rst: Reset the random number generator

Output

  • y: Noisy signal

# Noiseless signal
Δt = 1e-4
t = 0:Δt:1
x = sin.(2π*5*t)

# Signal to noise ratio
snr_dB = 25.

# Noisy signal
y = mgwn(x, snr_dB)

4 Mixed noise

When a signal, real or complex, \(x\) is corrupted by a mixed noise \(n\), the measured signal \(y\) can be written as: \[ y = (1 + n_m)x + n_a \] where \(n_m\) is a multiplicative Gaussian white noise and \(n_a\) is an additive Gaussian white noise.

mixed_noise


mixed_noise(x, snr_dB; rst = true)

Adds both additive and multiplicative Gaussian White Noise to a signal x with a given SNR

Inputs

  • x: Signal

  • snr_dB: Signal to noise ratio [dB]

  • rst: Reset the random number generator

Output

  • y: Noisy signal

# Noiseless signal
Δt = 1e-4
t = 0:Δt:1
x = sin.(2π*5*t)

# Signal to noise ratio
snr_dB = 25.

# Noisy signal
y = mixed_noise(x, snr_dB)