添加高斯白噪声

发布于 2024-11-15 09:49:03 字数 719 浏览 5 评论 0原文

上下文

我有一个由一系列列向量组成的矩阵。每个列向量包含一系列以度为单位定义的角度,范围在 -180 到 180 之间。我希望向序列中的每个角度添加高斯白噪声,以测试系统的抗噪声鲁棒性。

鉴于某些角度在序列中变化不大,而其他角度变化很大,我希望在与活动/变化量成比例的水平上添加噪声。因此,我选择从均值为零的高斯样本中进行采样,其幅度相对于各个角度的标准差(作为比率)定义。

我的 Matlab 代码如下:

function Y2 = addnoise2angles(Y1, ratio)

%# Random numbers sampled from Gaussian
N = randn(size(Y1));

%# Noise level is defined per angle as a ratio of their respective standard deviations
sigma = std(Y1, 0, 2);
N = N.*repmat(sigma, 1, size(N, 2));
N = N*ratio;

%# Apply noise to angles
Y2 = Y1+N;
Y2 = wrapTo180(Y2);

end

问题

这是测试噪声鲁棒性的正确方法吗?

如果是这样,什么比率范围对于测试来说是合理的?

如果不是,那有什么问题,正确的做法是什么?

Context

I have a matrix comprising of a sequence of column vectors. Each column vector contains a series of angles defined in degrees within the range -180 to 180. I wish to add white Gaussian noise to each angle across the sequence to test a system in relation to its robustness against noise.

Given that some angles do not change much and others change significantly over the sequence, I wish to add noise at a level that is proportional to the amount of activity/change. Therefore, I have chosen to sample from a Gaussian with zero mean with the amplitude defined relative to the individual angles' standard deviation (as a ratio).

My Matlab code for doing so is given below:

function Y2 = addnoise2angles(Y1, ratio)

%# Random numbers sampled from Gaussian
N = randn(size(Y1));

%# Noise level is defined per angle as a ratio of their respective standard deviations
sigma = std(Y1, 0, 2);
N = N.*repmat(sigma, 1, size(N, 2));
N = N*ratio;

%# Apply noise to angles
Y2 = Y1+N;
Y2 = wrapTo180(Y2);

end

Questions

Is this the right approach to test the robustness to noise?

If so, what range of ratios would be sensible for testing?

If not, what is wrong about it, and what is the right approach?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

太阳哥哥 2024-11-22 09:49:03

如果我理解正确的话,每一行都是同一角度的测量,每一列都是所有角度的一次测量。您想要做的是向整组测量添加一些噪声,以便检查对后续过程的影响。您应该如何添加噪音完全取决于您想要回答什么类型的问题。如果您认为每列看起来像是所有角度的测量,那么您独立估计每个角度测量中的噪声,然后添加额外的白噪声的想法将允许您说出每个角度噪声如何影响后续流程。从这个意义上说,我认为你的测量是有效的。

我要指出的一件事是,测量围绕圆的角度的标准偏差与测量实线上的样本不同。例如,如果您的测量值是 180 + randn(0.1),即位于 +180 和 -180 之间的边界,那么您的标准偏差测量值将远大于 0.1 度,因为大多数样本非常接近+180 或-180。解决这个问题的一种非常简单的方法是使用不同的包裹点两次估计标准偏差,并取最小估计值。例如,

sigma1 = std(Y1, 0, 2);
sigma2 = std(wrapTo180(Y1+90),0,2);
sigma = min(sigma1,sigma2);

存在对环周围方差的更复杂的估计,例如查看样本内所有估计对之间的中值角度差。您的应用程序可能不需要这种额外的复杂性。

If I understand correctly, each row is the measurement of the same angle, and each column is a single measurement of all the angles. What you would like to do is add some noise to the entire set of measurements, so as to then check the effect on some subsequent process. How you should add the noise is completely dependent on what sort of question you want to answer. If you believe that each column looks something like a measurement of all the angles, then your idea of estimating the noise in each angle measurement independently, and then adding additional white noise, would allow you to say something about how per-angle noise effects a subsequent process. In this sense I think your measurement works.

One thing I would point out is that measuring the standard deviation of angles around a circle is not the same as measuring samples on the real line. For instance, if you have a measurement whos value is 180 + randn(0.1), i.e, right at the boundary between +180 and -180, then your measurement of the std deviation is going to be much larger than .1 degree, since most samples are very close to +180 or -180. One very easy way to solve this is to estimate the std deviation twice, with different wrapping points, and take the minimum estimate. E.g.

sigma1 = std(Y1, 0, 2);
sigma2 = std(wrapTo180(Y1+90),0,2);
sigma = min(sigma1,sigma2);

More complicated estimates for variance around a ring exist, for instance looking looking at the median angle difference between all estimate pairs within a sample. This additional complexity might not be necessary for your application.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文