Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zzha zzha
OpenXG-RAN
Commits
6091452d
Commit
6091452d
authored
Aug 09, 2021
by
Laurent THOMAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix remaining usage of deleted type struct complex
parent
387223ee
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
65 additions
and
67 deletions
+65
-67
openair1/SIMULATION/LTE_PHY/dlsim.c
openair1/SIMULATION/LTE_PHY/dlsim.c
+8
-8
openair1/SIMULATION/LTE_PHY/ulsim.c
openair1/SIMULATION/LTE_PHY/ulsim.c
+2
-2
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+0
-1
openair1/SIMULATION/NR_PHY/prachsim.c
openair1/SIMULATION/NR_PHY/prachsim.c
+1
-1
openair1/SIMULATION/NR_PHY/ulsim.c
openair1/SIMULATION/NR_PHY/ulsim.c
+1
-2
openair1/SIMULATION/TOOLS/abstraction.c
openair1/SIMULATION/TOOLS/abstraction.c
+40
-40
openair1/SIMULATION/TOOLS/multipath_channel.c
openair1/SIMULATION/TOOLS/multipath_channel.c
+13
-13
No files found.
openair1/SIMULATION/LTE_PHY/dlsim.c
View file @
6091452d
...
...
@@ -200,8 +200,8 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
for
(
u
=
0
;
u
<
2
*
ru
->
frame_parms
->
N_RB_DL
;
u
++
)
{
for
(
aarx
=
0
;
aarx
<
eNB2UE
[
0
]
->
nb_rx
;
aarx
++
)
{
for
(
aatx
=
0
;
aatx
<
eNB2UE
[
0
]
->
nb_tx
;
aatx
++
)
{
channelx
=
eNB2UE
[
0
]
->
chF
[
aarx
+
(
aatx
*
eNB2UE
[
0
]
->
nb_rx
)][
u
].
x
;
channely
=
eNB2UE
[
0
]
->
chF
[
aarx
+
(
aatx
*
eNB2UE
[
0
]
->
nb_rx
)][
u
].
y
;
channelx
=
eNB2UE
[
0
]
->
chF
[
aarx
+
(
aatx
*
eNB2UE
[
0
]
->
nb_rx
)][
u
].
r
;
channely
=
eNB2UE
[
0
]
->
chF
[
aarx
+
(
aatx
*
eNB2UE
[
0
]
->
nb_rx
)][
u
].
i
;
fprintf
(
csv_fd
,
"%e+i*(%e),"
,
channelx
,
channely
);
}
}
...
...
@@ -213,8 +213,8 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
for
(
u
=
0
;
u
<
2
*
ru
->
frame_parms
->
N_RB_DL
;
u
++
)
{
for
(
aarx
=
0
;
aarx
<
eNB2UE
[
1
]
->
nb_rx
;
aarx
++
)
{
for
(
aatx
=
0
;
aatx
<
eNB2UE
[
1
]
->
nb_tx
;
aatx
++
)
{
channelx
=
eNB2UE
[
1
]
->
chF
[
aarx
+
(
aatx
*
eNB2UE
[
1
]
->
nb_rx
)][
u
].
x
;
channely
=
eNB2UE
[
1
]
->
chF
[
aarx
+
(
aatx
*
eNB2UE
[
1
]
->
nb_rx
)][
u
].
y
;
channelx
=
eNB2UE
[
1
]
->
chF
[
aarx
+
(
aatx
*
eNB2UE
[
1
]
->
nb_rx
)][
u
].
r
;
channely
=
eNB2UE
[
1
]
->
chF
[
aarx
+
(
aatx
*
eNB2UE
[
1
]
->
nb_rx
)][
u
].
i
;
fprintf
(
csv_fd
,
"%e+i*(%e),"
,
channelx
,
channely
);
}
}
...
...
@@ -225,8 +225,8 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
for
(
u
=
0
;
u
<
2
*
ru
->
frame_parms
->
N_RB_DL
;
u
++
)
{
for
(
aarx
=
0
;
aarx
<
eNB2UE
[
2
]
->
nb_rx
;
aarx
++
)
{
for
(
aatx
=
0
;
aatx
<
eNB2UE
[
2
]
->
nb_tx
;
aatx
++
)
{
channelx
=
eNB2UE
[
2
]
->
chF
[
aarx
+
(
aatx
*
eNB2UE
[
2
]
->
nb_rx
)][
u
].
x
;
channely
=
eNB2UE
[
2
]
->
chF
[
aarx
+
(
aatx
*
eNB2UE
[
2
]
->
nb_rx
)][
u
].
y
;
channelx
=
eNB2UE
[
2
]
->
chF
[
aarx
+
(
aatx
*
eNB2UE
[
2
]
->
nb_rx
)][
u
].
r
;
channely
=
eNB2UE
[
2
]
->
chF
[
aarx
+
(
aatx
*
eNB2UE
[
2
]
->
nb_rx
)][
u
].
i
;
fprintf
(
csv_fd
,
"%e+i*(%e),"
,
channelx
,
channely
);
}
}
...
...
@@ -237,8 +237,8 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
for
(
u
=
0
;
u
<
2
*
ru
->
frame_parms
->
N_RB_DL
;
u
++
)
{
for
(
aarx
=
0
;
aarx
<
eNB2UE
[
3
]
->
nb_rx
;
aarx
++
)
{
for
(
aatx
=
0
;
aatx
<
eNB2UE
[
3
]
->
nb_tx
;
aatx
++
)
{
channelx
=
eNB2UE
[
3
]
->
chF
[
aarx
+
(
aatx
*
eNB2UE
[
3
]
->
nb_rx
)][
u
].
x
;
channely
=
eNB2UE
[
3
]
->
chF
[
aarx
+
(
aatx
*
eNB2UE
[
3
]
->
nb_rx
)][
u
].
y
;
channelx
=
eNB2UE
[
3
]
->
chF
[
aarx
+
(
aatx
*
eNB2UE
[
3
]
->
nb_rx
)][
u
].
r
;
channely
=
eNB2UE
[
3
]
->
chF
[
aarx
+
(
aatx
*
eNB2UE
[
3
]
->
nb_rx
)][
u
].
i
;
fprintf
(
csv_fd
,
"%e+i*(%e),"
,
channelx
,
channely
);
}
}
...
...
openair1/SIMULATION/LTE_PHY/ulsim.c
View file @
6091452d
...
...
@@ -1111,8 +1111,8 @@ int main(int argc, char **argv) {
for
(
aarx
=
0
;
aarx
<
UE2eNB
->
nb_rx
;
aarx
++
)
{
for
(
aatx
=
0
;
aatx
<
UE2eNB
->
nb_tx
;
aatx
++
)
{
// abs_channel = (eNB2UE->chF[aarx+(aatx*eNB2UE->nb_rx)][u].x*eNB2UE->chF[aarx+(aatx*eNB2UE->nb_rx)][u].x + eNB2UE->chF[aarx+(aatx*eNB2UE->nb_rx)][u].y*eNB2UE->chF[aarx+(aatx*eNB2UE->nb_rx)][u].y);
channelx
=
UE2eNB
->
chF
[
aarx
+
(
aatx
*
UE2eNB
->
nb_rx
)][
u
].
x
;
channely
=
UE2eNB
->
chF
[
aarx
+
(
aatx
*
UE2eNB
->
nb_rx
)][
u
].
y
;
channelx
=
UE2eNB
->
chF
[
aarx
+
(
aatx
*
UE2eNB
->
nb_rx
)][
u
].
r
;
channely
=
UE2eNB
->
chF
[
aarx
+
(
aatx
*
UE2eNB
->
nb_rx
)][
u
].
i
;
// if(transmission_m==5){
fprintf
(
csv_fdUL
,
"%e+i*(%e),"
,
channelx
,
channely
);
// }
...
...
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
6091452d
...
...
@@ -87,7 +87,6 @@ uint16_t sl_ahead=0;
uint64_t
downlink_frequency
[
MAX_NUM_CCs
][
4
];
THREAD_STRUCT
thread_struct
;
nfapi_ue_release_request_body_t
release_rntis
;
msc_interface_t
msc_interface
;
uint32_t
N_RB_DL
=
106
;
// dummy functions
...
...
openair1/SIMULATION/NR_PHY/prachsim.c
View file @
6091452d
...
...
@@ -216,7 +216,7 @@ int main(int argc, char **argv){
char
c
;
double
sigma2
,
sigma2_dB
=
0
,
SNR
,
snr0
=
-
2
.
0
,
snr1
=
0
.
0
,
ue_speed0
=
0
.
0
,
ue_speed1
=
0
.
0
;
double
**
s_re
,
**
s_im
,
**
r_re
,
**
r_im
,
iqim
=
0
.
0
,
delay_avg
=
0
,
ue_speed
=
0
,
fs
,
bw
;
double
**
s_re
,
**
s_im
,
**
r_re
,
**
r_im
,
iqim
=
0
.
0
,
delay_avg
=
0
,
ue_speed
=
0
,
fs
=
0
,
bw
;
int
i
,
l
,
aa
,
aarx
,
**
txdata
,
trial
,
n_frames
=
1
,
prach_start
,
rx_prach_start
;
//, ntrials=1;
int
N_RB_UL
=
106
,
delay
=
0
,
NCS_config
=
13
,
rootSequenceIndex
=
1
,
threequarter_fs
=
0
,
mu
=
1
,
fd_occasion
=
0
,
loglvl
=
OAILOG_INFO
,
numRA
=
0
,
prachStartSymbol
=
0
;
uint8_t
snr1set
=
0
,
ue_speed1set
=
0
,
transmission_mode
=
1
,
n_tx
=
1
,
n_rx
=
1
,
awgn_flag
=
0
,
msg1_frequencystart
=
0
,
num_prach_fd_occasions
=
1
,
prach_format
=
0
;
...
...
openair1/SIMULATION/NR_PHY/ulsim.c
View file @
6091452d
...
...
@@ -83,7 +83,6 @@ double cpuf;
uint64_t
downlink_frequency
[
MAX_NUM_CCs
][
4
];
THREAD_STRUCT
thread_struct
;
nfapi_ue_release_request_body_t
release_rntis
;
msc_interface_t
msc_interface
;
uint32_t
N_RB_DL
=
106
;
extern
void
fix_scd
(
NR_ServingCellConfig_t
*
scd
);
// forward declaration
...
...
@@ -286,7 +285,7 @@ int main(int argc, char **argv)
int
gNB_id
=
0
;
int
ap
;
int
tx_offset
;
int32_t
txlev
;
int32_t
txlev
=
0
;
int
start_rb
=
0
;
int
UE_id
=
0
;
// [hna] only works for UE_id = 0 because NUMBER_OF_NR_UE_MAX is set to 1 (phy_init_nr_gNB causes segmentation fault)
float
target_error_rate
=
0
.
01
;
...
...
openair1/SIMULATION/TOOLS/abstraction.c
View file @
6091452d
...
...
@@ -111,14 +111,14 @@ int freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples) {
for
(
aarx
=
0
;
aarx
<
desc
->
nb_rx
;
aarx
++
)
{
for
(
aatx
=
0
;
aatx
<
desc
->
nb_tx
;
aatx
++
)
{
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
n_samples
/
2
+
f2
].
x
=
0
.
0
;
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
n_samples
/
2
+
f2
].
y
=
0
.
0
;
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
n_samples
/
2
+
f2
].
r
=
0
.
0
;
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
n_samples
/
2
+
f2
].
i
=
0
.
0
;
for
(
l
=
0
;
l
<
(
int
)
desc
->
nb_taps
;
l
++
)
{
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
n_samples
/
2
+
f2
].
x
+=
(
desc
->
a
[
l
][
aarx
+
(
aatx
*
desc
->
nb_rx
)].
x
*
clut
[
l
]
+
desc
->
a
[
l
][
aarx
+
(
aatx
*
desc
->
nb_rx
)].
y
*
slut
[
l
]);
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
n_samples
/
2
+
f2
].
y
+=
(
-
desc
->
a
[
l
][
aarx
+
(
aatx
*
desc
->
nb_rx
)].
x
*
slut
[
l
]
+
desc
->
a
[
l
][
aarx
+
(
aatx
*
desc
->
nb_rx
)].
y
*
clut
[
l
]);
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
n_samples
/
2
+
f2
].
r
+=
(
desc
->
a
[
l
][
aarx
+
(
aatx
*
desc
->
nb_rx
)].
r
*
clut
[
l
]
+
desc
->
a
[
l
][
aarx
+
(
aatx
*
desc
->
nb_rx
)].
i
*
slut
[
l
]);
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
n_samples
/
2
+
f2
].
i
+=
(
-
desc
->
a
[
l
][
aarx
+
(
aatx
*
desc
->
nb_rx
)].
r
*
slut
[
l
]
+
desc
->
a
[
l
][
aarx
+
(
aatx
*
desc
->
nb_rx
)].
i
*
clut
[
l
]);
}
}
}
...
...
@@ -138,42 +138,42 @@ double compute_pbch_sinr(channel_desc_t *desc,
uint16_t
f
;
uint8_t
aarx
,
aatx
;
double
S
;
struct
complex
S_i1
;
struct
complex
S_i2
;
struct
complex
d
S_i1
;
struct
complex
d
S_i2
;
avg_sinr
=
0
.
0
;
// printf("nb_rb %d\n",nb_rb);
for
(
f
=
(
nb_rb
-
6
);
f
<
(
nb_rb
+
6
);
f
++
)
{
S
=
0
.
0
;
S_i1
.
x
=
0
.
0
;
S_i1
.
y
=
0
.
0
;
S_i2
.
x
=
0
.
0
;
S_i2
.
y
=
0
.
0
;
S_i1
.
r
=
0
.
0
;
S_i1
.
i
=
0
.
0
;
S_i2
.
r
=
0
.
0
;
S_i2
.
i
=
0
.
0
;
for
(
aarx
=
0
;
aarx
<
desc
->
nb_rx
;
aarx
++
)
{
for
(
aatx
=
0
;
aatx
<
desc
->
nb_tx
;
aatx
++
)
{
S
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
*
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
+
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
*
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
);
S
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
*
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
+
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
*
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
);
// printf("%d %d chF[%d] => (%f,%f)\n",aarx,aatx,f,desc->chF[aarx+(aatx*desc->nb_rx)][f].x,desc->chF[aarx+(aatx*desc->nb_rx)][f].y);
if
(
desc_i1
)
{
S_i1
.
x
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
*
desc_i1
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
+
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
*
desc_i1
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
);
S_i1
.
y
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
*
desc_i1
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
-
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
*
desc_i1
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
);
S_i1
.
r
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
*
desc_i1
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
+
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
*
desc_i1
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
);
S_i1
.
i
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
*
desc_i1
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
-
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
*
desc_i1
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
);
}
if
(
desc_i2
)
{
S_i2
.
x
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
*
desc_i2
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
+
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
*
desc_i2
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
);
S_i2
.
y
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
*
desc_i2
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
-
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
*
desc_i2
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
);
S_i2
.
r
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
*
desc_i2
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
+
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
*
desc_i2
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
);
S_i2
.
r
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
*
desc_i2
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
-
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
*
desc_i2
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
);
}
}
}
// printf("snr %f f %d : S %f, S_i1 %f, S_i2 %f\n",snr,f-nb_rb,S,snr_i1*sqrt(S_i1.x*S_i1.x + S_i1.y*S_i1.y),snr_i2*sqrt(S_i2.x*S_i2.x + S_i2.y*S_i2.y));
avg_sinr
+=
(
snr
*
S
/
(
desc
->
nb_tx
+
snr_i1
*
sqrt
(
S_i1
.
x
*
S_i1
.
x
+
S_i1
.
y
*
S_i1
.
y
)
+
snr_i2
*
sqrt
(
S_i2
.
x
*
S_i2
.
x
+
S_i2
.
y
*
S_i2
.
y
)));
avg_sinr
+=
(
snr
*
S
/
(
desc
->
nb_tx
+
snr_i1
*
sqrt
(
S_i1
.
r
*
S_i1
.
r
+
S_i1
.
i
*
S_i1
.
i
)
+
snr_i2
*
sqrt
(
S_i2
.
r
*
S_i2
.
r
+
S_i2
.
i
*
S_i2
.
i
)));
}
// printf("avg_sinr %f (%f,%f,%f)\n",avg_sinr/12.0,snr,snr_i1,snr_i2);
...
...
@@ -191,42 +191,42 @@ double compute_sinr(channel_desc_t *desc,
uint16_t
f
;
uint8_t
aarx
,
aatx
;
double
S
;
struct
complex
S_i1
;
struct
complex
S_i2
;
struct
complex
d
S_i1
;
struct
complex
d
S_i2
;
DevAssert
(
nb_rb
>
0
);
avg_sinr
=
0
.
0
;
// printf("nb_rb %d\n",nb_rb);
for
(
f
=
0
;
f
<
2
*
nb_rb
;
f
++
)
{
S
=
0
.
0
;
S_i1
.
x
=
0
.
0
;
S_i1
.
y
=
0
.
0
;
S_i2
.
x
=
0
.
0
;
S_i2
.
y
=
0
.
0
;
S_i1
.
r
=
0
.
0
;
S_i1
.
i
=
0
.
0
;
S_i2
.
r
=
0
.
0
;
S_i2
.
i
=
0
.
0
;
for
(
aarx
=
0
;
aarx
<
desc
->
nb_rx
;
aarx
++
)
{
for
(
aatx
=
0
;
aatx
<
desc
->
nb_tx
;
aatx
++
)
{
S
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
*
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
+
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
*
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
);
S
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
*
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
+
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
*
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
);
if
(
desc_i1
)
{
S_i1
.
x
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
*
desc_i1
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
+
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
*
desc_i1
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
);
S_i1
.
y
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
*
desc_i1
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
-
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
*
desc_i1
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
);
S_i1
.
r
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
*
desc_i1
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
+
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
*
desc_i1
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
);
S_i1
.
i
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
*
desc_i1
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
-
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
*
desc_i1
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
);
}
if
(
desc_i2
)
{
S_i2
.
x
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
*
desc_i2
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
+
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
*
desc_i2
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
);
S_i2
.
y
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
*
desc_i2
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
-
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
y
*
desc_i2
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
x
);
S_i2
.
r
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
*
desc_i2
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
+
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
*
desc_i2
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
);
S_i2
.
i
+=
(
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
*
desc_i2
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
-
desc
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
i
*
desc_i2
->
chF
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
f
].
r
);
}
}
}
// printf("f %d : S %f, S_i1 %f, S_i2 %f\n",f-nb_rb,snr*S,snr_i1*sqrt(S_i1.x*S_i1.x + S_i1.y*S_i1.y),snr_i2*sqrt(S_i2.x*S_i2.x + S_i2.y*S_i2.y));
avg_sinr
+=
(
snr
*
S
/
(
desc
->
nb_tx
+
snr_i1
*
sqrt
(
S_i1
.
x
*
S_i1
.
x
+
S_i1
.
y
*
S_i1
.
y
)
+
snr_i2
*
sqrt
(
S_i2
.
x
*
S_i2
.
x
+
S_i2
.
y
*
S_i2
.
y
)));
avg_sinr
+=
(
snr
*
S
/
(
desc
->
nb_tx
+
snr_i1
*
sqrt
(
S_i1
.
r
*
S_i1
.
r
+
S_i1
.
i
*
S_i1
.
i
)
+
snr_i2
*
sqrt
(
S_i2
.
r
*
S_i2
.
r
+
S_i2
.
i
*
S_i2
.
i
)));
}
// printf("avg_sinr %f (%f,%f,%f)\n",avg_sinr/12.0,snr,snr_i1,snr_i2);
...
...
openair1/SIMULATION/TOOLS/multipath_channel.c
View file @
6091452d
...
...
@@ -183,32 +183,32 @@ void multipath_channel(channel_desc_t *desc,
for
(
i
=
0
;
i
<
((
int
)
length
-
dd
);
i
++
)
{
for
(
ii
=
0
;
ii
<
desc
->
nb_rx
;
ii
++
)
{
rx_tmp
.
x
=
0
;
rx_tmp
.
y
=
0
;
rx_tmp
.
r
=
0
;
rx_tmp
.
i
=
0
;
for
(
j
=
0
;
j
<
desc
->
nb_tx
;
j
++
)
{
for
(
l
=
0
;
l
<
(
int
)
desc
->
channel_length
;
l
++
)
{
if
((
i
>=
0
)
&&
(
i
-
l
)
>=
0
)
{
tx
.
x
=
tx_sig_re
[
j
][
i
-
l
];
tx
.
y
=
tx_sig_im
[
j
][
i
-
l
];
tx
.
r
=
tx_sig_re
[
j
][
i
-
l
];
tx
.
i
=
tx_sig_im
[
j
][
i
-
l
];
}
else
{
tx
.
x
=
0
;
tx
.
y
=
0
;
tx
.
r
=
0
;
tx
.
i
=
0
;
}
rx_tmp
.
x
+=
(
tx
.
x
*
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
x
)
-
(
tx
.
y
*
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
y
);
rx_tmp
.
y
+=
(
tx
.
y
*
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
x
)
+
(
tx
.
x
*
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
y
);
rx_tmp
.
r
+=
(
tx
.
r
*
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
r
)
-
(
tx
.
i
*
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
i
);
rx_tmp
.
i
+=
(
tx
.
i
*
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
r
)
+
(
tx
.
r
*
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
i
);
if
(
i
==
0
&&
log_channel
==
1
)
{
printf
(
"channel[%d][%d][%d] = %f dB (%e,%e)
\n
"
,
ii
,
j
,
l
,
10
*
log10
(
pow
(
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
x
,
2
.
0
)
+
pow
(
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
y
,
2
.
0
)),
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
x
,
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
y
);
printf
(
"channel[%d][%d][%d] = %f dB (%e,%e)
\n
"
,
ii
,
j
,
l
,
10
*
log10
(
pow
(
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
r
,
2
.
0
)
+
pow
(
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
i
,
2
.
0
)),
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
r
,
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
i
);
}
}
//l
}
// j
rx_sig_re
[
ii
][
i
+
dd
]
=
rx_tmp
.
x
*
path_loss
;
rx_sig_im
[
ii
][
i
+
dd
]
=
rx_tmp
.
y
*
path_loss
;
rx_sig_re
[
ii
][
i
+
dd
]
=
rx_tmp
.
r
*
path_loss
;
rx_sig_im
[
ii
][
i
+
dd
]
=
rx_tmp
.
i
*
path_loss
;
#ifdef DEBUG_CHANNEL
if
((
i
%
32
)
==
0
)
{
printf
(
"rx aa %d: %p %p %f,%f => %e,%e
\n
"
,
ii
,
rx_sig_re
[
ii
],
rx_sig_im
[
ii
],
rx_tmp
.
x
,
rx_tmp
.
y
,
rx_sig_re
[
ii
][
i
-
dd
],
rx_sig_im
[
ii
][
i
-
dd
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment