uwb_channel.asv
资源名称:TOA_uwb.rar [点击查看]
上传用户:doryuen
上传日期:2013-10-30
资源大小:23k
文件大小:2k
源码类别:
通讯/手机编程
开发平台:
Matlab
- % Cassioli Indoor UWB Channel Model
- % Jasurbek Khodjaev - MCL -2006
- function G_i = uwb_channel(d)
- % d - Transmitter- Receiver seperation in meters
- % % time_t = time_t * 1e9;
- % % sample_t = round(time_t / 0.05);
- % % delay_t = zeros(1,sample_t);
- %================= Initialization ===================
- N_bins = 100; % NUmber of Bins
- epsulon = normrnd(16.1, 1.27); % Decay constant
- epsulon = 10^(epsulon/10);
- r = normrnd(-4,3); % Power ratio
- r = 10^(r/10);
- delta_tau = 2; % Bin width
- for ii = 1:N_bins
- tau(ii) = (ii-1) * delta_tau;
- end
- %----------------------------------------------------
- %=============== Path-Loss & Shadowing ==============
- % Path-Loss is expressed in dB, d0 = 1 m is the
- % reference distance
- if d <= 11
- path_loss = 20.4 * log10(d/1);
- else
- path_loss = -56 + 74 * log10(d/1);
- end
- %================ Exponential decay =================
- F = 1/(1 - exp( - delta_tau / epsulon));
- % Total Average Normilized Energy: G_nor_tot
- % Shadowing
- % path_loss = 10^(path_loss/10);
- G_avr_tot = normrnd(-path_loss, 4.3);
- G_avr_tot = 10^(G_avr_tot/10);
- G_avr(1) = (G_avr_tot/(1 + r * F));
- % G_avr(1) = (G_nor_tot/(1+r*F))*r*exp(-(tau(k)-tau(2))/epsulon)
- % G_avr(1) = 10^(G_avr(1)/10);
- for k =2:N_bins
- tt = tau(k) - tau(2);
- part2(k-1) = r * exp(-tt/epsulon);
- G_avr(k) = G_avr(1) * part2(k-1);
- end
- % G_avr = G_avr/norm(G_avr);
- % G_avr = (abs(G_avr)./10);%.* (binornd(1,0.5, 1, length(G_avr)) * 2-1);
- for k = 1:N_bins
- mu(k) = 3.5 - tau(k)/73;
- sigma(k) = 1.84 - tau(k)/160;
- m(k) = sqrt(sigma(k)) * randn + mu(k);
- if m(k) < 0.5
- m(k) = 0;
- end
- G_i(1,k) = gamrnd(m(k),G_avr(k));
- end
- for nk=1:length(G_i)
- if G_i(nk)
- % G_i = [xx G_i(1:end-length(xx))];
- % G_i = [delay_t G_i(1:end-length(delay_t))];
- % G_i = G_i .* (binornd(1,0.5, 1, length(G_i)) .* 2 - 1);
- %====================== END of FUNCTION ============================