📄 geometry2tgncorrelation.m
字号:
% Geometry2TGnCorrelation%% User interface to the definition of the correlation matrices% of the MIMO radio channel model described in IEEE 802 document% 11-03/940r0. The user is first prompted for%% * The selected model (A to F)% * The transmission direction (up-/down-link)%% In a second stage, for both BS and MS, the user is prompted for%% * The number of elements% * The spacing between elements (Uniform Linear Array is assumed)%%% STANDARD DISCLAIMER%% The Computer Science Institute of the University of Namur (hereafter% "FUNDP-INFO") is furnishing this item "as is". FUNDP-INFO does not% provide any warranty of the item whatsoever, whether express,% implied, or statutory, including, but not limited to, any warranty% of merchantability or fitness for a particular purpose or any% warranty that the contents of the item will be error-free.%% In no respect shall FUNDP-INFO incur any liability for any damages,% including, but not limited to, direct, indirect, special, or% consequential damages arising out of, resulting from, or any way% connected to the use of the item, whether or not based upon% warranty, contract, tort, or otherwise; whether or not injury was% sustained by persons or property or otherwise; and whether or not% loss was sustained from, or arose out of, the results of, the% item, or any services that may be provided by FUNDP-INFO.%% (c) Laurent Schumacher, FUNDP-INFO - November 2003clear all;close all;%% Interactive dialog%% TGn scenariostring = sprintf('\n');disp(string);TGnScenario = ['A','B','C','D','E','F'];UserScenario = 'Z';while (isempty(find(UserScenario==TGnScenario))) UserScenario = input('TGn scenario (A to F)? ','s');end;% Downlink or uplinkstring = sprintf('\n');disp(string);Downlink = -1;while ((Downlink ~= 0) & (Downlink ~=1)) Downlink = input('Downlink (Yes = 1, no = 0)? ');end;% Configuration of BSstring = sprintf('\n*** BS ***\n');disp(string);M = 0;while (M <1) M = input('Number of antenna elements? ');end;if (M>1) SpacingBS = 0; while (SpacingBS <= 0) SpacingBS = input('Normalised spacing between elements (in wavelengths)? '); end;end;% Configuration of MSstring = sprintf('\n*** MS ***\n');disp(string);N = 0;while (N <1) N = input('Number of antenna elements? ');end;if (N>1) SpacingMS = 0; while (SpacingMS <= 0) SpacingMS = input('Normalised spacing between elements (in wavelengths)? '); end;end;%% Description of scenarios%switch UserScenariocase 'A' % Flat fading with 0 ns rms delay spread (one tap at 0 ns delay model) PDP_dB = [0; % Average power [dB] 0]; % Relative delay (ns) % Power roll-off coefficients Power_per_angle_dB = 0; % Tx AoD_Tx_deg = 45; AS_Tx_deg = 40; Type_Tx = 3; % Rx AoA_Rx_deg = 45; AS_Rx_deg = 40; Type_Rx = 3;case 'B' % Typical residential environment, LOS conditions, 15 ns rms delay spread, and 10 dB Ricean K-factor at first delay PDP_dB = [0 -5.4287 -2.5162 -5.8905 -9.1603 -12.5105 -15.6126 -18.7147 -21.8168; % Average power [dB] 0 10e-9 20e-9 30e-9 40e-9 50e-9 60e-9 70e-9 80e-9 ]; % Relative delay (ns) % Power roll-off coefficients Power_per_angle_dB = [ 0 -5.4287 -10.8574 -16.2860 -21.7147 -Inf -Inf -Inf -Inf; -Inf -Inf -3.2042 -6.3063 -9.4084 -12.5105 -15.6126 -18.7147 -21.8168]; % Tx AoD_Tx_deg = [225.1084.*ones(1,5) -Inf.*ones(1,4); -Inf.*ones(1,2) 106.5545.*ones(1,7)]; AS_Tx_deg = [14.4490.*ones(1,5) -Inf.*ones(1,4); -Inf.*ones(1,2) 25.4311.*ones(1,7)]; Type_Tx = 3.*ones(1, size(AoD_Tx_deg, 2)); % Rx AoA_Rx_deg = [4.3943.*ones(1,5) -Inf.*ones(1,4); -Inf.*ones(1,2) 118.4327.*ones(1,7)]; AS_Rx_deg = [14.4699.*ones(1,5) -Inf.*ones(1,4); -Inf.*ones(1,2) 25.2566.*ones(1,7)]; Type_Rx = 3.*ones(1, size(AoA_Rx_deg, 2));case 'C' % Typical residential or small office environment, LOS/NLOS conditions, 30 ns rms delay spread, and 3 dB Ricean K-factor at the first delay PDP_dB = [0 -2.1715 -4.3429 -6.5144 -8.6859 -10.8574 -4.3899 -6.5614 -8.7329 -10.9043 -13.7147 -15.8862 -18.0577 -20.2291; % Average power [dB] 0 10e-9 20e-9 30e-9 40e-9 50e-9 60e-9 70e-9 80e-9 90e-9 110e-9 140e-9 170e-9 200e-9]; % Relative delay (ns) % Power roll-off coefficients Power_per_angle_dB = [ 0 -2.1715 -4.3429 -6.5144 -8.6859 -10.8574 -13.0288 -15.2003 -17.3718 -19.5433 -Inf -Inf -Inf -Inf; -Inf -Inf -Inf -Inf -Inf -Inf -5.0288 -7.2003 -9.3718 -11.5433 -13.7147 -15.8862 -18.0577 -20.2291]; % Tx AoD_Tx_deg = [13.5312.*ones(1,10) -Inf.*ones(1,4); -Inf.*ones(1,6) 56.4329.*ones(1,8)]; AS_Tx_deg = [24.7897.*ones(1,10) -Inf.*ones(1,4); -Inf.*ones(1,6) 22.5729.*ones(1,8)]; Type_Tx = 3.*ones(1, size(AoD_Tx_deg, 2)); % Rx AoA_Rx_deg = [290.3715.*ones(1,10) -Inf.*ones(1,4); -Inf.*ones(1,6) 332.3754.*ones(1,8)]; AS_Rx_deg = [24.6949.*ones(1,10) -Inf.*ones(1,4); -Inf.*ones(1,6) 22.4530.*ones(1,8)]; Type_Rx = 3.*ones(1, size(AoA_Rx_deg, 2));case 'D' % Medbo model A - Typical office environment, NLOS conditions, and 50 ns rms delay spread PDP_dB = [0 -0.9 -1.7 -2.6 -3.5 -4.3 -5.2 -6.1 -6.9 -7.8 -4.7 -7.3 -9.9 -12.5 -13.7 -18 -22.4 -26.7; % Average power [dB] 0 10e-9 20e-9 30e-9 40e-9 50e-9 60e-9 70e-9 80e-9 90e-9 110e-9 140e-9 170e-9 200e-9 240e-9 290e-9 340e-9 390e-9]; % Relative delay (ns) % Power roll-off coefficients Power_per_angle_dB = [0 -0.9 -1.7 -2.6 -3.5 -4.3 -5.2 -6.1 -6.9 -7.8 -9.0712046 -11.199064 -13.795428 -16.391791 -19.370991 -23.201722 -Inf -Inf; -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -6.6756386 -9.5728825 -12.175385 -14.777891 -17.435786 -21.992788 -25.580689 -Inf; -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -18.843300 -23.238125 -25.246344 -26.7]; % Tx AoD_Tx_deg = [332.1027.*ones(1,16) -Inf.*ones(1,2); -Inf.*ones(1,10) 49.3840.*ones(1,7) -Inf; -Inf.*ones(1,14) 275.9769.*ones(1,4)]; AS_Tx_deg = [27.4412.*ones(1,16) -Inf.*ones(1,2); -Inf.*ones(1,10) 32.1430.*ones(1,7) -Inf; -Inf.*ones(1,14) 36.8825.*ones(1,4)]; Type_Tx = 3.*ones(1, size(AoD_Tx_deg, 2)); % Rx AoA_Rx_deg = [158.9318.*ones(1,16) -Inf.*ones(1,2); -Inf.*ones(1,10) 320.2865.*ones(1,7) -Inf; -Inf.*ones(1,14) 276.1246.*ones(1,4)]; AS_Rx_deg = [27.7580.*ones(1,16) -Inf.*ones(1,2); -Inf.*ones(1,10) 31.4672.*ones(1,7) -Inf; -Inf.*ones(1,14) 37.4179.*ones(1,4)]; Type_Rx = 3.*ones(1, size(AoA_Rx_deg, 2));case 'E' % Medbo model B - Typical large open space and office environments, NLOS conditions, and 100 ns rms delay spread PDP_dB = [-2.5 -3.0 -3.5 -3.9 0 -1.3 -2.6 -3.9 -3.4 -5.6 -7.7 -9.9 -12.1 -14.3 -15.4 -18.4 -20.7 -24.6; % Average power [dB] 0 10e-9 20e-9 30e-9 50e-9 80e-9 110e-9 140e-9 180e-9 230e-9 280e-9 330e-9 380e-9 430e-9 490e-9 560e-9 640e-9 730e-9]; % Relative delay (ns) % Power roll-off coefficients Power_per_angle_dB = [-2.6 -3 -3.5 -3.9 -4.5644301 -5.6551533 -6.9751533 -8.2951533 -9.8221791 -11.785521 -13.985521 -16.185521 -18.385521 -20.585521 -22.985195 -Inf -Inf -Inf; -Inf -Inf -Inf -Inf -1.8681171 -3.2849115 -4.5733656 -5.8619031 -7.1920408 -9.9304493 -10.343797 -14.353720 -14.767068 -18.776991 -19.982151 -22.446411 -Inf -Inf; -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -7.9044978 -9.6851670 -14.260649 -13.812819 -18.603831 -18.192376 -22.834619 -Inf -Inf -Inf; -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -20.673366 -20.574381 -20.7 -24.6]; % Tx AoD_Tx_deg = [105.6434.*ones(1,15) -Inf.*ones(1,3); -Inf.*ones(1,4) 293.1199.*ones(1,12) -Inf.*ones(1,2); -Inf.*ones(1,8) 61.9720.*ones(1,7) -Inf.*ones(1,3); -Inf.*ones(1,14) 275.7640.*ones(1,4)]; AS_Tx_deg = [36.1176.*ones(1,15) -Inf.*ones(1,3); -Inf.*ones(1,4) 42.5299.*ones(1,12) -Inf.*ones(1,2); -Inf.*ones(1,8) 38.0096.*ones(1,7) -Inf.*ones(1,3); -Inf.*ones(1,14) 38.7026.*ones(1,4)]; Type_Tx = 3.*ones(1, size(AoD_Tx_deg, 2)); % Rx AoA_Rx_deg = [163.7475.*ones(1,15) -Inf.*ones(1,3); -Inf.*ones(1,4) 251.8792.*ones(1,12) -Inf.*ones(1,2); -Inf.*ones(1,8) 80.0240.*ones(1,7) -Inf.*ones(1,3); -Inf.*ones(1,14) 182.0000.*ones(1,4)]; AS_Rx_deg = [35.8768.*ones(1,15) -Inf.*ones(1,3); -Inf.*ones(1,4) 41.6812.*ones(1,12) -Inf.*ones(1,2); -Inf.*ones(1,8) 37.4221.*ones(1,7) -Inf.*ones(1,3); -Inf.*ones(1,14) 40.3685.*ones(1,4)]; Type_Rx = 3.*ones(1, size(AoA_Rx_deg, 2));case 'F' % Medbo model C - Large open space (indoor and outdoor), NLOS conditions, and 150 ns rms delay spread PDP_dB = [-3.3 -3.6 -3.9 -4.2 0 -0.9 -1.7 -2.6 -1.5 -3.0 -4.4 -5.9 -5.3 -7.9 -9.4 -13.2 -16.3 -21.2; % Average power [dB] 0 10e-9 20e-9 30e-9 50e-9 80e-9 110e-9 140e-9 180e-9 230e-9 280e-9 330e-9 400e-9 490e-9 600e-9 730e-9 880e-9 1050e-9]; % Relative delay (ns) % Power roll-off coefficients Power_per_angle_dB = [-3.3 -3.6 -3.9 -4.2 -4.6474101 -5.393095 -6.293095 -7.193095 -8.2370567 -9.5792981 -11.079298 -12.579298 -14.358636 -16.731146 -19.978784 -Inf -Inf -Inf; -Inf -Inf -Inf -Inf -1.8241629 -2.8069486 -3.5527879 -4.4527879 -5.3075764 -7.4275717 -7.0894233 -10.30481 -10.44412 -13.837355 -15.762121 -19.940313 -Inf -Inf; -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -5.7960011 -6.7737346 -10.475827 -9.6416705 -14.107182 -12.752335 -18.503266 -Inf -Inf -Inf; -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -8.8824645 -13.319464 -18.733410 -Inf -Inf -Inf; -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -12.947155 -14.233751 -Inf -Inf; -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -16.3 -21.2]; % Tx AoD_Tx_deg = [56.2139.*ones(1,15) -Inf.*ones(1,3); -Inf.*ones(1,4) 183.7089.*ones(1,12) -Inf.*ones(1,2); -Inf.*ones(1,8) 153.0836.*ones(1,7) -Inf.*ones(1,3); -Inf.*ones(1,12) 112.5317.*ones(1,3) -Inf.*ones(1,3); -Inf.*ones(1,14) 291.0921.*ones(1,2) -Inf.*ones(1,2); -Inf.*ones(1,16) 62.3790.*ones(1,2)]; AS_Tx_deg = [41.6936.*ones(1,15) -Inf.*ones(1,3); -Inf.*ones(1,4) 55.2669.*ones(1,12) -Inf.*ones(1,2); -Inf.*ones(1,8) 47.4867.*ones(1,7) -Inf.*ones(1,3); -Inf.*ones(1,12) 27.2136.*ones(1,3) -Inf.*ones(1,3); -Inf.*ones(1,14) 33.0126.*ones(1,2) -Inf.*ones(1,2); -Inf.*ones(1,16) 38.0482.*ones(1,2)]; Type_Tx = 3.*ones(1, size(AoD_Tx_deg, 2)); % Rx AoA_Rx_deg = [315.1048.*ones(1,15) -Inf.*ones(1,3); -Inf.*ones(1,4) 180.4090.*ones(1,12) -Inf.*ones(1,2); -Inf.*ones(1,8) 74.7062.*ones(1,7) -Inf.*ones(1,3); -Inf.*ones(1,12) 251.5763.*ones(1,3) -Inf.*ones(1,3); -Inf.*ones(1,14) 68.5751.*ones(1,2) -Inf.*ones(1,2); -Inf.*ones(1,16) 246.2344.*ones(1,2)]; AS_Rx_deg = [48.0084.*ones(1,15) -Inf.*ones(1,3); -Inf.*ones(1,4) 55.0823.*ones(1,12) -Inf.*ones(1,2); -Inf.*ones(1,8) 42.0885.*ones(1,7) -Inf.*ones(1,3); -Inf.*ones(1,12) 28.6161.*ones(1,3) -Inf.*ones(1,3); -Inf.*ones(1,14) 30.7745.*ones(1,2) -Inf.*ones(1,2); -Inf.*ones(1,16) 38.2914.*ones(1,2)]; Type_Rx = 3.*ones(1, size(AoA_Rx_deg, 2));otherwise disp('Undefined case. Exiting...'); break;end;%% Information exploitation%% PDP in linear valuesPower_per_angle_linear = 10.^(.1.*Power_per_angle_dB);% (BS,MS) -> (Tx, Rx)if Downlink NumberOfTxAntennas = M; % BS SpacingTx = SpacingBS; NumberOfRxAntennas = N; % MS SpacingRx = SpacingMS;else NumberOfTxAntennas = N; % MS SpacingTx = SpacingMS; NumberOfRxAntennas = M; % BS SpacingRx = SpacingBS;end;%% Computation of the correlation matrices%RTx = zeros(size(PDP_dB,2), NumberOfTxAntennas, NumberOfTxAntennas);RRx = zeros(size(PDP_dB,2), NumberOfRxAntennas, NumberOfRxAntennas);for (ii = 1:size(PDP_dB,2)) index = transpose(find(Power_per_angle_dB(:,ii) > -Inf)); if (~isempty(index)) [temp_RTx, QTx, sTx_deg] = correlation(NumberOfTxAntennas, SpacingTx, ... linspace(0,(NumberOfTxAntennas-1)*SpacingTx, NumberOfTxAntennas), ... size(index, 2), Power_per_angle_linear(index, ii), Type_Tx(ii), ... AoD_Tx_deg(index, ii).', AS_Tx_deg(index, ii).', ... 180.*ones(1, size(index, 2)), 0); [temp_RRx, QRx, sRx_deg] = correlation(NumberOfRxAntennas, SpacingRx, ... linspace(0,(NumberOfRxAntennas-1)*SpacingRx, NumberOfRxAntennas), ... size(index, 2), Power_per_angle_linear(index, ii), Type_Rx(ii), ... AoA_Rx_deg(index, ii).', AS_Rx_deg(index, ii).', ... 180.*ones(1, size(index, 2)), 0); RTx(ii, :, :) = temp_RTx; RRx(ii, :, :) = temp_RRx; end; R(ii,:,:) = kron(squeeze(RTx(ii,:,:)), squeeze(RRx(ii,:,:)));end;%% Display%for (ii = 1:size(PDP_dB,2)) string = sprintf(['\n*** Tap ',num2str(ii),' ***\n']); disp(string); string = sprintf(['RTx\n']); disp(string); disp(num2str(squeeze(RTx(ii,:,:)))); string = sprintf(['\nRRx\n']); disp(string); disp(num2str(squeeze(RRx(ii,:,:)))); string = sprintf(['\nR = kron(RTx,RRx)\n']); disp(string); disp(num2str(squeeze(R(ii,:,:))));end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -