⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 parameters.m

📁 无线仿真Matlab代码
💻 M
字号:
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %   Copyright (c) __year__ Ericsson Telecommunicatie B.V. %   All rights reserved. %    %   Redistribution and use in source and binary forms, with or without %   modification, are permitted provided that the following conditions %   are met: %   1. Redistributions of source code must retain the above copyright %       notice, this list of conditions and the following disclaimer. %   2. Redistributions in binary form must reproduce the above copyright %       notice, this list of conditions and the following disclaimer in the %       documentation and/or other materials provided with the %       distribution. %   3. Neither the name of Ericsson Telecommunicatie B.V. may be used %       to endorse or promote products derived from this software without %       specific prior written permission. %    %    %   THIS SOFTWARE IS PROVIDED BY ERICSSON TELECOMMUNICATIE B.V. AND %   CONTRIBUTORS "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, %   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF %   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. %   IN NO EVENT SHALL ERICSSON TELECOMMUNICATIE B.V., THE AUTHOR OR HIS %   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, %   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, %   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR %   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY %   OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT %   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE %   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. %    %    %   Contact for feedback on EURANE: eurane@ti-wmc.nl %   EURANE = Enhanced UMTS Radio Access Network Extensions %   website: http://www.ti-wmc.nl/eurane/ %%   ***************************************************************************%%   UMTS-HSDPA channel generator %%   Define input parameters%   Parameters are divided in two groups:%   1)parameters that may be changed by people interested in the network layer %   and need this matlab pre-processing to generate input traces for ns-2.%   These parameters are requested during the actual matlab simulation by means %   of a input dialog.%   2)parameters that may be changed by people interested in the physical layer.%   These parameters are located below in the current file.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% constants definitionlambda = 0.15;            % wavelength (m)TTIdur = 0.002;           % TTI duration (s)samples_per_fade = 100;   % Minimum samples per wavelengthmax_samples_per_TTI = 10; % Maximum samples per TTIPTx=38           % Transmission power of 38 dBm GT=17            % Base station antenna gain (in dBi)Linit=137.4      % Linit is the distance loss at 1 km, based on a BS antenna                  % height of 30 m,                  % a UE antenna height of 1.5 m and a carrier frequency of 1950 MHzdistlossexp=3.52 % See Holma e.a. WCDMA for UMTS, section 8.2, p 160Iintra=30        % intra-cell interference in dBm (1 Watt=30 dBm)                 % Based on synchronization channel and non-orthogonalityIinter=-70       % inter-cell interference in dBm %Shadowing parametersshadow_std=8     % standard deviation in dB     d_corr=40        % correlation distance in metersCQIdelayinTTI = 3 % the number of TTI's that is in between the UE measurement and                  % the actual moment of using this information at the Scheduler. HARQcycle = 6     % is the period of the HARQ processes                  % if power(t-HARQcycle) is the channel condition of the                   % first retransmission, than, HARQcycle TTI's later,                   % power(t) is the channel condition at the 1st retransmission;                   % Combining them in a smart way, P_1stRT(t) is the power of                   % both of them together.% initialize backgroundwhitebg('white');       %[1 1 1]    % default number of lines per answerlines = 1;% menu for choosing the multipathmulti = menu('Which environment would you like to test?','Single Rayleigh Channel',...    'Single Rayleigh Channel w/o correlation on fading coefficients','Case 1','Case 2','Case 3','Indoor Office A',...    'Indoor Office B','Pedestrian A', 'Pedestrian B', 'Vehicular A', 'Vehicular B', 'Rural Area'...    ,'Typical Urban', 'Hilly Terrain');    % adjust environment value                   multi=multi-5;% menu for choosing the velocity regarding the environment in testswitch multi    case -4 % Rayleigh 1 tap with correlation        promptvelocity   = 'Velocity (km/h) of the UEs';        defvelocity      = '3';        env      = 'Ray_corr';            case -3 % Rayleigh 1 tap without correlation        promptvelocity   = 'Velocity (km/h) of the UEs';        defvelocity      = '10';        env      = 'Ray_no_c';                   case -2 % Case 1        promptvelocity   = 'Velocity of the UEs (default = 3km/h)';        defvelocity      = '3';        env      = 'Case_1';                   case -1 % Case 2        promptvelocity   = 'Velocity of the UEs (default = 3km/h)';        defvelocity      = '3';        env      = 'Case_2';                   case 0 % Case 3        promptvelocity   = 'Velocity of the UEs (default = 120km/h)';        defvelocity      = '120';        env      = 'Case_3';                   case 1 % Indoor A        promptvelocity   = 'Velocity of the UEs (1 to 10 km/h)';        defvelocity      = '3';        env      = 'Ind_A';               case 2 % Indoor B        promptvelocity   = 'Velocity of the UEs (1 to 10 km/h)';        defvelocity      = '3';        env      = 'Ind_B';               case 3 % Pedestrian A        promptvelocity   = 'Velocity of the UEs (3 to 15 km/h)';        defvelocity      = '3';        env      = 'Ped_A';              case 4 % Pedestrian B        promptvelocity   = 'Velocity of the UEs (3 to 15 km/h)';        defvelocity      = '3';        env      = 'Ped_B';              case 5 % Vehicular A        promptvelocity   = 'Velocity of the UEs (50 to 500 km/h)';    %the model assumes that velocity>50 km/h        defvelocity      = '120';        env      = 'Veh_A';              case 6 % Vehicular B        promptvelocity   = 'Velocity of the UEs (50 to 500 km/h)';        defvelocity      = '120';        env      = 'Veh_B';              case 7 % Rural        promptvelocity   = 'Velocity of the UEs (120 to 250 km/h)';        defvelocity      = '120';        env      = 'Rural';              case 8 % Typical Urban        promptvelocity   = 'Velocity of the UEs (3 to 120 km/h)';        defvelocity      = '50';        env      = 'Urban';              case 9 % Hilly        promptvelocity   = 'Velocity of the UEs (90 to 150 km/h)';        defvelocity      = '120';        env      = 'Hilly';           end    % Distance loss specification, shadowing specificationspromptvelocityhlp=char(strcat(promptvelocity,{' (recommendated value for the '},env,{' environment)'}));prompt = {promptvelocityhlp,'Distance (m) between Node B and the UE','Trace length (s)','Number of users'};title  = 'Remaining specifications';def    = {defvelocity,'500','200','1'};        answer = inputdlg(prompt,title,lines,def);vel_kmh    = str2num(char(answer(1)));if (isempty(vel_kmh)) vel_kmh=str2num(defvelocity); endif (vel_kmh<=0) vel_kmh=0.1; end % Protection against vel_kmh = 0% From km/h to m/svel_mps = vel_kmh/3.6;distanceUEBS = str2num(char(answer(2)));         %distance in metresif isempty(distanceUEBS) distanceUEBS = 500; end    distloss=Linit+10*distlossexp*log10(distanceUEBS/1000); % This is a scalar constant                                                        % It remains constant in time                                                         % It may be different for each UE    dur = str2num(char(answer(3)));            % duration of the trace in secondsif isempty(dur) dur = 200; endnr_users = str2num(char(answer(4)));if isempty(nr_users) nr_users = 1; end numTTItrace = 2*round(dur/TTIdur/2)            % number of TTI's that fit in dur(ation)numTTI=numTTItrace+2*HARQcycle+CQIdelayinTTI   % For example: numTTI=numTTItrace+15    (2*6+3=15) % Cleaning upcloseclear answer def lines title prompt%Display the choices made, to the screen disp('You have made the following choices:')disp('trace length (numTTItrace):'),numTTItracedisp('velocity (km/h):        '),vel_kmhdisp('distance (m) from BS (Node B):  '),distanceUEBSdisp('which environment (nr,name):   '),multi+5,env

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -