-
Notifications
You must be signed in to change notification settings - Fork 1
/
LTE_init_get_microscale_fading_SL_trace1.m
112 lines (96 loc) · 5.44 KB
/
LTE_init_get_microscale_fading_SL_trace1.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
function pregenerated_fast_fading = LTE_init_get_microscale_fading_SL_trace1(LTE_config)
% Generate the fading parameters that model the fast (microscale) fading at system level.
% Author: Josep Colom Ikuno, jcolom@nt.tuwien.ac.at.
% (c) 2009/2011 by INTHFT
% www.nt.tuwien.ac.at
%% Config
% Possible Tx modes are:
% 1: Single Antenna
% 2: Transmit Diversity
% 3: Open Loop Spatial Multiplexing
% 4: Closed Loop SM
% Number of antenna ports can either be 2 or 4
% Codebook index specifies the codebook index as of TS.36.211 (for closed loop SM)
% nLayers specifies how many layers (symbols) are going to be transmitted.
% Either 1, 2, 3 or 4
standalone = false;
if standalone
LTE_config.debug_level = 1;
% Initial config (Winner II+)
config.system_bandwidth = 1.4e6;
config.channel_type = 'winner+';
config.nTX = 2;
config.nRX = 2;
config.trace_length_s = 1;
config.UE_speed = 400/3.6; % converted to m/s. High speed ~ uncorrelated
config.parallel_toolbox_installed = true; % change it to false for testing purposes, as if not you will not be able to debug properly
config.feedback_channel_delay = 0;
config.correlated_fading = true;
config.f = 2.1400e+009;
config.TTI_length = 1.0000e-003;
config.tx_mode = 4; % OLSM
winner_config = load('winner_trace_config');
config.trace_params = winner_config.config_trace_params;
config.trace_params.speed = config.UE_speed;
clear winner_config
else
% Initial config (simulator-linked)
config.system_bandwidth = LTE_config.bandwidth;
config.channel_type = LTE_config.channel_model.type;
config.nTX = LTE_config.nTX;
config.nRX = LTE_config.nRX;
config.trace_length_s = LTE_config.channel_model.trace_length;
config.UE_speed = LTE_config.UE_speed; % converted to m/s
config.parallel_toolbox_installed = LTE_config.parallel_toolbox_installed; % change it to false for testing purposes, as if not you will not be able to debug properly
config.feedback_channel_delay = LTE_config.feedback_channel_delay;
config.correlated_fading = LTE_config.channel_model.correlated_fading;
config.f = LTE_config.frequency1;
config.trace_params = LTE_config.trace_params;
config.TTI_length = LTE_config.TTI_length;
config.tx_mode = LTE_config.tx_mode;
config.non_parallel_channel_trace = LTE_config.non_parallel_channel_trace;
% Option for wideband precoding
if LTE_config.tx_mode==4
config.wideband_precoding = LTE_config.wideband_precoding;
end
end
% sigma_n2 = 10^((LTE_config.UE.receiver_noise_figure + LTE_config.UE.thermal_noise_density)/10)/1000; % Receiver noise variance in Watt
% We now have all of the possible precoding combinations stored
precoding_configs = phy_modeling.miscUtils.get_all_precoding_combinations;
% Channel trace for the target and interfering channels
switch config.channel_type
case 'winner+'
channel_factory_H0 = channel_gain_wrappers.winnerChannelFactory1(config.system_bandwidth,config.trace_params,LTE_config.winner_antenna_params);
channel_factory_H1 = channel_gain_wrappers.winnerChannelFactory1(config.system_bandwidth,config.trace_params,LTE_config.winner_antenna_params);
otherwise
channel_factory_H0 = channel_gain_wrappers.pdpChannelFactory(config.system_bandwidth,config.trace_params);
channel_factory_H1 = channel_gain_wrappers.pdpChannelFactory(config.system_bandwidth,config.trace_params);
end
if LTE_config.debug_level>=1
fprintf('Generating %dx%d channel trace of length %3.2fs\n',config.nTX,config.nRX,ceil(config.trace_length_s));
end
H_trace0 = channel_factory_H0.generate_FF_trace(config.trace_length_s/config.TTI_length);
% Interfering channel trace
if LTE_config.debug_level>=1
fprintf('Generating %dx%d interfering channel trace of length %3.2fs\n',config.nTX,config.nRX,ceil(config.trace_length_s));
end
H_trace1 = channel_factory_H1.generate_FF_trace(config.trace_length_s/config.TTI_length);
% Commented from LL vs SL
%H_trace0 = LTE_init_generate_FF_tracev2_LLvsSL(config.system_bandwidth,config.channel_type,config.nTX,config.nRX,config.trace_length_s,config.UE_speed,'UEchannel');
%H_trace1 = LTE_init_generate_FF_tracev2_LLvsSL(config.system_bandwidth,config.channel_type,config.nTX,config.nRX,config.trace_length_s,config.UE_speed,'interferers');
%% Channel normalization
% Note: each MIMO channel is normalized to a mean power of one
H_trace_normalized = H_trace0.H_RB_samples;
H_trace_interf_normalized = H_trace1.H_RB_samples;
% Free up memory
clear H_trace0;
clear H_trace1;
switch LTE_config.trace_version
case 'v1'
% v1 trace
pregenerated_fast_fading = phy_modeling.channelTraceFactory_v1.generate_channel_trace(config,precoding_configs,H_trace_normalized,H_trace_interf_normalized);
otherwise
% v2 trace
pregenerated_fast_fading = phy_modeling.channelTraceFactory_v2.generate_channel_trace(config,precoding_configs,H_trace_normalized,H_trace_interf_normalized);
end
end