Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bin He
openairinterface5G
Commits
fd8cf776
Commit
fd8cf776
authored
Jan 27, 2021
by
Khodr Saaifan
Committed by
Thomas Schlichter
Feb 01, 2021
Browse files
Modify and fix nr_dlsim to support 4*4 MIMO with 1 layer
parent
e4370cc3
Changes
2
Hide whitespace changes
Inline
Side-by-side
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
View file @
fd8cf776
...
...
@@ -414,10 +414,10 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
///Layer Precoding and Antenna port mapping
// tx_layers 1-8 are mapped on antenna ports 1000-1007
uint8_t
pmi
=
6
;
uint8_t
pmi
=
4
;
//hard coded, should be changed later from the upper layer
for
(
int
ap
=
0
;
ap
<
frame_parms
->
nb_antennas_tx
;
ap
++
)
{
char
*
W_prec
=
nr_W_1l_4p
[
pmi
][
ap
];
//
nr_W_1l_4p, nr_W_2l_2p, nr_W_2l_4p, nr_W_3l_4p, and nr_W_4l_4p
char
*
W_prec
=
nr_W_1l_4p
[
pmi
][
ap
];
//
Hard coded, should be changed later from the upper layer
for
(
int
l
=
rel15
->
StartSymbolIndex
;
l
<
rel15
->
StartSymbolIndex
+
rel15
->
NrOfSymbols
;
l
++
)
{
uint16_t
k
=
start_sc
;
...
...
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
fd8cf776
...
...
@@ -393,7 +393,7 @@ int main(int argc, char **argv)
case
'y'
:
n_tx
=
atoi
(
optarg
);
if
((
n_tx
==
0
)
||
(
n_tx
>
2
))
{
if
((
n_tx
==
0
)
||
(
n_tx
>
4
))
{
//extend gNB to support n_tx = 4
printf
(
"Unsupported number of tx antennas %d
\n
"
,
n_tx
);
exit
(
-
1
);
}
...
...
@@ -403,7 +403,7 @@ int main(int argc, char **argv)
case
'z'
:
n_rx
=
atoi
(
optarg
);
if
((
n_rx
==
0
)
||
(
n_rx
>
2
))
{
if
((
n_rx
==
0
)
||
(
n_rx
>
4
))
{
//extend UE to support n_tx = 4
printf
(
"Unsupported number of rx antennas %d
\n
"
,
n_rx
);
exit
(
-
1
);
}
...
...
@@ -921,9 +921,9 @@ int main(int argc, char **argv)
int
txdataF_offset
=
(
slot
%
2
)
*
frame_parms
->
samples_per_slot_wCP
;
if
(
n_trials
==
1
)
{
LOG_M
(
"txsigF0.m"
,
"txsF0"
,
&
gNB
->
common_vars
.
txdataF
[
0
][
txdataF_offset
],
frame_parms
->
samples_per_slot_wCP
,
1
,
1
);
LOG_M
(
"txsigF0.m"
,
"txsF0
=
"
,
&
gNB
->
common_vars
.
txdataF
[
0
][
txdataF_offset
+
2
*
frame_parms
->
ofdm_symbol_size
],
frame_parms
->
ofdm_symbol_size
,
1
,
1
);
if
(
gNB
->
frame_parms
.
nb_antennas_tx
>
1
)
LOG_M
(
"txsigF1.m"
,
"txsF1"
,
&
gNB
->
common_vars
.
txdataF
[
1
][
txdataF_offset
],
frame_parms
->
samples_per_slot_wCP
,
1
,
1
);
LOG_M
(
"txsigF1.m"
,
"txsF1
=
"
,
&
gNB
->
common_vars
.
txdataF
[
1
][
txdataF_offset
+
2
*
frame_parms
->
ofdm_symbol_size
],
frame_parms
->
ofdm_symbol_size
,
1
,
1
);
}
int
tx_offset
=
frame_parms
->
get_samples_slot_timestamp
(
slot
,
frame_parms
,
0
);
if
(
n_trials
==
1
)
printf
(
"tx_offset %d, txdataF_offset %d
\n
"
,
tx_offset
,
txdataF_offset
);
...
...
@@ -947,9 +947,11 @@ int main(int argc, char **argv)
}
if
(
n_trials
==
1
)
{
LOG_M
(
"txsig0.m"
,
"txs0"
,
&
txdata
[
0
][
tx_offset
],
frame_parms
->
get_samples_slot_timestamp
(
slot
,
frame_parms
,
0
),
1
,
1
);
if
(
gNB
->
frame_parms
.
nb_antennas_tx
>
1
)
LOG_M
(
"txsig1.m"
,
"txs1"
,
&
txdata
[
1
][
tx_offset
],
frame_parms
->
get_samples_slot_timestamp
(
slot
,
frame_parms
,
0
),
1
,
1
);
char
filename
[
100
];
//LOG_M
for
(
aa
=
0
;
aa
<
n_tx
;
aa
++
)
{
sprintf
(
filename
,
"txsig%d.m"
,
aa
);
//LOG_M
LOG_M
(
filename
,
"txs"
,
&
txdata
[
aa
][
tx_offset
+
frame_parms
->
ofdm_symbol_size
+
frame_parms
->
nb_prefix_samples0
],
6
*
(
frame_parms
->
ofdm_symbol_size
+
frame_parms
->
nb_prefix_samples
),
1
,
1
);
}
}
if
(
output_fd
)
{
printf
(
"writing txdata to binary file
\n
"
);
...
...
@@ -966,7 +968,6 @@ int main(int argc, char **argv)
if
(
n_trials
==
1
)
printf
(
"txlev[%d] = %d (%f dB) txlev_sum %d
\n
"
,
aa
,
txlev
[
aa
],
10
*
log10
((
double
)
txlev
[
aa
]),
txlev_sum
);
}
// if (n_trials==1) printf("txlev %d (%f)\n",txlev,10*log10((double)txlev));
for
(
i
=
(
frame_parms
->
get_samples_slot_timestamp
(
slot
,
frame_parms
,
0
));
i
<
(
frame_parms
->
get_samples_slot_timestamp
(
slot
+
1
,
frame_parms
,
0
));
...
...
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