AWGN:在某一信号中加入高斯白噪声
y = awgn(x,SNR) 在信号x中加入高斯白噪声。信噪比SNR以dB为单位。x的强度假定为0dBW。如果x是复数,就加入复噪声。y = awgn(x,SNR,SIGPOWER) 如果SIGPOWER是数值,则其代表以dBW为单位的信号强度;如果SIGPOWER为'measured',则函数将在加入噪声之前测定信号强度。y = awgn(x,SNR,SIGPOWER,STATE) 重置RANDN的状态。y = awgn(…,POWERTYPE) 指定SNR和SIGPOWER的单位。POWERTYPE可以是'dB'或'linear'。如果POWERTYPE是'dB',那么SNR以dB为单 位,而SIGPOWER以dBW为单位。如果POWERTYPE是'linear',那么SNR作为比值来度量,而SIGPOWER以瓦特为单位clear all;% To specify the power of X to be 0 dBW and add noise to produce% an SNR of 10dB, use:X = sqrt(2)*sin(0:pi/8:6*pi);Y = awgn(X,10,0);% To specify the power of X to be 3 Watts and add noise to% produce a linear SNR of 4, use:Y1 = awgn(X,4,3,'linear');% To cause awgn to measure the power of X and add noise to% produce a linear SNR of 4, use:Y2 = awgn(X,4,'measured','linear'); % subplot(411);plot(X);subplot(412);plot(Y);subplot(413);plot(Y1);subplot(414);plot(Y2);