⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gngauss.m

📁 理想无算法调制解调,包含了产生高斯噪声的子程序。
💻 M
字号:
function [gsrv1,gsrv2]=gngauss(m,sgma)
% [gsrv1,gsrv2]=gngauss(m,sgma);
% [gsrv1,gsrv2]=gngauss(sgma);
% [gsrv1,gsrv2]=gngauss;
% GAGAUSS generates two independent Gaussian random variables with mean m 
% and standard deviation sgma. If one of the input arguments is missing, 
% it takes the mean as 0; and the standard deviation as the given parameter.
% If neither mean nor the variance is given, it generates two standard
% Gaussian random variables.
if nargin==0
   m=0;sgma=1;
elseif nargin==1
   sgma=m;m=0;
end;
u=rand;
z=sgma*(sqrt(2*log(1/(1-u))));
u=rand;
gsrv1=m+z*cos(2*pi*u);
gsrv2=m+z*sin(2*pi*u);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -