当前位置:网站首页>Detailed understanding of white noise

Detailed understanding of white noise

2022-06-13 01:40:00 Under the starry sky 0516

In data processing , We often encounter noise . General noise is a kind of random signal or random process with constant power spectral density , That is white noise . The origin of white noise is that white light is a mixture of monochromatic light of various frequencies , Because the average power spectrum property of this signal becomes “ white ”, This signal is also known as white noise . The ideal white noise has infinite bandwidth , So its energy is infinite , This is impossible in the real world . actually , People often regard flat signals with limited bandwidth as white noise , To facilitate mathematical analysis . White noise has the following characteristics :

  • The mathematical expectation is 0:
    μ n = E { n ( t ) } = 0 \mu_n=E\{n(t)\}=0 μn=E{ n(t)}=0
#  Code testing :
import numpy as np
noise = np.random.rand(0, 1, 100000)
mean = np.mean(noise)
print(mean)
0.004019681758208514  #  Why not 0, That is to say , As long as the bandwidth is enough , Is the ideal white noise .
  • The autocorrelation function is Dirac function
    r n n = E { n ( t ) n ( t − τ ) } = δ ( τ ) r_{nn} = E\{n(t)n(t-\tau)\}=\delta(\tau) rnn=E{ n(t)n(tτ)}=δ(τ)
#  Code testing 
import imageio
import numpy as np

nums = np.arange(10, 100000, 1000)
for num in nums:
	noise = np.random.normal(0, 1, num)
	corr = np.correlate(noise, noise, mode='full')
	plt.plot(corr)
	plt.savefig('figs/fig%d.png'%num)
	plt.close()

with imageio.get_write('mygif.gif', mode='I') as writer:
	for num in nums:
		image = imageio.imread('figs/fig%d/png%num)
		write.append_data(image)

Image results :
 Insert picture description here Above is Dirac function .

  • Power spectral density is flat
import matplotlib.pyplot as plt
noise = np.random.rand(0, 1, 100000)
plt.psd(noise, 1000)
plt.savefig('image.png', dpi=300)

give the result as follows :
 Insert picture description here

原网站

版权声明
本文为[Under the starry sky 0516]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/164/202206130137385642.html