Skip to content

schmidtleon48/Noise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Noise generator

Description

Creating a stationary mean free random process, where you can choose the inital sampling distribution and power spectral density (psd).

Function

Creating white noise with desired sampling distribution. Then fitting the desired psd to the noise.

Usage

noise(n_samples, psd, distribution)

Parameters:

  • n_samples: number of sampels
  • psd: psd of noise with maximal frequency the nyquist frequency
    freq_s = np.fft.fftfreq(n_samples, 1 /f_s) 
  • distribution: choose how to sample white noise ("uniform", "binominal", "gauss")

Retruns:

  • noise samples

Example

Here are two examples shown, where 1/f noise is generated.

1. Example:

In the first example the 1/f noise is generated based on white gaussian noise (WGN). One realizaition of the noise is shown in the following graph.

gauss_1

After that the desired power spectral density (psd) and the psd of the noise siganl are compared.

gauss_2

2. Example:

In the second example 1/f noise is generated based on a binominal distribution. The random variables are x1 = 1 and x2 = -1 with the same probability. The generated 1/f noise is shown in the following graph.

binominal_1

And finally both psd are compared.

binominal_1

Releases

No releases published

Packages

No packages published

Languages