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
promise
OpenXG-RAN
Commits
45cbc8ab
Commit
45cbc8ab
authored
Jun 12, 2016
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed unitary simulators
parent
a2e7ddee
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
175 additions
and
182 deletions
+175
-182
openair1/SIMULATION/LTE_PHY/pbchsim.c
openair1/SIMULATION/LTE_PHY/pbchsim.c
+167
-175
openair1/SIMULATION/LTE_PHY/pdcchsim.c
openair1/SIMULATION/LTE_PHY/pdcchsim.c
+8
-7
No files found.
openair1/SIMULATION/LTE_PHY/pbchsim.c
View file @
45cbc8ab
...
@@ -52,8 +52,10 @@
...
@@ -52,8 +52,10 @@
#include "OCG_vars.h"
#include "OCG_vars.h"
PHY_VARS_eNB
*
PHY_vars_eNB
,
*
PHY_vars_eNB1
,
*
PHY_vars_eNB2
;
#include "unitary_defs.h"
PHY_VARS_UE
*
PHY_vars_UE
;
PHY_VARS_eNB
*
eNB
,
*
eNB1
,
*
eNB2
;
PHY_VARS_UE
*
UE
;
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
...
@@ -123,17 +125,7 @@ int main(int argc, char **argv)
...
@@ -123,17 +125,7 @@ int main(int argc, char **argv)
logInit
();
logInit
();
number_of_cards
=
1
;
number_of_cards
=
1
;
openair_daq_vars
.
rx_rf_mode
=
1
;
/*
rxdataF = (int **)malloc16(2*sizeof(int*));
rxdataF[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdataF[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdata = (int **)malloc16(2*sizeof(int*));
rxdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
*/
while
((
c
=
getopt
(
argc
,
argv
,
"f:hA:pf:g:i:j:n:s:S:t:x:y:z:N:F:GR:O:dP:"
))
!=
-
1
)
{
while
((
c
=
getopt
(
argc
,
argv
,
"f:hA:pf:g:i:j:n:s:S:t:x:y:z:N:F:GR:O:dP:"
))
!=
-
1
)
{
switch
(
c
)
{
switch
(
c
)
{
case
'f'
:
case
'f'
:
...
@@ -340,29 +332,29 @@ int main(int argc, char **argv)
...
@@ -340,29 +332,29 @@ int main(int argc, char **argv)
if
(
transmission_mode
>=
2
)
if
(
transmission_mode
>=
2
)
n_tx
=
2
;
n_tx
=
2
;
lte_param_init
(
n_tx
,
n_rx
,
transmission_mode
,
extended_prefix_flag
,
frame_type
,
Nid_cell
,
N_RB_DL
,
osf
);
lte_param_init
(
n_tx
,
n_rx
,
transmission_mode
,
extended_prefix_flag
,
frame_type
,
Nid_cell
,
3
,
N_RB_DL
,
0
,
osf
,
0
);
PHY_vars_
eNB1
=
malloc
(
sizeof
(
PHY_VARS_eNB
));
eNB1
=
malloc
(
sizeof
(
PHY_VARS_eNB
));
PHY_vars_
eNB2
=
malloc
(
sizeof
(
PHY_VARS_eNB
));
eNB2
=
malloc
(
sizeof
(
PHY_VARS_eNB
));
PHY_vars_UE
->
PHY_
measurements
.
n_adj_cells
=
2
;
UE
->
measurements
.
n_adj_cells
=
2
;
PHY_vars_UE
->
PHY_
measurements
.
adj_cell_id
[
0
]
=
Nid_cell
+
1
;
UE
->
measurements
.
adj_cell_id
[
0
]
=
Nid_cell
+
1
;
PHY_vars_UE
->
PHY_
measurements
.
adj_cell_id
[
1
]
=
Nid_cell
+
2
;
UE
->
measurements
.
adj_cell_id
[
1
]
=
Nid_cell
+
2
;
for
(
i
=
0
;
i
<
3
;
i
++
)
for
(
i
=
0
;
i
<
3
;
i
++
)
lte_gold
(
&
PHY_vars_eNB
->
lte_frame_parms
,
PHY_vars_
UE
->
lte_gold_table
[
i
],
Nid_cell
+
i
);
lte_gold
(
&
eNB
->
frame_parms
,
UE
->
lte_gold_table
[
i
],
Nid_cell
+
i
);
memcpy
((
void
*
)
&
PHY_vars_eNB1
->
lte_frame_parms
,(
void
*
)
&
PHY_vars_eNB
->
lte_
frame_parms
,
sizeof
(
LTE_DL_FRAME_PARMS
));
memcpy
((
void
*
)
&
eNB1
->
frame_parms
,(
void
*
)
&
eNB
->
frame_parms
,
sizeof
(
LTE_DL_FRAME_PARMS
));
PHY_vars_eNB1
->
lte_
frame_parms
.
Nid_cell
=
Nid_cell
+
1
;
eNB1
->
frame_parms
.
Nid_cell
=
Nid_cell
+
1
;
PHY_vars_eNB1
->
lte_
frame_parms
.
nushift
=
(
Nid_cell
+
1
)
%
6
;
eNB1
->
frame_parms
.
nushift
=
(
Nid_cell
+
1
)
%
6
;
PHY_vars_
eNB1
->
Mod_id
=
1
;
eNB1
->
Mod_id
=
1
;
memcpy
((
void
*
)
&
PHY_vars_eNB2
->
lte_frame_parms
,(
void
*
)
&
PHY_vars_eNB
->
lte_
frame_parms
,
sizeof
(
LTE_DL_FRAME_PARMS
));
memcpy
((
void
*
)
&
eNB2
->
frame_parms
,(
void
*
)
&
eNB
->
frame_parms
,
sizeof
(
LTE_DL_FRAME_PARMS
));
PHY_vars_eNB2
->
lte_
frame_parms
.
Nid_cell
=
Nid_cell
+
2
;
eNB2
->
frame_parms
.
Nid_cell
=
Nid_cell
+
2
;
PHY_vars_eNB2
->
lte_
frame_parms
.
nushift
=
(
Nid_cell
+
2
)
%
6
;
eNB2
->
frame_parms
.
nushift
=
(
Nid_cell
+
2
)
%
6
;
PHY_vars_
eNB2
->
Mod_id
=
2
;
eNB2
->
Mod_id
=
2
;
phy_init_lte_eNB
(
PHY_vars_
eNB1
,
0
,
0
,
0
);
phy_init_lte_eNB
(
eNB1
,
0
,
0
,
0
);
phy_init_lte_eNB
(
PHY_vars_
eNB2
,
0
,
0
,
0
);
phy_init_lte_eNB
(
eNB2
,
0
,
0
,
0
);
#ifdef XFORMS
#ifdef XFORMS
fl_initialize
(
&
argc
,
argv
,
NULL
,
0
,
0
);
fl_initialize
(
&
argc
,
argv
,
NULL
,
0
,
0
);
...
@@ -380,13 +372,13 @@ int main(int argc, char **argv)
...
@@ -380,13 +372,13 @@ int main(int argc, char **argv)
printf
(
"SNR0 %f, SNR1 %f
\n
"
,
snr0
,
snr1
);
printf
(
"SNR0 %f, SNR1 %f
\n
"
,
snr0
,
snr1
);
frame_parms
=
&
PHY_vars_eNB
->
lte_
frame_parms
;
frame_parms
=
&
eNB
->
frame_parms
;
txdata
=
PHY_vars_eNB
->
lte_eNB_
common_vars
.
txdata
[
0
];
txdata
=
eNB
->
common_vars
.
txdata
[
0
];
txdata1
=
PHY_vars_eNB1
->
lte_eNB_
common_vars
.
txdata
[
0
];
txdata1
=
eNB1
->
common_vars
.
txdata
[
0
];
txdata2
=
PHY_vars_eNB2
->
lte_eNB_
common_vars
.
txdata
[
0
];
txdata2
=
eNB2
->
common_vars
.
txdata
[
0
];
s_re
=
malloc
(
2
*
sizeof
(
double
*
));
s_re
=
malloc
(
2
*
sizeof
(
double
*
));
...
@@ -407,8 +399,8 @@ int main(int argc, char **argv)
...
@@ -407,8 +399,8 @@ int main(int argc, char **argv)
printf
(
"FFT Size %d, Extended Prefix %d, Samples per subframe %d, Symbols per subframe %d, interf (%d,%d)
\n
"
,
NUMBER_OF_OFDM_CARRIERS
,
printf
(
"FFT Size %d, Extended Prefix %d, Samples per subframe %d, Symbols per subframe %d, interf (%d,%d)
\n
"
,
NUMBER_OF_OFDM_CARRIERS
,
frame_parms
->
Ncp
,
frame_parms
->
samples_per_tti
,
nsymb
,
interf1
,
interf2
);
frame_parms
->
Ncp
,
frame_parms
->
samples_per_tti
,
nsymb
,
interf1
,
interf2
);
printf
(
"
PHY_vars_eNB1->lte_eNB_
common_vars.txdataF[0][0] = %p
\n
"
,
printf
(
"
eNB1->
common_vars.txdataF[0][0] = %p
\n
"
,
PHY_vars_eNB1
->
lte_eNB_
common_vars
.
txdataF
[
0
][
0
]);
eNB1
->
common_vars
.
txdataF
[
0
][
0
]);
DLSCH_alloc_pdu2
.
rah
=
0
;
DLSCH_alloc_pdu2
.
rah
=
0
;
...
@@ -423,31 +415,31 @@ int main(int argc, char **argv)
...
@@ -423,31 +415,31 @@ int main(int argc, char **argv)
// Forget second codeword
// Forget second codeword
DLSCH_alloc_pdu2
.
tpmi
=
(
transmission_mode
==
6
?
5
:
0
)
;
// precoding
DLSCH_alloc_pdu2
.
tpmi
=
(
transmission_mode
==
6
?
5
:
0
)
;
// precoding
eNB2UE
=
new_channel_desc_scm
(
PHY_vars_eNB
->
lte_
frame_parms
.
nb_antennas_tx
,
eNB2UE
=
new_channel_desc_scm
(
eNB
->
frame_parms
.
nb_antennas_tx
,
PHY_vars_UE
->
lte_
frame_parms
.
nb_antennas_rx
,
UE
->
frame_parms
.
nb_antennas_rx
,
channel_model
,
channel_model
,
N_RB2sampling_rate
(
PHY_vars_eNB
->
lte_
frame_parms
.
N_RB_DL
),
N_RB2sampling_rate
(
eNB
->
frame_parms
.
N_RB_DL
),
N_RB2channel_bandwidth
(
PHY_vars_eNB
->
lte_
frame_parms
.
N_RB_DL
),
N_RB2channel_bandwidth
(
eNB
->
frame_parms
.
N_RB_DL
),
0
,
0
,
0
,
0
,
0
);
0
);
if
(
interf1
>-
20
)
if
(
interf1
>-
20
)
eNB2UE1
=
new_channel_desc_scm
(
PHY_vars_eNB
->
lte_
frame_parms
.
nb_antennas_tx
,
eNB2UE1
=
new_channel_desc_scm
(
eNB
->
frame_parms
.
nb_antennas_tx
,
PHY_vars_UE
->
lte_
frame_parms
.
nb_antennas_rx
,
UE
->
frame_parms
.
nb_antennas_rx
,
channel_model
,
channel_model
,
N_RB2sampling_rate
(
PHY_vars_eNB
->
lte_
frame_parms
.
N_RB_DL
),
N_RB2sampling_rate
(
eNB
->
frame_parms
.
N_RB_DL
),
N_RB2channel_bandwidth
(
PHY_vars_eNB
->
lte_
frame_parms
.
N_RB_DL
),
N_RB2channel_bandwidth
(
eNB
->
frame_parms
.
N_RB_DL
),
0
,
0
,
4
,
4
,
0
);
0
);
if
(
interf2
>-
20
)
if
(
interf2
>-
20
)
eNB2UE2
=
new_channel_desc_scm
(
PHY_vars_eNB
->
lte_
frame_parms
.
nb_antennas_tx
,
eNB2UE2
=
new_channel_desc_scm
(
eNB
->
frame_parms
.
nb_antennas_tx
,
PHY_vars_UE
->
lte_
frame_parms
.
nb_antennas_rx
,
UE
->
frame_parms
.
nb_antennas_rx
,
channel_model
,
channel_model
,
N_RB2sampling_rate
(
PHY_vars_eNB
->
lte_
frame_parms
.
N_RB_DL
),
N_RB2sampling_rate
(
eNB
->
frame_parms
.
N_RB_DL
),
N_RB2channel_bandwidth
(
PHY_vars_eNB
->
lte_
frame_parms
.
N_RB_DL
),
N_RB2channel_bandwidth
(
eNB
->
frame_parms
.
N_RB_DL
),
0
,
0
,
8
,
8
,
0
);
0
);
...
@@ -511,47 +503,47 @@ int main(int argc, char **argv)
...
@@ -511,47 +503,47 @@ int main(int argc, char **argv)
pbch_pdu
[
1
]
=
1
;
pbch_pdu
[
1
]
=
1
;
pbch_pdu
[
2
]
=
0
;
pbch_pdu
[
2
]
=
0
;
if
(
PHY_vars_eNB
->
lte_
frame_parms
.
frame_type
==
0
)
{
if
(
eNB
->
frame_parms
.
frame_type
==
0
)
{
generate_pss
(
PHY_vars_eNB
->
lte_eNB_
common_vars
.
txdataF
[
0
],
generate_pss
(
eNB
->
common_vars
.
txdataF
[
0
],
AMP
,
AMP
,
&
PHY_vars_eNB
->
lte_
frame_parms
,
&
eNB
->
frame_parms
,
(
PHY_vars_eNB
->
lte_
frame_parms
.
Ncp
==
0
)
?
6
:
5
,
(
eNB
->
frame_parms
.
Ncp
==
0
)
?
6
:
5
,
0
);
0
);
generate_sss
(
PHY_vars_eNB
->
lte_eNB_
common_vars
.
txdataF
[
0
],
generate_sss
(
eNB
->
common_vars
.
txdataF
[
0
],
AMP
,
AMP
,
&
PHY_vars_eNB
->
lte_
frame_parms
,
&
eNB
->
frame_parms
,
(
PHY_vars_eNB
->
lte_
frame_parms
.
Ncp
==
0
)
?
5
:
4
,
(
eNB
->
frame_parms
.
Ncp
==
0
)
?
5
:
4
,
0
);
0
);
generate_pss
(
PHY_vars_eNB
->
lte_eNB_
common_vars
.
txdataF
[
0
],
generate_pss
(
eNB
->
common_vars
.
txdataF
[
0
],
AMP
,
AMP
,
&
PHY_vars_eNB
->
lte_
frame_parms
,
&
eNB
->
frame_parms
,
(
PHY_vars_eNB
->
lte_
frame_parms
.
Ncp
==
0
)
?
6
:
5
,
(
eNB
->
frame_parms
.
Ncp
==
0
)
?
6
:
5
,
10
);
10
);
generate_sss
(
PHY_vars_eNB
->
lte_eNB_
common_vars
.
txdataF
[
0
],
generate_sss
(
eNB
->
common_vars
.
txdataF
[
0
],
AMP
,
AMP
,
&
PHY_vars_eNB
->
lte_
frame_parms
,
&
eNB
->
frame_parms
,
(
PHY_vars_eNB
->
lte_
frame_parms
.
Ncp
==
0
)
?
5
:
4
,
(
eNB
->
frame_parms
.
Ncp
==
0
)
?
5
:
4
,
10
);
10
);
}
else
{
}
else
{
generate_sss
(
PHY_vars_eNB
->
lte_eNB_
common_vars
.
txdataF
[
0
],
generate_sss
(
eNB
->
common_vars
.
txdataF
[
0
],
AMP
,
AMP
,
&
PHY_vars_eNB
->
lte_
frame_parms
,
&
eNB
->
frame_parms
,
(
PHY_vars_eNB
->
lte_
frame_parms
.
Ncp
==
0
)
?
6
:
5
,
(
eNB
->
frame_parms
.
Ncp
==
0
)
?
6
:
5
,
1
);
1
);
generate_pss
(
PHY_vars_eNB
->
lte_eNB_
common_vars
.
txdataF
[
0
],
generate_pss
(
eNB
->
common_vars
.
txdataF
[
0
],
AMP
,
AMP
,
&
PHY_vars_eNB
->
lte_
frame_parms
,
&
eNB
->
frame_parms
,
2
,
2
,
2
);
2
);
generate_sss
(
PHY_vars_eNB
->
lte_eNB_
common_vars
.
txdataF
[
0
],
generate_sss
(
eNB
->
common_vars
.
txdataF
[
0
],
AMP
,
AMP
,
&
PHY_vars_eNB
->
lte_
frame_parms
,
&
eNB
->
frame_parms
,
(
PHY_vars_eNB
->
lte_
frame_parms
.
Ncp
==
0
)
?
6
:
5
,
(
eNB
->
frame_parms
.
Ncp
==
0
)
?
6
:
5
,
11
);
11
);
generate_pss
(
PHY_vars_eNB
->
lte_eNB_
common_vars
.
txdataF
[
0
],
generate_pss
(
eNB
->
common_vars
.
txdataF
[
0
],
AMP
,
AMP
,
&
PHY_vars_eNB
->
lte_
frame_parms
,
&
eNB
->
frame_parms
,
2
,
2
,
12
);
12
);
...
@@ -570,11 +562,11 @@ int main(int argc, char **argv)
...
@@ -570,11 +562,11 @@ int main(int argc, char **argv)
dci_alloc[1].rnti = 0x1234;
dci_alloc[1].rnti = 0x1234;
*/
*/
printf
(
"Generating PBCH for mode1_flag = %d
\n
"
,
PHY_vars_eNB
->
lte_
frame_parms
.
mode1_flag
);
printf
(
"Generating PBCH for mode1_flag = %d
\n
"
,
eNB
->
frame_parms
.
mode1_flag
);
generate_pilots
(
PHY_vars_
eNB
,
generate_pilots
(
eNB
,
PHY_vars_eNB
->
lte_eNB_
common_vars
.
txdataF
[
0
],
eNB
->
common_vars
.
txdataF
[
0
],
AMP
,
AMP
,
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME
);
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME
);
...
@@ -585,8 +577,8 @@ int main(int argc, char **argv)
...
@@ -585,8 +577,8 @@ int main(int argc, char **argv)
dci_alloc,
dci_alloc,
0,
0,
1024,
1024,
&
PHY_vars_eNB->lte_
frame_parms,
&
eNB->
frame_parms,
PHY_vars_eNB->lte_eNB_
common_vars.txdataF[0],
eNB->
common_vars.txdataF[0],
0);
0);
*/
*/
...
@@ -601,47 +593,47 @@ int main(int argc, char **argv)
...
@@ -601,47 +593,47 @@ int main(int argc, char **argv)
dummybuf
[
1
]
=
dummy1
;
dummybuf
[
1
]
=
dummy1
;
dummybuf
[
2
]
=
dummy2
;
dummybuf
[
2
]
=
dummy2
;
dummybuf
[
3
]
=
dummy3
;
dummybuf
[
3
]
=
dummy3
;
generate_pbch
(
&
PHY_vars_eNB
->
lte_eNB_
pbch
,
generate_pbch
(
&
eNB
->
pbch
,
(
int32_t
**
)
dummybuf
,
(
int32_t
**
)
dummybuf
,
AMP
,
AMP
,
&
PHY_vars_eNB
->
lte_
frame_parms
,
&
eNB
->
frame_parms
,
pbch_pdu
,
pbch_pdu
,
0
);
0
);
}
}
generate_pbch
(
&
PHY_vars_eNB
->
lte_eNB_
pbch
,
generate_pbch
(
&
eNB
->
pbch
,
PHY_vars_eNB
->
lte_eNB_
common_vars
.
txdataF
[
0
],
eNB
->
common_vars
.
txdataF
[
0
],
AMP
,
AMP
,
&
PHY_vars_eNB
->
lte_
frame_parms
,
&
eNB
->
frame_parms
,
pbch_pdu
,
pbch_pdu
,
pbch_phase
);
pbch_phase
);
/*
/*
generate_pbch(&
PHY_vars_eNB->lte_eNB_
pbch,
generate_pbch(&
eNB->
pbch,
PHY_vars_eNB->lte_eNB_
common_vars.txdataF[0],
eNB->
common_vars.txdataF[0],
AMP,
AMP,
&
PHY_vars_eNB->lte_
frame_parms,
&
eNB->
frame_parms,
pbch_pdu,
pbch_pdu,
1);
1);
*/
*/
if
(
interf1
>-
20
)
{
if
(
interf1
>-
20
)
{
/*
/*
generate_pss(
PHY_vars_eNB1->lte_eNB_
common_vars.txdataF[0],
generate_pss(
eNB1->
common_vars.txdataF[0],
AMP,
AMP,
&
PHY_vars_eNB1->lte_
frame_parms,
&
eNB1->
frame_parms,
(
PHY_vars_eNB1->lte_
frame_parms.Ncp==0)?6:5,
(
eNB1->
frame_parms.Ncp==0)?6:5,
0);
0);
*/
*/
generate_pilots
(
PHY_vars_
eNB1
,
generate_pilots
(
eNB1
,
PHY_vars_eNB1
->
lte_eNB_
common_vars
.
txdataF
[
0
],
eNB1
->
common_vars
.
txdataF
[
0
],
AMP
,
AMP
,
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME
);
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME
);
generate_pbch
(
&
PHY_vars_eNB1
->
lte_eNB_
pbch
,
generate_pbch
(
&
eNB1
->
pbch
,
PHY_vars_eNB1
->
lte_eNB_
common_vars
.
txdataF
[
0
],
eNB1
->
common_vars
.
txdataF
[
0
],
AMP
,
AMP
,
&
PHY_vars_eNB1
->
lte_
frame_parms
,
&
eNB1
->
frame_parms
,
pbch_pdu
,
pbch_pdu
,
0
);
0
);
...
@@ -649,38 +641,38 @@ int main(int argc, char **argv)
...
@@ -649,38 +641,38 @@ int main(int argc, char **argv)
if
(
interf2
>-
20
)
{
if
(
interf2
>-
20
)
{
/*
/*
generate_pss(
PHY_vars_eNB2->lte_eNB_
common_vars.txdataF[0],
generate_pss(
eNB2->
common_vars.txdataF[0],
AMP,
AMP,
&
PHY_vars_eNB2->lte_
frame_parms,
&
eNB2->
frame_parms,
(
PHY_vars_eNB2->lte_
frame_parms.Ncp==0)?6:5,
(
eNB2->
frame_parms.Ncp==0)?6:5,
0);
0);
*/
*/
generate_pilots
(
PHY_vars_
eNB2
,
generate_pilots
(
eNB2
,
PHY_vars_eNB2
->
lte_eNB_
common_vars
.
txdataF
[
0
],
eNB2
->
common_vars
.
txdataF
[
0
],
AMP
,
AMP
,
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME
);
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME
);
generate_pbch
(
&
PHY_vars_eNB2
->
lte_eNB_
pbch
,
generate_pbch
(
&
eNB2
->
pbch
,
PHY_vars_eNB2
->
lte_eNB_
common_vars
.
txdataF
[
0
],
eNB2
->
common_vars
.
txdataF
[
0
],
AMP
,
AMP
,
&
PHY_vars_eNB2
->
lte_
frame_parms
,
&
eNB2
->
frame_parms
,
pbch_pdu
,
pbch_pdu
,
0
);
0
);
}
}
// write_output("pilotsF.m","rsF",txdataF[0],
lte_
frame_parms->ofdm_symbol_size,1,1);
// write_output("pilotsF.m","rsF",txdataF[0],frame_parms->ofdm_symbol_size,1,1);
write_output
(
"txsigF0.m"
,
"txsF0"
,
PHY_vars_eNB
->
lte_eNB_
common_vars
.
txdataF
[
0
][
0
],
FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX
,
1
,
1
);
write_output
(
"txsigF0.m"
,
"txsF0"
,
eNB
->
common_vars
.
txdataF
[
0
][
0
],
FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX
,
1
,
1
);
if
(
PHY_vars_eNB
->
lte_
frame_parms
.
nb_antennas_tx
>
1
)
if
(
eNB
->
frame_parms
.
nb_antennas_tx
>
1
)
write_output
(
"txsigF1.m"
,
"txsF1"
,
PHY_vars_eNB
->
lte_eNB_
common_vars
.
txdataF
[
0
][
1
],
FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX
,
1
,
1
);
write_output
(
"txsigF1.m"
,
"txsF1"
,
eNB
->
common_vars
.
txdataF
[
0
][
1
],
FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX
,
1
,
1
);
tx_lev
=
0
;
tx_lev
=
0
;
tx_lev1
=
0
;
tx_lev1
=
0
;
...
@@ -689,16 +681,16 @@ int main(int argc, char **argv)
...
@@ -689,16 +681,16 @@ int main(int argc, char **argv)
for
(
aa
=
0
;
aa
<
PHY_vars_eNB
->
lte_
frame_parms
.
nb_antennas_tx
;
aa
++
)
{
for
(
aa
=
0
;
aa
<
eNB
->
frame_parms
.
nb_antennas_tx
;
aa
++
)
{
if
(
frame_parms
->
Ncp
==
1
)
if
(
frame_parms
->
Ncp
==
1
)
PHY_ofdm_mod
(
PHY_vars_eNB
->
lte_eNB_
common_vars
.
txdataF
[
0
][
aa
],
// input,
PHY_ofdm_mod
(
eNB
->
common_vars
.
txdataF
[
0
][
aa
],
// input,
txdata
[
aa
],
// output
txdata
[
aa
],
// output
frame_parms
->
ofdm_symbol_size
,
frame_parms
->
ofdm_symbol_size
,
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME
*
nsymb
,
// number of symbols
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME
*
nsymb
,
// number of symbols
frame_parms
->
nb_prefix_samples
,
// number of prefix samples
frame_parms
->
nb_prefix_samples
,
// number of prefix samples
CYCLIC_PREFIX
);
CYCLIC_PREFIX
);
else
{
else
{
normal_prefix_mod
(
PHY_vars_eNB
->
lte_eNB_
common_vars
.
txdataF
[
0
][
aa
],
normal_prefix_mod
(
eNB
->
common_vars
.
txdataF
[
0
][
aa
],
txdata
[
aa
],
txdata
[
aa
],
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME
*
nsymb
,
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME
*
nsymb
,
frame_parms
);
frame_parms
);
...
@@ -709,17 +701,17 @@ int main(int argc, char **argv)
...
@@ -709,17 +701,17 @@ int main(int argc, char **argv)
}
}
if
(
interf1
>-
20
)
{
if
(
interf1
>-
20
)
{
for
(
aa
=
0
;
aa
<
PHY_vars_eNB1
->
lte_
frame_parms
.
nb_antennas_tx
;
aa
++
)
{
for
(
aa
=
0
;
aa
<
eNB1
->
frame_parms
.
nb_antennas_tx
;
aa
++
)
{
if
(
frame_parms
->
Ncp
==
1
)
if
(
frame_parms
->
Ncp
==
1
)
PHY_ofdm_mod
(
PHY_vars_eNB1
->
lte_eNB_
common_vars
.
txdataF
[
0
][
aa
],
// input,
PHY_ofdm_mod
(
eNB1
->
common_vars
.
txdataF
[
0
][
aa
],
// input,
PHY_vars_eNB1
->
lte_eNB_
common_vars
.
txdata
[
0
][
aa
],
// output
eNB1
->
common_vars
.
txdata
[
0
][
aa
],
// output
frame_parms
->
ofdm_symbol_size
,
frame_parms
->
ofdm_symbol_size
,
2
*
nsymb
,
// number of symbols
2
*
nsymb
,
// number of symbols
frame_parms
->
nb_prefix_samples
,
// number of prefix samples
frame_parms
->
nb_prefix_samples
,
// number of prefix samples
CYCLIC_PREFIX
);
CYCLIC_PREFIX
);
else
{
else
{
normal_prefix_mod
(
PHY_vars_eNB1
->
lte_eNB_
common_vars
.
txdataF
[
0
][
aa
],
normal_prefix_mod
(
eNB1
->
common_vars
.
txdataF
[
0
][
aa
],
PHY_vars_eNB1
->
lte_eNB_
common_vars
.
txdata
[
0
][
aa
],
eNB1
->
common_vars
.
txdata
[
0
][
aa
],
2
*
nsymb
,
2
*
nsymb
,
frame_parms
);
frame_parms
);
}
}
...
@@ -728,24 +720,24 @@ int main(int argc, char **argv)
...
@@ -728,24 +720,24 @@ int main(int argc, char **argv)
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES
);
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES
);
}
}
write_output
(
"txsigF0_1.m"
,
"txsF0_1"
,
PHY_vars_eNB1
->
lte_eNB_
common_vars
.
txdataF
[
0
][
0
],
FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX
,
1
,
1
);
write_output
(
"txsigF0_1.m"
,
"txsF0_1"
,
eNB1
->
common_vars
.
txdataF
[
0
][
0
],
FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX
,
1
,
1
);
if
(
PHY_vars_eNB1
->
lte_
frame_parms
.
nb_antennas_tx
>
1
)
if
(
eNB1
->
frame_parms
.
nb_antennas_tx
>
1
)
write_output
(
"txsigF1_1.m"
,
"txsF1_1"
,
PHY_vars_eNB1
->
lte_eNB_
common_vars
.
txdataF
[
0
][
1
],
FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX
,
1
,
1
);
write_output
(
"txsigF1_1.m"
,
"txsF1_1"
,
eNB1
->
common_vars
.
txdataF
[
0
][
1
],
FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX
,
1
,
1
);
}
}
if
(
interf2
>-
20
)
{
if
(
interf2
>-
20
)
{
for
(
aa
=
0
;
aa
<
PHY_vars_eNB2
->
lte_
frame_parms
.
nb_antennas_tx
;
aa
++
)
{
for
(
aa
=
0
;
aa
<
eNB2
->
frame_parms
.
nb_antennas_tx
;
aa
++
)
{
if
(
frame_parms
->
Ncp
==
1
)
if
(
frame_parms
->
Ncp
==
1
)
PHY_ofdm_mod
(
PHY_vars_eNB2
->
lte_eNB_
common_vars
.
txdataF
[
0
][
aa
],
// input,
PHY_ofdm_mod
(
eNB2
->
common_vars
.
txdataF
[
0
][
aa
],
// input,
PHY_vars_eNB2
->
lte_eNB_
common_vars
.
txdata
[
0
][
aa
],
// output
eNB2
->
common_vars
.
txdata
[
0
][
aa
],
// output
frame_parms
->
ofdm_symbol_size
,
frame_parms
->
ofdm_symbol_size
,
2
*
nsymb
,
// number of symbols
2
*
nsymb
,
// number of symbols
frame_parms
->
nb_prefix_samples
,
// number of prefix samples
frame_parms
->
nb_prefix_samples
,
// number of prefix samples
CYCLIC_PREFIX
);
CYCLIC_PREFIX
);
else
{
else
{
normal_prefix_mod
(
PHY_vars_eNB2
->
lte_eNB_
common_vars
.
txdataF
[
0
][
aa
],
normal_prefix_mod
(
eNB2
->
common_vars
.
txdataF
[
0
][
aa
],
PHY_vars_eNB2
->
lte_eNB_
common_vars
.
txdata
[
0
][
aa
],
eNB2
->
common_vars
.
txdata
[
0
][
aa
],
2
*
nsymb
,
2
*
nsymb
,
frame_parms
);
frame_parms
);
}
}
...
@@ -754,10 +746,10 @@ int main(int argc, char **argv)
...
@@ -754,10 +746,10 @@ int main(int argc, char **argv)
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES
);
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES
);
}
}
write_output
(
"txsigF0_2.m"
,
"txsF0_2"
,
PHY_vars_eNB2
->
lte_eNB_
common_vars
.
txdataF
[
0
][
0
],
FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX
,
1
,
1
);
write_output
(
"txsigF0_2.m"
,
"txsF0_2"
,
eNB2
->
common_vars
.
txdataF
[
0
][
0
],
FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX
,
1
,
1
);
if
(
PHY_vars_eNB2
->
lte_
frame_parms
.
nb_antennas_tx
>
1
)
if
(
eNB2
->
frame_parms
.
nb_antennas_tx
>
1
)
write_output
(
"txsigF1_2.m"
,
"txsF1_2"
,
PHY_vars_eNB2
->
lte_eNB_
common_vars
.
txdataF
[
0
][
1
],
FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX
,
1
,
1
);
write_output
(
"txsigF1_2.m"
,
"txsF1_2"
,
eNB2
->
common_vars
.
txdataF
[
0
][
1
],
FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX
,
1
,
1
);
}
}
// tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
// tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
...
@@ -767,15 +759,15 @@ int main(int argc, char **argv)
...
@@ -767,15 +759,15 @@ int main(int argc, char **argv)
if
(
frame_parms
->
nb_antennas_tx
>
1
)
if
(
frame_parms
->
nb_antennas_tx
>
1
)
write_output
(
"txsig1.m"
,
"txs1"
,
txdata
[
1
],
FRAME_LENGTH_COMPLEX_SAMPLES
,
1
,
1
);
write_output
(
"txsig1.m"
,
"txs1"
,
txdata
[
1
],
FRAME_LENGTH_COMPLEX_SAMPLES
,
1
,
1
);
write_output
(
"txsig0_1.m"
,
"txs0_1"
,
PHY_vars_eNB1
->
lte_eNB_
common_vars
.
txdata
[
0
][
0
],
FRAME_LENGTH_COMPLEX_SAMPLES
,
1
,
1
);
write_output
(
"txsig0_1.m"
,
"txs0_1"
,
eNB1
->
common_vars
.
txdata
[
0
][
0
],
FRAME_LENGTH_COMPLEX_SAMPLES
,
1
,
1
);
if
(
frame_parms
->
nb_antennas_tx
>
1
)
if
(
frame_parms
->
nb_antennas_tx
>
1
)
write_output
(
"txsig1_1.m"
,
"txs1_1"
,
PHY_vars_eNB1
->
lte_eNB_
common_vars
.
txdata
[
0
][
1
],
FRAME_LENGTH_COMPLEX_SAMPLES
,
1
,
1
);
write_output
(
"txsig1_1.m"
,
"txs1_1"
,
eNB1
->
common_vars
.
txdata
[
0
][
1
],
FRAME_LENGTH_COMPLEX_SAMPLES
,
1
,
1
);
write_output
(
"txsig0_2.m"
,
"txs0_2"
,
PHY_vars_eNB2
->
lte_eNB_
common_vars
.
txdata
[
0
][
0
],
FRAME_LENGTH_COMPLEX_SAMPLES
,
1
,
1
);
write_output
(
"txsig0_2.m"
,
"txs0_2"
,
eNB2
->
common_vars
.
txdata
[
0
][
0
],
FRAME_LENGTH_COMPLEX_SAMPLES
,
1
,
1
);
if
(
frame_parms
->
nb_antennas_tx
>
1
)
if
(
frame_parms
->
nb_antennas_tx
>
1
)
write_output
(
"txsig1_2.m"
,
"txs1_2"
,
PHY_vars_eNB2
->
lte_eNB_
common_vars
.
txdata
[
0
][
1
],
FRAME_LENGTH_COMPLEX_SAMPLES
,
1
,
1
);
write_output
(
"txsig1_2.m"
,
"txs1_2"
,
eNB2
->
common_vars
.
txdata
[
0
][
1
],
FRAME_LENGTH_COMPLEX_SAMPLES
,
1
,
1
);
}
else
{
//read in from file
}
else
{
//read in from file
i
=
0
;
i
=
0
;
...
@@ -811,7 +803,7 @@ int main(int argc, char **argv)
...
@@ -811,7 +803,7 @@ int main(int argc, char **argv)
// multipath channel
// multipath channel
for
(
i
=
0
;
i
<
2
*
nsymb
*
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES
;
i
++
)
{
for
(
i
=
0
;
i
<
2
*
nsymb
*
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES
;
i
++
)
{
for
(
aa
=
0
;
aa
<
PHY_vars_eNB
->
lte_
frame_parms
.
nb_antennas_tx
;
aa
++
)
{
for
(
aa
=
0
;
aa
<
eNB
->
frame_parms
.
nb_antennas_tx
;
aa
++
)
{
s_re
[
aa
][
i
]
=
((
double
)(((
short
*
)
txdata
[
aa
]))[(
i
<<
1
)]);
s_re
[
aa
][
i
]
=
((
double
)(((
short
*
)
txdata
[
aa
]))[(
i
<<
1
)]);
s_im
[
aa
][
i
]
=
((
double
)(((
short
*
)
txdata
[
aa
]))[(
i
<<
1
)
+
1
]);
s_im
[
aa
][
i
]
=
((
double
)(((
short
*
)
txdata
[
aa
]))[(
i
<<
1
)
+
1
]);
...
@@ -872,7 +864,7 @@ int main(int argc, char **argv)
...
@@ -872,7 +864,7 @@ int main(int argc, char **argv)
}
}
}
}
sigma2_dB
=
10
*
log10
((
double
)
tx_lev
)
+
10
*
log10
((
double
)
PHY_vars_eNB
->
lte_
frame_parms
.
ofdm_symbol_size
/
(
double
)(
12
*
NB_RB
))
-
SNR
;
sigma2_dB
=
10
*
log10
((
double
)
tx_lev
)
+
10
*
log10
((
double
)
eNB
->
frame_parms
.
ofdm_symbol_size
/
(
double
)(
12
*
NB_RB
))
-
SNR
;
if
(
n_frames
==
1
)
if
(
n_frames
==
1
)
printf
(
"sigma2_dB %f (SNR %f dB) tx_lev_dB %f,%f,%f
\n
"
,
sigma2_dB
,
SNR
,
printf
(
"sigma2_dB %f (SNR %f dB) tx_lev_dB %f,%f,%f
\n
"
,
sigma2_dB
,
SNR
,
...
@@ -894,20 +886,20 @@ int main(int argc, char **argv)
...
@@ -894,20 +886,20 @@ int main(int argc, char **argv)
for
(
n_trials
=
0
;
n_trials
<
ntrials
;
n_trials
++
)
{
for
(
n_trials
=
0
;
n_trials
<
ntrials
;
n_trials
++
)
{
//printf("n_trial %d\n",n_trials);
//printf("n_trial %d\n",n_trials);
for
(
i
=
0
;
i
<
2
*
nsymb
*
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES
;
i
++
)
{
for
(
i
=
0
;
i
<
2
*
nsymb
*
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES
;
i
++
)
{
for
(
aa
=
0
;
aa
<
PHY_vars_eNB
->
lte_
frame_parms
.
nb_antennas_rx
;
aa
++
)
{
for
(
aa
=
0
;
aa
<
eNB
->
frame_parms
.
nb_antennas_rx
;
aa
++
)
{
if
(
n_trials
==
0
)
{
if
(
n_trials
==
0
)
{
r_re
[
aa
][
i
]
+=
(
pow
(
10
.
0
,.
05
*
interf1
)
*
r_re1
[
aa
][
i
]
+
pow
(
10
.
0
,.
05
*
interf2
)
*
r_re2
[
aa
][
i
]);
r_re
[
aa
][
i
]
+=
(
pow
(
10
.
0
,.
05
*
interf1
)
*
r_re1
[
aa
][
i
]
+
pow
(
10
.
0
,.
05
*
interf2
)
*
r_re2
[
aa
][
i
]);
r_im
[
aa
][
i
]
+=
(
pow
(
10
.
0
,.
05
*
interf1
)
*
r_im1
[
aa
][
i
]
+
pow
(
10
.
0
,.
05
*
interf2
)
*
r_im2
[
aa
][
i
]);
r_im
[
aa
][
i
]
+=
(
pow
(
10
.
0
,.
05
*
interf1
)
*
r_im1
[
aa
][
i
]
+
pow
(
10
.
0
,.
05
*
interf2
)
*
r_im2
[
aa
][
i
]);
}
}
((
short
*
)
PHY_vars_UE
->
lte_ue_
common_vars
.
rxdata
[
aa
])[
2
*
i
]
=
(
short
)
(.
167
*
(
r_re
[
aa
][
i
]
+
sqrt
(
sigma2
/
2
)
*
gaussdouble
(
0
.
0
,
1
.
0
)));
((
short
*
)
UE
->
common_vars
.
rxdata
[
aa
])[
2
*
i
]
=
(
short
)
(.
167
*
(
r_re
[
aa
][
i
]
+
sqrt
(
sigma2
/
2
)
*
gaussdouble
(
0
.
0
,
1
.
0
)));
((
short
*
)
PHY_vars_UE
->
lte_ue_
common_vars
.
rxdata
[
aa
])[
2
*
i
+
1
]
=
(
short
)
(.
167
*
(
r_im
[
aa
][
i
]
+
(
iqim
*
r_re
[
aa
][
i
])
+
sqrt
(
sigma2
/
2
)
*
gaussdouble
(
0
.
0
,
1
.
0
)));
((
short
*
)
UE
->
common_vars
.
rxdata
[
aa
])[
2
*
i
+
1
]
=
(
short
)
(.
167
*
(
r_im
[
aa
][
i
]
+
(
iqim
*
r_re
[
aa
][
i
])
+
sqrt
(
sigma2
/
2
)
*
gaussdouble
(
0
.
0
,
1
.
0
)));
}
}
}
}
if
(
n_frames
==
1
)
{
if
(
n_frames
==
1
)
{
printf
(
"rx_level data symbol %f
\n
"
,
printf
(
"rx_level data symbol %f
\n
"
,
10
*
log10
(
signal_energy
(
&
PHY_vars_UE
->
lte_ue_
common_vars
.
rxdata
[
0
][
frame_parms
->
samples_per_tti
/
2
],
4
*
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES
)));
10
*
log10
(
signal_energy
(
&
UE
->
common_vars
.
rxdata
[
0
][
frame_parms
->
samples_per_tti
/
2
],
4
*
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES
)));
}
}
...
@@ -919,10 +911,10 @@ int main(int argc, char **argv)
...
@@ -919,10 +911,10 @@ int main(int argc, char **argv)
exit(0);
exit(0);
}
}
result = fread((void *)
PHY_vars_UE->lte_ue_
common_vars.rxdata[0],4,FRAME_LENGTH_COMPLEX_SAMPLES,rx_frame_file);
result = fread((void *)
UE->
common_vars.rxdata[0],4,FRAME_LENGTH_COMPLEX_SAMPLES,rx_frame_file);
printf("Read %d bytes\n",result);
printf("Read %d bytes\n",result);
if (
PHY_vars_UE->lte_
frame_parms.nb_antennas_rx>1) {
if (
UE->
frame_parms.nb_antennas_rx>1) {
result = fread((void *)
PHY_vars_UE->lte_ue_
common_vars.rxdata[1],4,FRAME_LENGTH_COMPLEX_SAMPLES,rx_frame_file);
result = fread((void *)
UE->
common_vars.rxdata[1],4,FRAME_LENGTH_COMPLEX_SAMPLES,rx_frame_file);
printf("Read %d bytes\n",result);
printf("Read %d bytes\n",result);
}
}
...
@@ -930,21 +922,21 @@ int main(int argc, char **argv)
...
@@ -930,21 +922,21 @@ int main(int argc, char **argv)
*/
*/
for
(
l
=
0
;
l
<
PHY_vars_eNB
->
lte_
frame_parms
.
symbols_per_tti
;
l
++
)
{
for
(
l
=
0
;
l
<
eNB
->
frame_parms
.
symbols_per_tti
;
l
++
)
{
// subframe_offset = (l/
PHY_vars_eNB->lte_frame_parms.symbols_per_tti)*PHY_vars_eNB->lte_
frame_parms.samples_per_tti;
// subframe_offset = (l/
eNB->frame_parms.symbols_per_tti)*eNB->
frame_parms.samples_per_tti;
// printf("subframe_offset = %d\n",subframe_offset);
// printf("subframe_offset = %d\n",subframe_offset);
slot_fep
(
PHY_vars_
UE
,
slot_fep
(
UE
,
l
%
(
PHY_vars_eNB
->
lte_
frame_parms
.
symbols_per_tti
/
2
),
l
%
(
eNB
->
frame_parms
.
symbols_per_tti
/
2
),
l
/
(
PHY_vars_eNB
->
lte_
frame_parms
.
symbols_per_tti
/
2
),
l
/
(
eNB
->
frame_parms
.
symbols_per_tti
/
2
),
0
,
0
,
0
,
0
,
0
);
0
);
if
(
l
==
0
)
{
if
(
l
==
0
)
{
lte_ue_measurements
(
PHY_vars_
UE
,
lte_ue_measurements
(
UE
,
0
,
0
,
1
,
1
,
0
);
0
);
...
@@ -952,19 +944,19 @@ int main(int argc, char **argv)
...
@@ -952,19 +944,19 @@ int main(int argc, char **argv)
if (trial%100 == 0) {
if (trial%100 == 0) {
msg("[PHY_PROCEDURES_LTE] frame %d, RX RSSI %d dBm, digital (%d, %d) dB, linear (%d, %d), RX gain %d dB\n",
msg("[PHY_PROCEDURES_LTE] frame %d, RX RSSI %d dBm, digital (%d, %d) dB, linear (%d, %d), RX gain %d dB\n",
trial,
trial,
PHY_vars_UE->PHY_
measurements.rx_rssi_dBm[0],
UE->
measurements.rx_rssi_dBm[0],
PHY_vars_UE->PHY_
measurements.rx_power_dB[0][0],
UE->
measurements.rx_power_dB[0][0],
PHY_vars_UE->PHY_
measurements.rx_power_dB[0][1],
UE->
measurements.rx_power_dB[0][1],
PHY_vars_UE->PHY_
measurements.rx_power[0][0],
UE->
measurements.rx_power[0][0],
PHY_vars_UE->PHY_
measurements.rx_power[0][1],
UE->
measurements.rx_power[0][1],
PHY_vars_
UE->rx_total_gain_dB);
UE->rx_total_gain_dB);
msg("[PHY_PROCEDURES_LTE] frame %d, N0 digital (%d, %d) dB, linear (%d, %d)\n",
msg("[PHY_PROCEDURES_LTE] frame %d, N0 digital (%d, %d) dB, linear (%d, %d)\n",
trial,
trial,
PHY_vars_UE->PHY_
measurements.n0_power_dB[0],
UE->
measurements.n0_power_dB[0],
PHY_vars_UE->PHY_
measurements.n0_power_dB[1],
UE->
measurements.n0_power_dB[1],
PHY_vars_UE->PHY_
measurements.n0_power[0],
UE->
measurements.n0_power[0],
PHY_vars_UE->PHY_
measurements.n0_power[1]);
UE->
measurements.n0_power[1]);
msg("[PHY_PROCEDURES_LTE] frame %d, freq_offset_filt = %d\n",
msg("[PHY_PROCEDURES_LTE] frame %d, freq_offset_filt = %d\n",
trial, freq_offset);
trial, freq_offset);
...
@@ -973,47 +965,47 @@ int main(int argc, char **argv)
...
@@ -973,47 +965,47 @@ int main(int argc, char **argv)
*/
*/
}
}
if
(
l
==
((
PHY_vars_eNB
->
lte_
frame_parms
.
Ncp
==
0
)
?
4
:
3
))
{
if
(
l
==
((
eNB
->
frame_parms
.
Ncp
==
0
)
?
4
:
3
))
{
//sprintf(fname,"dl_ch00_%d.m",l);
//sprintf(fname,"dl_ch00_%d.m",l);
//sprintf(vname,"dl_ch00_%d",l);
//sprintf(vname,"dl_ch00_%d",l);
//write_output(fname,vname,&(
lte_ue_common_vars->dl_ch_estimates[0][lte_frame_parms->ofdm_symbol_size*(l%6)]),lte_
frame_parms->ofdm_symbol_size,1,1);
//write_output(fname,vname,&(
common_vars->dl_ch_estimates[0][frame_parms->ofdm_symbol_size*(l%6)]),
frame_parms->ofdm_symbol_size,1,1);
lte_est_freq_offset
(
PHY_vars_UE
->
lte_ue_
common_vars
.
dl_ch_estimates
[
0
],
lte_est_freq_offset
(
UE
->
common_vars
.
dl_ch_estimates
[
0
],
&
PHY_vars_UE
->
lte_
frame_parms
,
&
UE
->
frame_parms
,
l
,
l
,
&
freq_offset
,
&
freq_offset
,
1
);
1
);
}
}
if
(
l
==
((
PHY_vars_eNB
->
lte_
frame_parms
.
Ncp
==
0
)
?
10
:
9
))
{
if
(
l
==
((
eNB
->
frame_parms
.
Ncp
==
0
)
?
10
:
9
))
{
for
(
frame_mod4
=
0
;
frame_mod4
<
4
;
frame_mod4
++
)
{
for
(
frame_mod4
=
0
;
frame_mod4
<
4
;
frame_mod4
++
)
{
pbch_tx_ant
=
rx_pbch
(
&
PHY_vars_UE
->
lte_ue_
common_vars
,
pbch_tx_ant
=
rx_pbch
(
&
UE
->
common_vars
,
PHY_vars_UE
->
lte_ue_
pbch_vars
[
0
],
UE
->
pbch_vars
[
0
],
&
PHY_vars_UE
->
lte_
frame_parms
,
&
UE
->
frame_parms
,
0
,
0
,
SISO
,
SISO
,
PHY_vars_
UE
->
high_speed_flag
,
UE
->
high_speed_flag
,
frame_mod4
);
frame_mod4
);
if
((
pbch_tx_ant
>
0
)
&&
(
pbch_tx_ant
<
4
))
{
if
((
pbch_tx_ant
>
0
)
&&
(
pbch_tx_ant
<
4
))
{
PHY_vars_UE
->
lte_
frame_parms
.
mode1_flag
=
1
;
UE
->
frame_parms
.
mode1_flag
=
1
;
break
;
break
;
if
(
pbch_phase
!=
frame_mod4
)
if
(
pbch_phase
!=
frame_mod4
)
printf
(
"pbch_phase different!!!
\n
"
);
printf
(
"pbch_phase different!!!
\n
"
);
}
}
pbch_tx_ant
=
rx_pbch
(
&
PHY_vars_UE
->
lte_ue_
common_vars
,
pbch_tx_ant
=
rx_pbch
(
&
UE
->
common_vars
,
PHY_vars_UE
->
lte_ue_
pbch_vars
[
0
],
UE
->
pbch_vars
[
0
],
&
PHY_vars_eNB
->
lte_
frame_parms
,
&
eNB
->
frame_parms
,
0
,
0
,
ALAMOUTI
,
ALAMOUTI
,
PHY_vars_
UE
->
high_speed_flag
,
UE
->
high_speed_flag
,
frame_mod4
);
frame_mod4
);
if
((
pbch_tx_ant
>
0
)
&&
(
pbch_tx_ant
<
4
))
{
if
((
pbch_tx_ant
>
0
)
&&
(
pbch_tx_ant
<
4
))
{
PHY_vars_UE
->
lte_
frame_parms
.
mode1_flag
=
0
;
UE
->
frame_parms
.
mode1_flag
=
0
;
n_alamouti
++
;
n_alamouti
++
;
break
;
break
;
}
}
...
@@ -1023,7 +1015,7 @@ int main(int argc, char **argv)
...
@@ -1023,7 +1015,7 @@ int main(int argc, char **argv)
if
((
pbch_tx_ant
>
0
)
&&
(
pbch_tx_ant
<
4
))
{
if
((
pbch_tx_ant
>
0
)
&&
(
pbch_tx_ant
<
4
))
{
if
(
n_frames
==
1
)
if
(
n_frames
==
1
)
msg
(
"pbch decoded sucessfully mode1_flag %d, frame_mod4 %d, tx_ant %d!
\n
"
,
msg
(
"pbch decoded sucessfully mode1_flag %d, frame_mod4 %d, tx_ant %d!
\n
"
,
PHY_vars_UE
->
lte_
frame_parms
.
mode1_flag
,
frame_mod4
,
pbch_tx_ant
);
UE
->
frame_parms
.
mode1_flag
,
frame_mod4
,
pbch_tx_ant
);
}
else
{
}
else
{
n_errors
++
;
n_errors
++
;
n_errors2
++
;
n_errors2
++
;
...
@@ -1036,7 +1028,7 @@ int main(int argc, char **argv)
...
@@ -1036,7 +1028,7 @@ int main(int argc, char **argv)
#ifdef XFORMS
#ifdef XFORMS
phy_scope_UE
(
form_ue
,
phy_scope_UE
(
form_ue
,
PHY_vars_
UE
,
UE
,
0
,
0
,
1
);
0
,
0
,
1
);
#endif
#endif
...
@@ -1066,16 +1058,16 @@ int main(int argc, char **argv)
...
@@ -1066,16 +1058,16 @@ int main(int argc, char **argv)
if
(
n_frames
==
1
)
{
if
(
n_frames
==
1
)
{
write_output
(
"H00.m"
,
"h00"
,
&
(
PHY_vars_UE
->
lte_ue_common_vars
.
dl_ch_estimates
[
0
][
0
][
0
]),((
frame_parms
->
Ncp
==
0
)
?
7
:
6
)
*
(
PHY_vars_eNB
->
lte_
frame_parms
.
ofdm_symbol_size
),
1
,
1
);
write_output
(
"H00.m"
,
"h00"
,
&
(
UE
->
common_vars
.
dl_ch_estimates
[
0
][
0
][
0
]),((
frame_parms
->
Ncp
==
0
)
?
7
:
6
)
*
(
eNB
->
frame_parms
.
ofdm_symbol_size
),
1
,
1
);
if
(
n_tx
==
2
)
if
(
n_tx
==
2
)
write_output
(
"H10.m"
,
"h10"
,
&
(
PHY_vars_UE
->
lte_ue_common_vars
.
dl_ch_estimates
[
0
][
2
][
0
]),((
frame_parms
->
Ncp
==
0
)
?
7
:
6
)
*
(
PHY_vars_eNB
->
lte_
frame_parms
.
ofdm_symbol_size
),
1
,
1
);
write_output
(
"H10.m"
,
"h10"
,
&
(
UE
->
common_vars
.
dl_ch_estimates
[
0
][
2
][
0
]),((
frame_parms
->
Ncp
==
0
)
?
7
:
6
)
*
(
eNB
->
frame_parms
.
ofdm_symbol_size
),
1
,
1
);
write_output
(
"rxsig0.m"
,
"rxs0"
,
PHY_vars_UE
->
lte_ue_
common_vars
.
rxdata
[
0
],
FRAME_LENGTH_COMPLEX_SAMPLES
,
1
,
1
);
write_output
(
"rxsig0.m"
,
"rxs0"
,
UE
->
common_vars
.
rxdata
[
0
],
FRAME_LENGTH_COMPLEX_SAMPLES
,
1
,
1
);
write_output
(
"rxsigF0.m"
,
"rxsF0"
,
PHY_vars_UE
->
lte_ue_
common_vars
.
rxdataF
[
0
],
NUMBER_OF_OFDM_CARRIERS
*
2
*
((
frame_parms
->
Ncp
==
0
)
?
14
:
12
),
2
,
1
);
write_output
(
"rxsigF0.m"
,
"rxsF0"
,
UE
->
common_vars
.
rxdataF
[
0
],
NUMBER_OF_OFDM_CARRIERS
*
2
*
((
frame_parms
->
Ncp
==
0
)
?
14
:
12
),
2
,
1
);
write_output
(
"PBCH_rxF0_ext.m"
,
"pbch0_ext"
,
PHY_vars_UE
->
lte_ue_
pbch_vars
[
0
]
->
rxdataF_ext
[
0
],
12
*
4
*
6
,
1
,
1
);
write_output
(
"PBCH_rxF0_ext.m"
,
"pbch0_ext"
,
UE
->
pbch_vars
[
0
]
->
rxdataF_ext
[
0
],
12
*
4
*
6
,
1
,
1
);
write_output
(
"PBCH_rxF0_comp.m"
,
"pbch0_comp"
,
PHY_vars_UE
->
lte_ue_
pbch_vars
[
0
]
->
rxdataF_comp
[
0
],
12
*
4
*
6
,
1
,
1
);
write_output
(
"PBCH_rxF0_comp.m"
,
"pbch0_comp"
,
UE
->
pbch_vars
[
0
]
->
rxdataF_comp
[
0
],
12
*
4
*
6
,
1
,
1
);
write_output
(
"PBCH_rxF_llr.m"
,
"pbch_llr"
,
PHY_vars_UE
->
lte_ue_
pbch_vars
[
0
]
->
llr
,(
frame_parms
->
Ncp
==
0
)
?
1920
:
1728
,
1
,
4
);
write_output
(
"PBCH_rxF_llr.m"
,
"pbch_llr"
,
UE
->
pbch_vars
[
0
]
->
llr
,(
frame_parms
->
Ncp
==
0
)
?
1920
:
1728
,
1
,
4
);
}
}
...
...
openair1/SIMULATION/LTE_PHY/pdcchsim.c
View file @
45cbc8ab
...
@@ -759,13 +759,14 @@ int main(int argc, char **argv)
...
@@ -759,13 +759,14 @@ int main(int argc, char **argv)
eNB_rxtx_proc_t
*
proc_rxtx
=
&
eNB
->
proc
.
proc_rxtx
[
subframe
&
1
];
eNB
->
ulsch
[
0
]
=
new_eNB_ulsch
(
MAX_TURBO_ITERATIONS
,
N_RB_DL
,
0
);
eNB
->
ulsch
[
0
]
=
new_eNB_ulsch
(
MAX_TURBO_ITERATIONS
,
N_RB_DL
,
0
);
UE
->
ulsch
[
0
]
=
new_ue_ulsch
(
N_RB_DL
,
0
);
UE
->
ulsch
[
0
]
=
new_ue_ulsch
(
N_RB_DL
,
0
);
eNB
->
proc
.
frame_tx
=
0
;
proc_rxtx
->
frame_tx
=
0
;
eNB
->
proc
.
subframe_tx
=
subframe
;
proc_rxtx
->
subframe_tx
=
subframe
;
if
(
input_fd
==
NULL
)
{
if
(
input_fd
==
NULL
)
{
msg
(
"No input file, so starting TX
\n
"
);
msg
(
"No input file, so starting TX
\n
"
);
...
@@ -932,7 +933,7 @@ int main(int argc, char **argv)
...
@@ -932,7 +933,7 @@ int main(int argc, char **argv)
if
(
n_frames
==
1
)
if
(
n_frames
==
1
)
printf
(
"generating PHICH
\n
"
);
printf
(
"generating PHICH
\n
"
);
harq_pid
=
phich_subframe_to_harq_pid
(
&
eNB
->
frame_parms
,
eNB
->
proc
.
frame_tx
,
subframe
);
harq_pid
=
phich_subframe_to_harq_pid
(
&
eNB
->
frame_parms
,
proc_rxtx
->
frame_tx
,
subframe
);
phich_ACK
=
taus
()
&
1
;
phich_ACK
=
taus
()
&
1
;
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
phich_active
=
1
;
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
phich_active
=
1
;
...
@@ -944,23 +945,23 @@ int main(int argc, char **argv)
...
@@ -944,23 +945,23 @@ int main(int argc, char **argv)
UE
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
first_rb
=
0
;
UE
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
first_rb
=
0
;
UE
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
n_DMRS
=
0
;
UE
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
n_DMRS
=
0
;
generate_phich_top
(
eNB
,
AMP
,
0
,
0
);
generate_phich_top
(
eNB
,
proc_rxtx
,
AMP
,
0
,
0
);
// generate 3 interfering PHICH
// generate 3 interfering PHICH
if
(
num_phich_interf
>
0
)
{
if
(
num_phich_interf
>
0
)
{
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
first_rb
=
4
;
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
first_rb
=
4
;
generate_phich_top
(
eNB
,
1024
,
0
,
0
);
generate_phich_top
(
eNB
,
proc_rxtx
,
1024
,
0
,
0
);
}
}
if
(
num_phich_interf
>
1
)
{
if
(
num_phich_interf
>
1
)
{
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
first_rb
=
8
;
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
first_rb
=
8
;
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
n_DMRS
=
1
;
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
n_DMRS
=
1
;
generate_phich_top
(
eNB
,
1024
,
0
,
0
);
generate_phich_top
(
eNB
,
proc_rxtx
,
1024
,
0
,
0
);
}
}
if
(
num_phich_interf
>
2
)
{
if
(
num_phich_interf
>
2
)
{
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
first_rb
=
12
;
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
first_rb
=
12
;
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
n_DMRS
=
1
;
eNB
->
ulsch
[
0
]
->
harq_processes
[
harq_pid
]
->
n_DMRS
=
1
;
generate_phich_top
(
eNB
,
1024
,
0
,
0
);
generate_phich_top
(
eNB
,
proc_rxtx
,
1024
,
0
,
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