📄 addnoise.m
字号:
function m_noisy = addnoise(m,sigma)
% 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -