Matlab:针对特定的SNR和特定的方差生成噪声信号 [英] Matlab: Generate noisy signal for particular SNR and particular variance

查看:647
本文介绍了Matlab:针对特定的SNR和特定的方差生成噪声信号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,当我们将噪声添加到信号x=rand(1,100)时,这是一种方法

In general when we add noise to a signal x=rand(1,100), this is one way

 sigma_2_v = 0.5;
noisy_signal = rand(1,100) + sqrt(sigma_2_v)*randn(1,100);

在这里找到另一种方法: 添加噪音的正确方法

There is another method found here: Proper way to add noise

对于我的情况,我需要获得有关噪声方差sigma_2_v的信息,并通过改变sigma_2_v来产生噪声信号.我该怎么办?

For my case, I need to have the information about the variance of the noise, sigma_2_v, and generate noisy signal by varying sigma_2_v. How can I do that?

推荐答案

有许多可能的约定用于定义信噪比,一种常见的约定是基于信号和噪声功率的概念.如果频谱的总功率为p,噪声功率为np,则当功率以dB为单位时,信噪比可以写为snr = p - np,而当功率以dB为单位时,信噪比可以写为snr = p/np.功率以线性单位表示.

There are a number of possible conventions used to define a s/n ratio, a common one being based on the notion of signal and noise power. If the total power of the spectrum is p and the noise power is np, then the signal-to-noise can be written as snr = p - np, when the power is in dB units, or snr = p/np, when the power is in linear units.

MATLAB(和八度等效)函数awgn将(高斯白噪声)噪声添加到输入数据阵列,达到所需的最终s/n功率电平,默认以dB为单位指定.函数awgn使用另一个函数wgn生成一个表示所需噪声功率水平的噪声的数组.噪声是从高斯分布中采样的(是经过重新缩放的,以使数组中点的方差恰好等于所需的噪声功率水平,

The MATLAB (and Octave equivalent) function awgn adds (white Gaussian) noise to an input data array to the desired final s/n power level, specified by default in dB. The function awgn uses another function wgn to generate an array representing the noise at a desired noise power level. The noise is sampled from a Gaussian distribution (it is not rescaled to make the variance of the points in the array equal exactly the desired noise power level, as some suggest you do; do not rescale the noise: if you rescale the points sampled from the noise distribution, then the points will (obviously) not necessarily reflect the desired noise distribution or the desired power level!). You can specify the amount of noise to add to your data via awgn in a number of non-default ways, for instance: a) by specifying the power of the input data (the default is 0 dB), or b) by asking the routine to compute the power of the input data using the formula p = var(data,1), where var(...,1) implies computation of the population variance. In either case the routine computes the required noise power level using the formula np = p-snr (in dB).

出色的MATLAB文档很好地描述了 awgn 常规.

The excellent MATLAB documentation provides a good description of the awgn routine.

这篇关于Matlab:针对特定的SNR和特定的方差生成噪声信号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆