加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
simulate.m 1.09 KB
一键复制 编辑 原始数据 按行查看 历史
Xixi22 提交于 2021-03-28 18:48 . temp
% 瀹氫綅妯″瀷
clear all;
nrx = 3; % 闃靛厓涓暟
ntx = 3;
K = 113;
path = 2; % 淇℃簮鏁扮洰
snr = 3; % 淇″櫔姣?
d = 0.027; % 闃靛厓闂磋窛
l_los = 5;
% theta1 = randperm(180,1);% theta2 = randperm(180,path-1);
% phi1 = randperm(180,1);
% phi2 = randperm(180,path-1);
% theta2 > theta1,phi2 < phi1
derad = pi/180;
theta1 = 90;
theta2 = [60];
phi1 = 90;
phi2 = [120];
c = 3e8;
f = 5.8e9;
delta_theta = (theta2-theta1);
delta_phi = (phi1 - phi2);
theta = [theta1,theta2];
phi = [phi1,phi2];
delta_tau = l_los ./ (c*cos((delta_theta+delta_phi)*derad/2)./(2*sin(delta_theta*derad/2).*sin(delta_phi*derad/2)));
% 如果是直角三角形,特殊处理
right = find(abs(abs(delta_theta + delta_phi)-90) < 1e-3);
if isempty(right) == 0
delta_tau(right) = l_los / c * (abs(sin(delta_theta(right)*derad)+sin(delta_phi(right)*derad))-1);
end
% toff1 = l_los / c;
% toff2 = toff1 + delta_tau;
% toff = [toff1,toff2];
toff = [16,20]*1e-9;
threshold = 0.5;
dcps = [0,randperm(20,path-1)];
[H_a,H_ad,H_at,H_adt,H_adtp] = data_sim(nrx,ntx,K,path,theta,phi,toff,dcps,snr);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化