📄 add_noise.m
字号:
function out=add_noise(v,rate,down,up)
% add impulsive NLOS error to normal error
% v: normal location error
% rate: the ratio of impulsive NLOS error to the lenght of normal error
% up: up bound of impulsive NLOS error
% down: down bound of impulsive NLOS error
N=round(length(v)*rate);
nlos=down+(up-down)*rand(1,N);
K=length(v);
out(1:K)=0;
for n=1:N
index=randint(1,1,K-1)+1;
out(index)=v(index)+nlos(n);
end
out=out+v;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -