【问题标题】:add white guassian noise to data with matlab [closed]使用matlab向数据添加高斯白噪声[关闭]
【发布时间】:2019-08-10 09:02:14
【问题描述】:

我正在尝试解决电网的状态估计问题。在电网中,有一些测量设备可以测量电压大小、线路功率等一些量,并将它们发送到控制中心。我有一个用 matlab 编写的状态估计代码,它将这些测量值作为输入并确定网格的状态。 所以,我想为网格创建一个测量集。我有一组无噪声测量,我想用特定的标准偏差(比如 5%)向它们添加高斯噪声。我怎样才能做到这一点?这 5% 的标准差是什么意思(百分比与什么有关?) 提前感谢您的帮助

【问题讨论】:

标签: matlab noise


【解决方案1】:

您可以在以下位置查看标准差的概念:

https://en.wikipedia.org/wiki/Standard_deviation

您可以使用 randn 或 awgn 执行此操作,请参阅:

https://es.mathworks.com/help/comm/ref/awgn.html

https://es.mathworks.com/help/matlab/ref/randn.html

这是一个示例测试,我认为可以根据您的需要进行调整:

close all
A=1; %Amplitude
p=5; %Deviation percentage
n=4;
x = linspace(0,n*pi,1000);
y=A*sin(x);
figure;
plot(x,y)
%Adding Noise

DesiredSD = A*p/100;                               % the desired standard deviation
noise=DesiredSD*randn(1,1000);
y_gaussian_noise =y+noise;
y_g=y+awgn(y,p,'measured');
figure;
plot(x,noise);
figure;
plot(x,y,x,y_gaussian_noise,x,y_g,'linewidth',1.2);
xlabel('Time(s)');
ylabel('Signal');
legend('without noise', 'with noise','awgn generator');

【讨论】:

  • 您的意思是输入noise=DesiredSD*randn(1,1000); 以获得随机数向量而不是矩阵?
  • 是的,你是对的,谢谢!
  • 谢谢。您提到的两种方式都会向信号中添加高斯白噪声吗?为什么他们的输出在图中如此不同?
  • 安全的方法是使用rand,因为使用 awgn 您需要知道信号的功率(以 dBW 为单位)
猜你喜欢
  • 2013-10-14
  • 2015-02-04
  • 2011-09-12
  • 1970-01-01
  • 1970-01-01
  • 2016-02-07
  • 2016-08-17
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多