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
alex037yang
OpenXG-RAN
Commits
41fd001b
Commit
41fd001b
authored
Nov 24, 2016
by
Xiwen JIANG
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete redundant code in beamforming.c
parent
f8aea618
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
59 deletions
+29
-59
openair1/PHY/MODULATION/beamforming.c
openair1/PHY/MODULATION/beamforming.c
+14
-49
openair1/PHY/MODULATION/defs.h
openair1/PHY/MODULATION/defs.h
+4
-2
openair1/PHY/MODULATION/ofdm_mod.c
openair1/PHY/MODULATION/ofdm_mod.c
+5
-6
openair1/SIMULATION/LTE_PHY/dlsim.c
openair1/SIMULATION/LTE_PHY/dlsim.c
+6
-2
No files found.
openair1/PHY/MODULATION/beamforming.c
View file @
41fd001b
...
...
@@ -51,26 +51,27 @@ int beam_precoding(int32_t **txdataF,
LTE_DL_FRAME_PARMS
*
frame_parms
,
int32_t
***
beam_weights
,
int
slot
,
int
symbol
)
int
symbol
,
int
aa
)
{
uint8_t
p
,
aa
;
uint8_t
p
;
uint16_t
re
=
0
;
int
slot_offset_F
;
slot_offset_F
=
slot
*
(
frame_parms
->
ofdm_symbol_size
)
*
((
frame_parms
->
Ncp
==
1
)
?
6
:
7
);
// clear txdata_BF[aa][re] for each call of ue_spec_beamforming
for
(
aa
=
0
;
aa
<
frame_parms
->
nb_antennas_tx
;
aa
++
)
memset
(
txdataF_BF
[
aa
],
0
,
sizeof
(
int32_t
)
*
(
frame_parms
->
ofdm_symbol_size
));
memset
(
txdataF_BF
[
aa
],
0
,
sizeof
(
int32_t
)
*
(
frame_parms
->
ofdm_symbol_size
));
for
(
re
=
0
;
re
<
frame_parms
->
ofdm_symbol_size
;
re
++
)
{
for
(
p
=
0
;
p
<
2
;
p
++
)
{
if
(
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
]
!=
0
)
{
for
(
aa
=
0
;
aa
<
frame_parms
->
nb_antennas_tx
;
aa
++
)
{
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
0
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
0
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
0
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
0
]
-=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
1
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
1
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
1
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
0
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
1
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
1
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
1
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
0
])
>>
15
);
for
(
p
=
0
;
p
<
14
;
p
++
)
{
//if (p==0 || p==1 || p==5 || p>7)
// mult_cpx_conj_vector((int16_t*)txdataF[p], (int16_t*)beam_weights[p][aa], (int16_t*)txdataF_BF[aa], frame_parms->ofdm_symbol_size, 15);
for
(
re
=
0
;
re
<
frame_parms
->
ofdm_symbol_size
;
re
++
)
{
if
((
p
==
0
||
p
==
1
||
p
==
5
||
p
>=
7
)
&&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
]
!=
0
)
{
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
0
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
0
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
0
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
0
]
-=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
1
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
1
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
1
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
0
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
1
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
1
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
1
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
0
])
>>
15
);
/*
printf("beamforming.c:txdataF[%d][%d]=%d+j%d, beam_weights[%d][%d][%d]=%d+j%d,txdata_BF[%d][%d]=%d+j%d\n",
...
...
@@ -83,44 +84,8 @@ int beam_precoding(int32_t **txdataF,
((int16_t*)&txdataF_BF[aa][re])[0],
((int16_t*)&txdataF_BF[aa][re])[1]);
*/
}
}
}
if
(
txdataF
[
5
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
]
!=
0
)
{
//that means this RE is actually using TM7
for
(
aa
=
0
;
aa
<
frame_parms
->
nb_antennas_tx
;
aa
++
)
{
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
0
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
5
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
0
]
*
((
int16_t
*
)
&
beam_weights
[
5
][
aa
][
re
])[
0
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
0
]
-=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
5
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
1
]
*
((
int16_t
*
)
&
beam_weights
[
5
][
aa
][
re
])[
1
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
1
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
5
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
0
]
*
((
int16_t
*
)
&
beam_weights
[
5
][
aa
][
re
])[
1
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
1
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
5
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
1
]
*
((
int16_t
*
)
&
beam_weights
[
5
][
aa
][
re
])[
0
])
>>
15
);
/* printf("beamforming.c:txdata[5][%d]=%d+j%d, beam_weights[5][%d][%d]=%d+j%d,txdata_BF[%d][%d]=%d+j%d\n",
slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re,
((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0],
((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1],
aa,re,
((int16_t*)&beam_weights[5][aa][re])[0],
((int16_t*)&beam_weights[5][aa][re])[1],
aa,re,
((int16_t*)&txdataF_BF[aa][re])[0],
((int16_t*)&txdataF_BF[aa][re])[1]); */
}
}
if
(
txdataF
[
7
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
]
!=
0
)
{
//that means this RE is actually using TM8-10
for
(
p
=
7
;
p
<
15
;
p
++
)
{
if
(
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
]
!=
0
)
{
//that means this RE is actually allocated
for
(
aa
=
0
;
aa
<
frame_parms
->
nb_antennas_tx
;
aa
++
)
{
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
0
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
0
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
0
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
0
]
-=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
1
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
1
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
1
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
0
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
1
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
1
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
1
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
0
])
>>
15
);
}
}
}
}
}
return
0
;
return
0
;
}
openair1/PHY/MODULATION/defs.h
View file @
41fd001b
...
...
@@ -103,13 +103,15 @@ after beamforming
@param beam_weights Beamforming weights applied on each
antenna element and each carrier
@param slot Slot number
@param symbol Symbol index on which to act*/
@param symbol Symbol index on which to act
@param aa physical antenna index*/
int
beam_precoding
(
int32_t
**
txdataF
,
int32_t
**
txdataF_BF
,
LTE_DL_FRAME_PARMS
*
frame_parms
,
int32_t
***
beam_weights
,
int
slot
,
int
symbol
);
int
symbol
,
int
aa
);
int
f_read
(
char
*
calibF_fname
,
int
nb_ant
,
int
nb_freq
,
int32_t
**
tdd_calib_coeffs
);
...
...
openair1/PHY/MODULATION/ofdm_mod.c
View file @
41fd001b
...
...
@@ -298,14 +298,13 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne
//printf("Thread %d starting ... aa %d (%llu)\n",omp_get_thread_num(),aa,rdtsc());
for
(
l
=
0
;
l
<
frame_parms
->
symbols_per_tti
>>
1
;
l
++
)
{
//printf("do_OFDM_mod_l, slot=%d, l=%d, NUMBER_OF_OFDM_CARRIERS=%d,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES=%d\n",next_slot, l,NUMBER_OF_OFDM_CARRIERS,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING
,
1
);
beam_precoding
(
txdataF
,
txdataF_BF
,
frame_parms
,
eNB_common_vars
->
beam_weights
[
eNB_id
],
next_slot
,
l
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING
,
0
);
for
(
aa
=
0
;
aa
<
frame_parms
->
nb_antennas_tx
;
aa
++
)
{
//printf("do_OFDM_mod_l, slot=%d, l=%d, NUMBER_OF_OFDM_CARRIERS=%d,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES=%d\n",next_slot, l,NUMBER_OF_OFDM_CARRIERS,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING
,
1
);
beam_precoding
(
txdataF
,
txdataF_BF
,
frame_parms
,
eNB_common_vars
->
beam_weights
[
eNB_id
],
next_slot
,
l
,
aa
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING
,
0
);
//PMCH case not implemented...
if
(
frame_parms
->
Ncp
==
1
)
...
...
openair1/SIMULATION/LTE_PHY/dlsim.c
View file @
41fd001b
...
...
@@ -1281,8 +1281,6 @@ int main(int argc, char **argv)
uint8_t
extended_prefix_flag
=
0
,
transmission_mode
=
1
,
n_tx_port
=
1
,
n_tx_phy
=
1
,
n_rx
=
2
;
uint16_t
Nid_cell
=
0
;
int32_t
**
cell_spec_bf_weights
;
int
eNB_id
=
0
;
unsigned
char
mcs1
=
0
,
mcs2
=
0
,
mcs_i
=
0
,
dual_stream_UE
=
0
,
awgn_flag
=
0
,
round
;
unsigned
char
i_mod
=
2
;
...
...
@@ -1808,6 +1806,12 @@ int main(int argc, char **argv)
osf
,
perfect_ce
);
if
((
transmission_mode
==
1
)
||
(
transmission_mode
==
7
))
{
for
(
aa
=
0
;
aa
<
eNB
->
frame_parms
.
nb_antennas_tx
;
aa
++
)
for
(
re
=
0
;
re
<
eNB
->
frame_parms
.
ofdm_symbol_size
;
re
++
)
eNB
->
common_vars
.
beam_weights
[
0
][
0
][
aa
][
re
]
=
0x00007fff
/
eNB
->
frame_parms
.
nb_antennas_tx
;
}
eNB
->
mac_enabled
=
1
;
if
(
two_thread_flag
==
0
)
{
eNB
->
te
=
dlsch_encoding
;
...
...
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