addnoise.m

来自「详细的OFDM设计过程」· M 代码 · 共 29 行

M
29
字号
function m_noisy = addnoise(m,sigma)


global nr_subcarriers
global Ex

% function [m2,n] = addnoise(m1,SNR_db)
% modeling a AWGN channel by adding some noise

% m: input signal
% SNT_db : SNR of the system in db
% m_noisy : m + noise
% n : noise

% ------- add_noise.m -----------------------------------
% Black team
% April-11-05
% ----------------------------------------------------------

%computation of the variance. Maybe it is not correct, I am not sure...
sigma_sqr = 10^(sigma/10); 

%generation of the noise
n = sqrt(sigma_sqr/2) * (randn(size(m)) + j*randn(size(m)));
% Y = WGN(M,N,P)

%add the noise to the input signal
m_noisy = m + n;

⌨️ 快捷键说明

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