?? uwb_ch.m
字號:
%uwb_ch calculates the tap amplitudes and tap delays for a UWB channel%according to the modified S-V model%cm : Target Channel Characteristic% m : Number of Clusters% n : Number of rays within each cluster%function [h_val,Del]=uwb_ch(cm,m,n)clear all;cm=1;m=1;n=20;% Modified S-V Channel Model Parametersif cm==1 V=0.0233e9;%Cluster Arrival Rate v=2.5e9;%Ray Arrival Rate D=7.1;%Cluster Decay Factor d=4.3;%Ray Decay Factor nlos=0;else if cm==2 V=0.4e9;%Cluster Arrival Rate v=0.5e9;%Ray Arrival Rate D=5.5;%Cluster Decay Factor d=6.7;%Ray Decay Factor nlos=1; else if cm==3 V=0.0667e9;%Cluster Arrival Rate v=2.1e9;%Ray Arrival Rate D=14;%Cluster Decay Factor d=7.9;%Ray Decay Factor nlos=1; else if cm==4 V=0.0667e9;%Cluster Arrival Rate v=2.1e9;%Ray Arrival Rate D=24;%Cluster Decay Factor d=12;%Ray Decay Factor nlos=1; end end endend% Setting the values for standard dev. of fadingsstd_ln_1=10^0.34;std_ln_2=10^0.34;std_shdw=10^0.3;% initialize and precompute some thingsstd_L = 1/sqrt(2*V); % std dev (nsec) of cluster arrival spacingstd_lam = 1/sqrt(2*v); % std dev (nsec) of ray arrival spacingm_const = (std_ln_1^2+std_ln_2^2)*log(10)/20; % pre-compute for laterif nlos, Tc = (std_L*randn)^2 + (std_L*randn)^2; % First cluster random arrival else Tc = 0; % First cluster arrival occurs at time 0 end for i=1:m %Determine Ray arrivals for each cluster Tr = 0; % first ray arrival defined to be time 0 relative to cluster ln_xi = std_ln_1*randn; % set cluster fading (new line added in rev. 1) for j=1:n t_val = (Tc+Tr); % time of arrival of this ray mu = (-10*Tc/D-10*Tr/d)/log(10) - m_const; ln_beta = mu + std_ln_2*randn; pk = 2*round(rand)-1; h_val(i,j)=pk * 10^((ln_xi+ln_beta)/20); % signed amplitude of this ray t_ray(i,j)=Tr; Tr = Tr + (std_lam*randn)^2 + (std_lam*randn)^2; end t_clst(i)=Tc; Tc = Tc + (std_L*randn)^2 + (std_L*randn)^2; end pos=sign(h_val); H_val=pos.*h_val; h_val=sort(H_val); h_val=pos.*h_val; for i=1:m Del(i,:)=t_clst(i)+t_ray(i,:); end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -