📄 cp0801_gnoise2.m
字号:
%
% FUNCTION 8.3 : "cp0801_Gnoise2"
%
% Introduces additive white Gaussian noise over signal
% 'input'.
% Vector 'exno' contains the target values of Ex/No (in dB)
% 'numpulses' is the number of pulses composing the input
% signal
%
% Multiple output signals are generated, one signal for
% each target value of Ex/No. The array 'output' contains
% all the signals (input+AWGN), one signal per row.
% The array 'noise' contains the different realization of
% the Gaussian noise, one realization per each row.
%
% Programmed by Guerino Giancola
%
function [output,noise] = ...
cp0801_Gnoise2(input,exno,numpulses)
% -------------------------------
% Step One - Introduction of AWGN
% -------------------------------
Ex = (1/numpulses)*sum(input.^2); % measured energy per
% pulse
ExNo = 10.^(exno./10); % Ex/No in linear units
No = Ex ./ ExNo; % Unilateral spectral
% density
nstdv = sqrt(No./2); % Standard deviation for
% the noise
for j = 1 : length(ExNo)
noise(j,:) = nstdv(j) .* randn(1,length(input));
output(j,:) = noise(j,:) + input;
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -