定义 
原始信号:x 
噪声信号:n 
信噪比:SNR

信号长度:N

python 写matlab中的加性高斯白噪声AWGN

python 写matlab中的加性高斯白噪声AWGN

 

 

def wgn(x, snr):
    snr = 10**(snr/10.0)
    xpower = np.sum(x**2)/len(x)
    npower = xpower / snr
    return np.random.randn(len(x)) * np.sqrt(npower)

t = np.arange(0, 1000000) * 0.1
x = np.sin(t)
n = wgn(x, 6)
xn = x+n # 增加了6dBz信噪比噪声的信号

 

相关文章:

  • 2022-12-23
  • 2021-05-12
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
  • 2022-01-25
  • 2021-09-30
  • 2022-12-23
  • 2021-09-07
相关资源
相似解决方案