matlab 产生白噪声

用matlab产生服从高斯分布,均匀分布,指数分布,瑞利分布的白噪声,并绘出噪声信号及其直方图

y=randn(1,100);高斯分布

y=rand(1,100);均与分布

R=exprnd(MU,m,n) 生成m×n形式的指数分布的随机数矩阵。

RAYLCDF Rayleigh cumulative distribution function.

P = RAYLCDF(X,B) returns the Rayleigh cumulative distribution

function with parameter B at the values in X.

The size of P is the common size of X and B. A scalar input

functions as a constant matrix of the same size as the other input.

扩展资料

matlab中噪声功率、噪声方差关系,以matlab中awgn函数为例说明:

在matlab中无论是wgn还是awgn函数,实质都是由randn函数产生的噪声。即:wgn函数中调用了randn函数,而awgn函数中调用了wgn函数。

根据awgn的实现代码可以知道”向已知信号添加某个信噪比(SNR)的高斯白噪声“,即:awgn(x,snr,’measured’,'linear’),命令的作用是对原信号x添加信噪比(比值)为SNR的噪声,在添加之前先估计信号x的强度。

在求出x的强度后,结合指定的信噪比,就可以求出需要添加的噪声的强度noisePower=sigPower/SNR。

由于使用的是高斯白噪声即randn函数,而randn的结果是一个强度为1的随机序列(自己试试sum(randn(1000,1).^2)/1000就知道了,注意信号的长度不能太小)。于是,所要添加的噪声信号显然就是:sqrt(noisePower)*randn(n,1)

其中n为信号长度,自然要求的白噪声的方差也可以求出来。

参考资料来源:百度百科 - 白噪声

百度百科 - MATLAB

百度百科 - AWGN



温馨提示:答案为网友推荐,仅供参考
第1个回答  2019-11-12

这样:

randn函数产生高斯分布序列,例如:

y=randn(1,2500); 

y=y/std(y); 

y=y-mean(y); 

a=0.0128; 

b=sqrt(0.9596); 

y=a+b*y;

y=rand(1,100);均与分布

R=exprnd(MU,m,n) 生成m×n形式的指数分布的随机数矩阵。

RAYLCDF Rayleigh cumulative distribution function.

P = RAYLCDF(X,B) returns the Rayleigh cumulative distribution

function with parameter B at the values in X.

The size of P is the common size of X and B. A scalar input

functions as a constant matrix of the same size as the other input.

扩展资料:

注意事项

在matlab中无论是wgn还是awgn函数,实质都是由randn函数产生的噪声。即,wgn函数中调用了randn函数,而awgn函数中调用了wgn函数。

根据awgn的实现代码可以知道“向已知信号添加某个信噪比(SNR)的高斯白噪声”,即:awgn(x,snr,’measured’,'linear’),命令的作用是对原信号x添加信噪比(比值)为SNR的噪声,在添加之前先估计信号x的强度。

直接对原始信号添加噪声:

y=x+rand(length(x),1)

y=x+randn(length(x),1))

本回答被网友采纳
第2个回答  推荐于2017-11-26
y=randn(1,100);高斯分布
y=rand(1,100);均与分布
R=exprnd(MU,m,n) 生成m×n形式的指数分布的随机数矩阵。
RAYLCDF Rayleigh cumulative distribution function.
P = RAYLCDF(X,B) returns the Rayleigh cumulative distribution
function with parameter B at the values in X.

The size of P is the common size of X and B. A scalar input
functions as a constant matrix of the same size as the other input.本回答被提问者采纳
相似回答