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
Balaji Kolla
openairinterface5G
Commits
ae44bc06
Commit
ae44bc06
authored
Feb 08, 2019
by
Thomas Laurent
Browse files
pbch displays in the scope
parent
e9ac05d4
Changes
6
Hide whitespace changes
Inline
Side-by-side
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
View file @
ae44bc06
...
...
@@ -266,123 +266,33 @@ void nr_pbch_channel_compensation(int **rxdataF_ext,
int
**
rxdataF_comp
,
NR_DL_FRAME_PARMS
*
frame_parms
,
uint32_t
symbol
,
uint8_t
output_shift
)
{
short
conjugate
[
8
]
__attribute__
((
aligned
(
16
)))
=
{
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
};
//short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
#if defined(__x86_64__) || defined(__i386__)
__m128i
mmtmpP0
,
mmtmpP1
,
mmtmpP2
,
mmtmpP3
;
#elif defined(__arm__)
int16x8_t
mmtmpP0
,
mmtmpP1
,
mmtmpP2
,
mmtmpP3
;
#endif
uint16_t
nb_re
=
180
;
uint8_t
aarx
;
#if defined(__x86_64__) || defined(__i386__)
__m128i
*
dl_ch128
,
*
rxdataF128
,
*
rxdataF_comp128
;
#elif defined(__arm__)
#endif
uint8_t
output_shift
)
{
const
uint16_t
nb_re
=
symbol
==
2
?
72
:
180
;
AssertFatal
((
symbol
>
0
&&
symbol
<
4
),
"symbol %d is illegal for PBCH DM-RS
\n
"
,
symbol
);
if
(
symbol
==
2
)
nb_re
=
72
;
// printf("comp: symbol %d : nb_re %d\n",symbol,nb_re);
for
(
aarx
=
0
;
aarx
<
frame_parms
->
nb_antennas_rx
;
aarx
++
)
{
for
(
int
aarx
=
0
;
aarx
<
frame_parms
->
nb_antennas_rx
;
aarx
++
)
{
#if defined(__x86_64__) || defined(__i386__)
dl_ch128
=
(
__m128i
*
)
&
dl_ch_estimates_ext
[
aarx
][
symbol
*
20
*
12
];
rxdataF128
=
(
__m128i
*
)
&
rxdataF_ext
[
aarx
][
symbol
*
20
*
12
];
rxdataF_comp128
=
(
__m128i
*
)
&
rxdataF_comp
[
aarx
][
symbol
*
20
*
12
];
vect128
*
dl_ch128
=
(
vect128
*
)
&
dl_ch_estimates_ext
[
aarx
][
symbol
*
20
*
12
];
vect128
*
rxdataF128
=
(
vect128
*
)
&
rxdataF_ext
[
aarx
][
symbol
*
20
*
12
];
vect128
*
rxdataF_comp128
=
(
vect128
*
)
&
rxdataF_comp
[
aarx
][
symbol
*
20
*
12
];
/*
printf("ch compensation dl_ch ext addr %p \n", &dl_ch_estimates_ext[aarx][symbol*20*12]);
printf("rxdataf ext addr %p symbol %d\n", &rxdataF_ext[aarx][symbol*20*12], symbol);
printf("rxdataf_comp addr %p\n",&rxdataF_comp[aarx][symbol*20*12]);
*/
#elif defined(__arm__)
// to be filled in
#endif
for
(
int
re
=
0
;
re
<
nb_re
;
re
+=
12
)
{
// printf("******re %d\n",re);
#if defined(__x86_64__) || defined(__i386__)
// multiply by conjugated channel
mmtmpP0
=
_mm_madd_epi16
(
dl_ch128
[
0
],
rxdataF128
[
0
]);
// print_ints("re",&mmtmpP0);
// mmtmpP0 contains real part of 4 consecutive outputs (32-bit)
mmtmpP1
=
_mm_shufflelo_epi16
(
dl_ch128
[
0
],
_MM_SHUFFLE
(
2
,
3
,
0
,
1
));
mmtmpP1
=
_mm_shufflehi_epi16
(
mmtmpP1
,
_MM_SHUFFLE
(
2
,
3
,
0
,
1
));
mmtmpP1
=
_mm_sign_epi16
(
mmtmpP1
,
*
(
__m128i
*
)
&
conjugate
[
0
]);
// print_ints("im",&mmtmpP1);
mmtmpP1
=
_mm_madd_epi16
(
mmtmpP1
,
rxdataF128
[
0
]);
// mmtmpP1 contains imag part of 4 consecutive outputs (32-bit)
mmtmpP0
=
_mm_srai_epi32
(
mmtmpP0
,
output_shift
);
// print_ints("re(shift)",&mmtmpP0);
mmtmpP1
=
_mm_srai_epi32
(
mmtmpP1
,
output_shift
);
// print_ints("im(shift)",&mmtmpP1);
mmtmpP2
=
_mm_unpacklo_epi32
(
mmtmpP0
,
mmtmpP1
);
mmtmpP3
=
_mm_unpackhi_epi32
(
mmtmpP0
,
mmtmpP1
);
// print_ints("c0",&mmtmpP2);
// print_ints("c1",&mmtmpP3);
rxdataF_comp128
[
0
]
=
_mm_packs_epi32
(
mmtmpP2
,
mmtmpP3
);
/*
print_shorts("rx:",rxdataF128);
print_shorts("ch:",dl_ch128);
print_shorts("pack:",rxdataF_comp128);
*/
// multiply by conjugated channel
mmtmpP0
=
_mm_madd_epi16
(
dl_ch128
[
1
],
rxdataF128
[
1
]);
// mmtmpP0 contains real part of 4 consecutive outputs (32-bit)
mmtmpP1
=
_mm_shufflelo_epi16
(
dl_ch128
[
1
],
_MM_SHUFFLE
(
2
,
3
,
0
,
1
));
mmtmpP1
=
_mm_shufflehi_epi16
(
mmtmpP1
,
_MM_SHUFFLE
(
2
,
3
,
0
,
1
));
mmtmpP1
=
_mm_sign_epi16
(
mmtmpP1
,
*
(
__m128i
*
)
&
conjugate
[
0
]);
mmtmpP1
=
_mm_madd_epi16
(
mmtmpP1
,
rxdataF128
[
1
]);
// mmtmpP1 contains imag part of 4 consecutive outputs (32-bit)
mmtmpP0
=
_mm_srai_epi32
(
mmtmpP0
,
output_shift
);
mmtmpP1
=
_mm_srai_epi32
(
mmtmpP1
,
output_shift
);
mmtmpP2
=
_mm_unpacklo_epi32
(
mmtmpP0
,
mmtmpP1
);
mmtmpP3
=
_mm_unpackhi_epi32
(
mmtmpP0
,
mmtmpP1
);
rxdataF_comp128
[
1
]
=
_mm_packs_epi32
(
mmtmpP2
,
mmtmpP3
);
// print_shorts("rx:",rxdataF128+1);
// print_shorts("ch:",dl_ch128+1);
// print_shorts("pack:",rxdataF_comp128+1);
// multiply by conjugated channel
mmtmpP0
=
_mm_madd_epi16
(
dl_ch128
[
2
],
rxdataF128
[
2
]);
// mmtmpP0 contains real part of 4 consecutive outputs (32-bit)
mmtmpP1
=
_mm_shufflelo_epi16
(
dl_ch128
[
2
],
_MM_SHUFFLE
(
2
,
3
,
0
,
1
));
mmtmpP1
=
_mm_shufflehi_epi16
(
mmtmpP1
,
_MM_SHUFFLE
(
2
,
3
,
0
,
1
));
mmtmpP1
=
_mm_sign_epi16
(
mmtmpP1
,
*
(
__m128i
*
)
&
conjugate
[
0
]);
mmtmpP1
=
_mm_madd_epi16
(
mmtmpP1
,
rxdataF128
[
2
]);
// mmtmpP1 contains imag part of 4 consecutive outputs (32-bit)
mmtmpP0
=
_mm_srai_epi32
(
mmtmpP0
,
output_shift
);
mmtmpP1
=
_mm_srai_epi32
(
mmtmpP1
,
output_shift
);
mmtmpP2
=
_mm_unpacklo_epi32
(
mmtmpP0
,
mmtmpP1
);
mmtmpP3
=
_mm_unpackhi_epi32
(
mmtmpP0
,
mmtmpP1
);
rxdataF_comp128
[
2
]
=
_mm_packs_epi32
(
mmtmpP2
,
mmtmpP3
);
// print_shorts("rx:",rxdataF128+2);
// print_shorts("ch:",dl_ch128+2);
// print_shorts("pack:",rxdataF_comp128+2);
dl_ch128
+=
3
;
rxdataF128
+=
3
;
rxdataF_comp128
+=
3
;
#elif defined(__arm__)
// to be filled in
#endif
*
rxdataF_comp128
++
=
mulByConjugate128
(
rxdataF128
++
,
dl_ch128
++
,
output_shift
);
*
rxdataF_comp128
++
=
mulByConjugate128
(
rxdataF128
++
,
dl_ch128
++
,
output_shift
);
*
rxdataF_comp128
++
=
mulByConjugate128
(
rxdataF128
++
,
dl_ch128
++
,
output_shift
);
}
}
#if defined(__x86_64__) || defined(__i386__)
_mm_empty
();
_m_empty
();
#endif
}
void
nr_pbch_detection_mrc
(
NR_DL_FRAME_PARMS
*
frame_parms
,
...
...
openair1/PHY/TOOLS/nr_phy_scope.c
View file @
ae44bc06
...
...
@@ -38,9 +38,7 @@ float tput_ue_max[NUMBER_OF_UE_MAX] = {0};
extern
int64_t
*
pss_corr_ue
[
3
];
static
void
ia_receiver_on_off
(
FL_OBJECT
*
button
,
long
arg
)
{
static
void
ia_receiver_on_off
(
FL_OBJECT
*
button
,
long
arg
)
{
if
(
fl_get_button
(
button
))
{
fl_set_object_label
(
button
,
"IA Receiver ON"
);
// PHY_vars_UE_g[0][0]->use_ia_receiver = 1;
...
...
@@ -52,9 +50,7 @@ static void ia_receiver_on_off( FL_OBJECT *button, long arg)
}
}
static
void
dl_traffic_on_off
(
FL_OBJECT
*
button
,
long
arg
)
{
static
void
dl_traffic_on_off
(
FL_OBJECT
*
button
,
long
arg
)
{
if
(
fl_get_button
(
button
))
{
fl_set_object_label
(
button
,
"DL Traffic ON"
);
otg_enabled
=
1
;
...
...
@@ -66,46 +62,37 @@ static void dl_traffic_on_off( FL_OBJECT *button, long arg)
}
}
FD_lte_phy_scope_enb
*
create_lte_phy_scope_enb
(
void
)
{
FD_lte_phy_scope_enb
*
create_lte_phy_scope_enb
(
void
)
{
FL_OBJECT
*
obj
;
FD_lte_phy_scope_enb
*
fdui
=
fl_malloc
(
sizeof
*
fdui
);
// Define form
fdui
->
lte_phy_scope_enb
=
fl_bgn_form
(
FL_NO_BOX
,
800
,
800
);
// This the whole UI box
obj
=
fl_add_box
(
FL_BORDER_BOX
,
0
,
0
,
800
,
800
,
""
);
fl_set_object_color
(
obj
,
FL_BLACK
,
FL_BLACK
);
// Received signal
fdui
->
rxsig_t
=
fl_add_xyplot
(
FL_NORMAL_XYPLOT
,
20
,
20
,
370
,
100
,
"Received Signal (Time-Domain, dB)"
);
fl_set_object_boxtype
(
fdui
->
rxsig_t
,
FL_EMBOSSED_BOX
);
fl_set_object_color
(
fdui
->
rxsig_t
,
FL_BLACK
,
FL_RED
);
fl_set_object_lcolor
(
fdui
->
rxsig_t
,
FL_WHITE
);
// Label color
fl_set_xyplot_ybounds
(
fdui
->
rxsig_t
,
10
,
70
);
// Time-domain channel response
fdui
->
chest_t
=
fl_add_xyplot
(
FL_NORMAL_XYPLOT
,
410
,
20
,
370
,
100
,
"SRS Frequency Response (samples, abs)"
);
fl_set_object_boxtype
(
fdui
->
chest_t
,
FL_EMBOSSED_BOX
);
fl_set_object_color
(
fdui
->
chest_t
,
FL_BLACK
,
FL_RED
);
fl_set_object_lcolor
(
fdui
->
chest_t
,
FL_WHITE
);
// Label color
// Frequency-domain channel response
fdui
->
chest_f
=
fl_add_xyplot
(
FL_IMPULSE_XYPLOT
,
20
,
140
,
760
,
100
,
"Channel Frequency Response (RE, dB)"
);
fl_set_object_boxtype
(
fdui
->
chest_f
,
FL_EMBOSSED_BOX
);
fl_set_object_color
(
fdui
->
chest_f
,
FL_BLACK
,
FL_RED
);
fl_set_object_lcolor
(
fdui
->
chest_f
,
FL_WHITE
);
// Label color
fl_set_xyplot_ybounds
(
fdui
->
chest_f
,
30
,
70
);
// LLR of PUSCH
fdui
->
pusch_llr
=
fl_add_xyplot
(
FL_POINTS_XYPLOT
,
20
,
260
,
500
,
200
,
"PUSCH Log-Likelihood Ratios (LLR, mag)"
);
fl_set_object_boxtype
(
fdui
->
pusch_llr
,
FL_EMBOSSED_BOX
);
fl_set_object_color
(
fdui
->
pusch_llr
,
FL_BLACK
,
FL_YELLOW
);
fl_set_object_lcolor
(
fdui
->
pusch_llr
,
FL_WHITE
);
// Label color
fl_set_xyplot_symbolsize
(
fdui
->
pusch_llr
,
2
);
// I/Q PUSCH comp
fdui
->
pusch_comp
=
fl_add_xyplot
(
FL_POINTS_XYPLOT
,
540
,
260
,
240
,
200
,
"PUSCH I/Q of MF Output"
);
fl_set_object_boxtype
(
fdui
->
pusch_comp
,
FL_EMBOSSED_BOX
);
...
...
@@ -113,7 +100,6 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
fl_set_object_lcolor
(
fdui
->
pusch_comp
,
FL_WHITE
);
// Label color
fl_set_xyplot_symbolsize
(
fdui
->
pusch_comp
,
2
);
fl_set_xyplot_xgrid
(
fdui
->
pusch_llr
,
FL_GRID_MAJOR
);
// I/Q PUCCH comp (format 1)
fdui
->
pucch_comp1
=
fl_add_xyplot
(
FL_POINTS_XYPLOT
,
540
,
480
,
240
,
100
,
"PUCCH1 Energy (SR)"
);
fl_set_object_boxtype
(
fdui
->
pucch_comp1
,
FL_EMBOSSED_BOX
);
...
...
@@ -121,7 +107,6 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
fl_set_object_lcolor
(
fdui
->
pucch_comp1
,
FL_WHITE
);
// Label color
fl_set_xyplot_symbolsize
(
fdui
->
pucch_comp1
,
2
);
// fl_set_xyplot_xgrid( fdui->pusch_llr,FL_GRID_MAJOR);
// I/Q PUCCH comp (fromat 1a/b)
fdui
->
pucch_comp
=
fl_add_xyplot
(
FL_POINTS_XYPLOT
,
540
,
600
,
240
,
100
,
"PUCCH I/Q of MF Output"
);
fl_set_object_boxtype
(
fdui
->
pucch_comp
,
FL_EMBOSSED_BOX
);
...
...
@@ -129,13 +114,11 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
fl_set_object_lcolor
(
fdui
->
pucch_comp
,
FL_WHITE
);
// Label color
fl_set_xyplot_symbolsize
(
fdui
->
pucch_comp
,
2
);
// fl_set_xyplot_xgrid( fdui->pusch_llr,FL_GRID_MAJOR);
// Throughput on PUSCH
fdui
->
pusch_tput
=
fl_add_xyplot
(
FL_NORMAL_XYPLOT
,
20
,
480
,
500
,
100
,
"PUSCH Throughput [frame]/[kbit/s]"
);
fl_set_object_boxtype
(
fdui
->
pusch_tput
,
FL_EMBOSSED_BOX
);
fl_set_object_color
(
fdui
->
pusch_tput
,
FL_BLACK
,
FL_WHITE
);
fl_set_object_lcolor
(
fdui
->
pusch_tput
,
FL_WHITE
);
// Label color
// Generic eNB Button
fdui
->
button_0
=
fl_add_button
(
FL_PUSH_BUTTON
,
20
,
600
,
240
,
40
,
""
);
fl_set_object_lalign
(
fdui
->
button_0
,
FL_ALIGN_CENTER
);
...
...
@@ -144,10 +127,8 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
fl_set_object_label
(
fdui
->
button_0
,
"DL Traffic OFF"
);
fl_set_object_color
(
fdui
->
button_0
,
FL_RED
,
FL_RED
);
fl_set_object_callback
(
fdui
->
button_0
,
dl_traffic_on_off
,
0
);
fl_end_form
(
);
fdui
->
lte_phy_scope_enb
->
fdui
=
fdui
;
return
fdui
;
}
...
...
@@ -238,7 +219,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
if (chest_t[0] !=NULL) {
for (i=0; i<(frame_parms->ofdm_symbol_size); i++) {
//i2 = (i+(frame_parms->ofdm_symbol_size>>1))%frame_parms->ofdm_symbol_size;
i2=i;
i2=i;
//time2[i] = (float)(i-(frame_parms->ofdm_symbol_size>>1));
time2[i] = (float)i;
chest_t_abs[0][i] = 10*log10((float) (1+chest_t[0][2*i2]*chest_t[0][2*i2]+chest_t[0][2*i2+1]*chest_t[0][2*i2+1]));
...
...
@@ -379,39 +360,31 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
}
*/
FD_lte_phy_scope_ue
*
create_lte_phy_scope_ue
(
void
)
{
FD_lte_phy_scope_ue
*
create_lte_phy_scope_ue
(
void
)
{
FL_OBJECT
*
obj
;
FD_lte_phy_scope_ue
*
fdui
=
fl_malloc
(
sizeof
*
fdui
);
// Define form
fdui
->
lte_phy_scope_ue
=
fl_bgn_form
(
FL_NO_BOX
,
800
,
900
);
// This the whole UI box
obj
=
fl_add_box
(
FL_BORDER_BOX
,
0
,
0
,
800
,
900
,
""
);
fl_set_object_color
(
obj
,
FL_BLACK
,
FL_BLACK
);
// Received signal
fdui
->
rxsig_t
=
fl_add_xyplot
(
FL_NORMAL_XYPLOT
,
20
,
20
,
370
,
100
,
"Received Signal (Time-Domain, dB)"
);
fl_set_object_boxtype
(
fdui
->
rxsig_t
,
FL_EMBOSSED_BOX
);
fl_set_object_color
(
fdui
->
rxsig_t
,
FL_BLACK
,
FL_RED
);
fl_set_object_lcolor
(
fdui
->
rxsig_t
,
FL_WHITE
);
// Label color
fl_set_xyplot_ybounds
(
fdui
->
rxsig_t
,
10
,
70
);
// Time-domain channel response
fdui
->
chest_t
=
fl_add_xyplot
(
FL_NORMAL_XYPLOT
,
410
,
20
,
370
,
100
,
"Channel Impulse Response (samples, abs)"
);
fl_set_object_boxtype
(
fdui
->
chest_t
,
FL_EMBOSSED_BOX
);
fl_set_object_color
(
fdui
->
chest_t
,
FL_BLACK
,
FL_RED
);
fl_set_object_lcolor
(
fdui
->
chest_t
,
FL_WHITE
);
// Label color
// Frequency-domain channel response
fdui
->
chest_f
=
fl_add_xyplot
(
FL_IMPULSE_XYPLOT
,
20
,
140
,
760
,
100
,
"Channel Frequency Response (RE, dB)"
);
fl_set_object_boxtype
(
fdui
->
chest_f
,
FL_EMBOSSED_BOX
);
fl_set_object_color
(
fdui
->
chest_f
,
FL_BLACK
,
FL_RED
);
fl_set_object_lcolor
(
fdui
->
chest_f
,
FL_WHITE
);
// Label color
fl_set_xyplot_ybounds
(
fdui
->
chest_f
,
30
,
70
);
// LLR of PBCH
fdui
->
pbch_llr
=
fl_add_xyplot
(
FL_POINTS_XYPLOT
,
20
,
260
,
500
,
100
,
"PBCH Log-Likelihood Ratios (LLR, mag)"
);
fl_set_object_boxtype
(
fdui
->
pbch_llr
,
FL_EMBOSSED_BOX
);
...
...
@@ -420,7 +393,6 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void )
fl_set_xyplot_symbolsize
(
fdui
->
pbch_llr
,
2
);
fl_set_xyplot_xgrid
(
fdui
->
pbch_llr
,
FL_GRID_MAJOR
);
//fl_set_xyplot_xbounds( fdui->pbch_llr,0,1920);
// I/Q PBCH comp
fdui
->
pbch_comp
=
fl_add_xyplot
(
FL_POINTS_XYPLOT
,
540
,
260
,
240
,
100
,
"PBCH I/Q of MF Output"
);
fl_set_object_boxtype
(
fdui
->
pbch_comp
,
FL_EMBOSSED_BOX
);
...
...
@@ -429,14 +401,12 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void )
fl_set_xyplot_symbolsize
(
fdui
->
pbch_comp
,
2
);
// fl_set_xyplot_xbounds( fdui->pbch_comp,-100,100);
// fl_set_xyplot_ybounds( fdui->pbch_comp,-100,100);
// LLR of PDCCH
fdui
->
pdcch_llr
=
fl_add_xyplot
(
FL_POINTS_XYPLOT
,
20
,
380
,
500
,
100
,
"PDCCH Log-Likelihood Ratios (LLR, mag)"
);
fl_set_object_boxtype
(
fdui
->
pdcch_llr
,
FL_EMBOSSED_BOX
);
fl_set_object_color
(
fdui
->
pdcch_llr
,
FL_BLACK
,
FL_CYAN
);
fl_set_object_lcolor
(
fdui
->
pdcch_llr
,
FL_WHITE
);
// Label color
fl_set_xyplot_symbolsize
(
fdui
->
pdcch_llr
,
2
);
// I/Q PDCCH comp
fdui
->
pdcch_comp
=
fl_add_xyplot
(
FL_POINTS_XYPLOT
,
540
,
380
,
240
,
100
,
"PDCCH I/Q of MF Output"
);
fl_set_object_boxtype
(
fdui
->
pdcch_comp
,
FL_EMBOSSED_BOX
);
...
...
@@ -444,7 +414,6 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void )
fl_set_object_lcolor
(
fdui
->
pdcch_comp
,
FL_WHITE
);
// Label color
fl_set_xyplot_symbolsize
(
fdui
->
pdcch_comp
,
2
);
fl_set_xyplot_xgrid
(
fdui
->
pdcch_llr
,
FL_GRID_MAJOR
);
// LLR of PDSCH
fdui
->
pdsch_llr
=
fl_add_xyplot
(
FL_POINTS_XYPLOT
,
20
,
500
,
500
,
200
,
"PDSCH Log-Likelihood Ratios (LLR, mag)"
);
fl_set_object_boxtype
(
fdui
->
pdsch_llr
,
FL_EMBOSSED_BOX
);
...
...
@@ -452,20 +421,17 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void )
fl_set_object_lcolor
(
fdui
->
pdsch_llr
,
FL_WHITE
);
// Label color
fl_set_xyplot_symbolsize
(
fdui
->
pdsch_llr
,
2
);
fl_set_xyplot_xgrid
(
fdui
->
pdsch_llr
,
FL_GRID_MAJOR
);
// I/Q PDSCH comp
fdui
->
pdsch_comp
=
fl_add_xyplot
(
FL_POINTS_XYPLOT
,
540
,
500
,
240
,
200
,
"PDSCH I/Q of MF Output"
);
fl_set_object_boxtype
(
fdui
->
pdsch_comp
,
FL_EMBOSSED_BOX
);
fl_set_object_color
(
fdui
->
pdsch_comp
,
FL_BLACK
,
FL_YELLOW
);
fl_set_object_lcolor
(
fdui
->
pdsch_comp
,
FL_WHITE
);
// Label color
fl_set_xyplot_symbolsize
(
fdui
->
pdsch_comp
,
2
);
// Throughput on PDSCH
fdui
->
pdsch_tput
=
fl_add_xyplot
(
FL_NORMAL_XYPLOT
,
20
,
720
,
500
,
100
,
"PDSCH Throughput [frame]/[kbit/s]"
);
fl_set_object_boxtype
(
fdui
->
pdsch_tput
,
FL_EMBOSSED_BOX
);
fl_set_object_color
(
fdui
->
pdsch_tput
,
FL_BLACK
,
FL_WHITE
);
fl_set_object_lcolor
(
fdui
->
pdsch_tput
,
FL_WHITE
);
// Label color
// Generic UE Button
fdui
->
button_0
=
fl_add_button
(
FL_PUSH_BUTTON
,
540
,
720
,
240
,
40
,
""
);
fl_set_object_lalign
(
fdui
->
button_0
,
FL_ALIGN_CENTER
);
...
...
@@ -475,10 +441,8 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void )
fl_set_object_color
(
fdui
->
button_0
,
FL_RED
,
FL_RED
);
fl_set_object_callback
(
fdui
->
button_0
,
ia_receiver_on_off
,
0
);
fl_hide_object
(
fdui
->
button_0
);
fl_end_form
(
);
fdui
->
lte_phy_scope_ue
->
fdui
=
fdui
;
return
fdui
;
}
...
...
@@ -486,14 +450,10 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
PHY_VARS_NR_UE
*
phy_vars_ue
,
int
eNB_id
,
int
UE_id
,
uint8_t
subframe
)
{
int
i
,
arx
,
atx
,
ind
,
k
;
uint8_t
subframe
)
{
NR_DL_FRAME_PARMS
*
frame_parms
=
&
phy_vars_ue
->
frame_parms
;
int
nsymb_ce
=
frame_parms
->
ofdm_symbol_size
;
//*frame_parms->symbols_per_tti;
int
samples_per_frame
=
frame_parms
->
samples_per_frame
;
uint8_t
nb_antennas_rx
=
frame_parms
->
nb_antennas_rx
;
uint8_t
nb_antennas_tx
=
frame_parms
->
nb_antenna_ports_eNB
;
int16_t
**
rxsig_t
;
float
**
rxsig_t_dB
;
float
*
time
;
...
...
@@ -510,9 +470,9 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
int16_t
*
pbch_llr
;
int16_t
*
pbch_comp
;
float
llr_pbch
[
1920
],
bit_pbch
[
1920
];
float
*
llr
,
*
bit
;
float
*
llr
,
*
bit
;
float
*
llr_pdcch
,
*
bit_pdcch
;
float
*
I
,
*
Q
;
static
__thread
float
*
I
,
*
Q
;
int
num_pdcch_symbols
=
2
;
int
num_re
=
4500
;
int
Qm
=
2
;
...
...
@@ -563,50 +523,49 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
coded_bits_per_codeword = 0; //frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti);
}
*/
I
=
(
float
*
)
calloc
(
frame_parms
->
ofdm_symbol_size
*
frame_parms
->
symbols_per_slot
*
2
,
sizeof
(
float
));
Q
=
(
float
*
)
calloc
(
frame_parms
->
ofdm_symbol_size
*
frame_parms
->
symbols_per_slot
*
2
,
sizeof
(
float
));
if
(
!
I
)
I
=
(
float
*
)
calloc
(
frame_parms
->
ofdm_symbol_size
*
frame_parms
->
symbols_per_slot
*
2
,
sizeof
(
float
));
if
(
!
Q
)
Q
=
(
float
*
)
calloc
(
frame_parms
->
ofdm_symbol_size
*
frame_parms
->
symbols_per_slot
*
2
,
sizeof
(
float
));
/*
chest_t_abs = (float**) malloc(nb_antennas_rx*sizeof(float*));
for (arx=0; arx<nb_antennas_rx; arx++) {
for (
int
arx=0; arx<nb_antennas_rx; arx++) {
chest_t_abs[arx] = (float*) calloc(frame_parms->ofdm_symbol_size,sizeof(float));
}
chest_f_abs = (float*) calloc(nsymb_ce*nb_antennas_rx*nb_antennas_tx,sizeof(float));
*/
llr
=
(
float
*
)
calloc
(
coded_bits_per_codeword
,
sizeof
(
float
));
// init to zero
llr
=
(
float
*
)
calloc
(
coded_bits_per_codeword
,
sizeof
(
float
));
// init to zero
bit
=
malloc
(
coded_bits_per_codeword
*
sizeof
(
float
));
llr_pdcch
=
(
float
*
)
calloc
(
12
*
frame_parms
->
N_RB_DL
*
num_pdcch_symbols
*
2
,
sizeof
(
float
));
// init to zero
bit_pdcch
=
(
float
*
)
calloc
(
12
*
frame_parms
->
N_RB_DL
*
num_pdcch_symbols
*
2
,
sizeof
(
float
));
rxsig_t
=
(
int16_t
**
)
phy_vars_ue
->
common_vars
.
rxdata
;
rxsig_t_dB
=
calloc
(
nb_antennas_rx
,
sizeof
(
float
*
));
llr_pdcch
=
(
float
*
)
calloc
(
12
*
frame_parms
->
N_RB_DL
*
num_pdcch_symbols
*
2
,
sizeof
(
float
));
// init to zero
bit_pdcch
=
(
float
*
)
calloc
(
12
*
frame_parms
->
N_RB_DL
*
num_pdcch_symbols
*
2
,
sizeof
(
float
));
rxsig_t
=
(
int16_t
**
)
phy_vars_ue
->
common_vars
.
rxdata
;
rxsig_t_dB
=
calloc
(
nb_antennas_rx
,
sizeof
(
float
*
));
for
(
arx
=
0
;
arx
<
nb_antennas_rx
;
arx
++
)
{
rxsig_t_dB
[
arx
]
=
(
float
*
)
calloc
(
samples_per_frame
,
sizeof
(
float
));
for
(
int
arx
=
0
;
arx
<
nb_antennas_rx
;
arx
++
)
{
rxsig_t_dB
[
arx
]
=
(
float
*
)
calloc
(
samples_per_frame
,
sizeof
(
float
));
}
time
=
calloc
(
samples_per_frame
,
sizeof
(
float
));
corr
=
calloc
(
samples_per_frame
,
sizeof
(
float
));
/*
chest_t = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[phy_vars_ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id];
chest_f = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[phy_vars_ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id];
*/
pbch_llr
=
(
int16_t
*
)
phy_vars_ue
->
pbch_vars
[
eNB_id
]
->
llr
;
pbch_comp
=
(
int16_t
*
)
phy_vars_ue
->
pbch_vars
[
eNB_id
]
->
rxdataF_comp
[
0
];
pdcch_llr
=
(
int8_t
*
)
phy_vars_ue
->
pdcch_vars
[
phy_vars_ue
->
current_thread_id
[
subframe
]][
eNB_id
]
->
llr
;
pdcch_comp
=
(
int16_t
*
)
phy_vars_ue
->
pdcch_vars
[
phy_vars_ue
->
current_thread_id
[
subframe
]][
eNB_id
]
->
rxdataF_comp
[
0
];
pdsch_llr
=
(
int16_t
*
)
phy_vars_ue
->
pdsch_vars
[
phy_vars_ue
->
current_thread_id
[
subframe
]][
eNB_id
]
->
llr
[
0
];
// stream 0
pbch_llr
=
(
int16_t
*
)
phy_vars_ue
->
pbch_vars
[
eNB_id
]
->
llr
;
pbch_comp
=
(
int16_t
*
)
phy_vars_ue
->
pbch_vars
[
eNB_id
]
->
rxdataF_comp
[
0
];
pdcch_llr
=
(
int8_t
*
)
phy_vars_ue
->
pdcch_vars
[
phy_vars_ue
->
current_thread_id
[
subframe
]][
eNB_id
]
->
llr
;
pdcch_comp
=
(
int16_t
*
)
phy_vars_ue
->
pdcch_vars
[
phy_vars_ue
->
current_thread_id
[
subframe
]][
eNB_id
]
->
rxdataF_comp
[
0
];
pdsch_llr
=
(
int16_t
*
)
phy_vars_ue
->
pdsch_vars
[
phy_vars_ue
->
current_thread_id
[
subframe
]][
eNB_id
]
->
llr
[
0
];
// stream 0
// pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars_SI[eNB_id]->llr[0]; // stream 0
pdsch_comp
=
(
int16_t
*
)
phy_vars_ue
->
pdsch_vars
[
phy_vars_ue
->
current_thread_id
[
subframe
]][
eNB_id
]
->
rxdataF_comp0
[
0
];
pdsch_comp
=
(
int16_t
*
)
phy_vars_ue
->
pdsch_vars
[
phy_vars_ue
->
current_thread_id
[
subframe
]][
eNB_id
]
->
rxdataF_comp0
[
0
];
//pdsch_mag = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_mag0[0];
// Received signal in time domain of receive antenna 0
if
(
rxsig_t
!=
NULL
)
{
if
(
rxsig_t
[
0
]
!=
NULL
)
{
for
(
i
=
0
;
i
<
samples_per_frame
;
i
++
)
{
for
(
int
i
=
0
;
i
<
samples_per_frame
;
i
++
)
{
rxsig_t_dB
[
0
][
i
]
=
10
*
log10
(
1
.
0
+
(
float
)
((
rxsig_t
[
0
][
2
*
i
])
*
(
rxsig_t
[
0
][
2
*
i
])
+
(
rxsig_t
[
0
][
2
*
i
+
1
])
*
(
rxsig_t
[
0
][
2
*
i
+
1
])));
time
[
i
]
=
(
float
)
i
;
}
...
...
@@ -628,20 +587,20 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
}
if
(
phy_vars_ue
->
is_synchronized
==
0
)
{
for
(
ind
=
0
;
ind
<
3
;
ind
++
)
{
if
(
pss_corr_ue
[
ind
])
{
for
(
i
=
0
;
i
<
samples_per_frame
;
i
++
)
{
corr
[
i
]
=
(
float
)
pss_corr_ue
[
ind
][
i
];
time
[
i
]
=
(
float
)
i
;
}
for
(
int
ind
=
0
;
ind
<
3
;
ind
++
)
{
if
(
pss_corr_ue
[
ind
])
{
for
(
int
i
=
0
;
i
<
samples_per_frame
;
i
++
)
{
corr
[
i
]
=
(
float
)
pss_corr_ue
[
ind
][
i
];
time
[
i
]
=
(
float
)
i
;
}
if
(
ind
==
0
)
fl_set_xyplot_data
(
form
->
chest_t
,
time
,
corr
,
samples_per_frame
,
""
,
""
,
""
);
else
fl_add_xyplot_overlay
(
form
->
chest_t
,
ind
,
time
,
corr
,
samples_per_frame
,
rx_antenna_colors
[
ind
]);
if
(
ind
==
0
)
fl_set_xyplot_data
(
form
->
chest_t
,
time
,
corr
,
samples_per_frame
,
""
,
""
,
""
);
else
fl_add_xyplot_overlay
(
form
->
chest_t
,
ind
,
time
,
corr
,
samples_per_frame
,
rx_antenna_colors
[
ind
]);
}
}
}
}
/*
// Channel Impulse Response (still repeated format)
...
...
@@ -724,10 +683,10 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
}
}
*/
// PBCH LLRs
if
(
pbch_llr
!=
NULL
)
{
for
(
i
=
0
;
i
<
864
;
i
++
)
{
for
(
int
i
=
0
;
i
<
864
;
i
++
)
{
llr_pbch
[
i
]
=
(
float
)
pbch_llr
[
i
];
bit_pbch
[
i
]
=
(
float
)
i
;
}
...
...
@@ -735,7 +694,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
fl_set_xyplot_data
(
form
->
pbch_llr
,
bit_pbch
,
llr_pbch
,
864
,
""
,
""
,
""
);
}
if
(
phy_vars_ue
->
is_synchronized
=
=
1
)
if
(
phy_vars_ue
->
is_synchronized
!
=
1
)
first_symbol
=
5
;
else
first_symbol
=
1
;
...
...
@@ -743,21 +702,23 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
// PBCH I/Q of MF Output
if
(
pbch_comp
!=
NULL
)
{
for
(
symbol
=
first_symbol
;
symbol
<
(
first_symbol
+
3
);
symbol
++
)
{
if
(
symbol
==
2
||
symbol
==
6
)
nb_re
=
72
;
if
(
symbol
==
2
||
symbol
==
6
)
nb_re
=
72
;
else
nb_re
=
180
;
for
(
i
=
0
;
i
<
nb_re
;
i
++
)
{
I
[
i
]
=
pbch_comp
[
2
*
symbol
*
20
*
12
+
2
*
i
];
Q
[
i
]
=
pbch_comp
[
2
*
symbol
*
20
*
12
+
2
*
i
+
1
];
nb_re
=
180
;
for
(
int
i
=
0
;
i
<
nb_re
;
i
++
)
{
I
[
i
]
=
pbch_comp
[
2
*
symbol
*
20
*
12
+
2
*
i
];
Q
[
i
]
=
pbch_comp
[
2
*
symbol
*
20
*
12
+
2
*
i
+
1
];
}
}
fl_set_xyplot_data
(
form
->
pbch_comp
,
I
,
Q
,
432
,
""
,
""
,
""
);
}
// PDCCH LLRs
if
(
pdcch_llr
!=
NULL
)
{
for
(
i
=
0
;
i
<
100
;
i
++
)
{
//12*frame_parms->N_RB_DL*2*num_pdcch_symbols
for
(
int
i
=
0
;
i
<
100
;
i
++
)
{
//12*frame_parms->N_RB_DL*2*num_pdcch_symbols
llr_pdcch
[
i
]
=
(
float
)
pdcch_llr
[
2
*
24
*
9
+
i
];
bit_pdcch
[
i
]
=
(
float
)
i
;
}
...
...
@@ -767,16 +728,17 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
// PDCCH I/Q of MF Output
if
(
pdcch_comp
!=
NULL
)
{
for
(
i
=
0
;
i
<
100
;
i
++
)
{
for
(
int
i
=
0
;
i
<
100
;
i
++
)
{
I
[
i
]
=
pdcch_comp
[
2
*
50
*
12
+
2
*
i
];
Q
[
i
]
=
pdcch_comp
[
2
*
50
*
12
+
2
*
i
+
1
];
}
fl_set_xyplot_data
(
form
->
pdcch_comp
,
I
,
Q
,
12
*
frame_parms
->
N_RB_DL
*
num_pdcch_symbols
,
""
,
""
,
""
);
}
// PDSCH LLRs
if
(
pdsch_llr
!=
NULL
)
{
for
(
i
=
0
;
i
<
coded_bits_per_codeword
;
i
++
)
{
for
(
int
i
=
0
;
i
<
coded_bits_per_codeword
;
i
++
)
{
llr
[
i
]
=
(
float
)
pdsch_llr
[
i
];
bit
[
i
]
=
(
float
)
i
;
}
...
...
@@ -787,13 +749,14 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
// PDSCH I/Q of MF Output
if
(
pdsch_comp
!=
NULL
)
{
for
(
i
=
0
;
i
<
nb_rb_pdsch
*
12
;
i
++
)
{
for
(
int
i
=
0
;
i
<
nb_rb_pdsch
*
12
;
i
++
)
{
I
[
i
]
=
pdsch_comp
[
2
*
2
*
nb_rb_pdsch
*
12
+
2
*
i
];
Q
[
i
]
=
pdsch_comp
[
2
*
2
*
nb_rb_pdsch
*
12
+
2
*
i
+
1
];
}
fl_set_xyplot_data
(
form
->
pdsch_comp
,
I
,
Q
,
nb_rb_pdsch
*
12
,
""
,
""
,
""
);
}
/*
// PDSCH Throughput
...
...
@@ -811,23 +774,19 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
fl_set_xyplot_ybounds(form->pdsch_tput,0,tput_ue_max[UE_id]);
*/
fl_check_forms
();
free
(
time
);
free
(
corr
);
for
(
arx
=
0
;
arx
<
nb_antennas_rx
;
arx
++
)
{
for
(
int
arx
=
0
;
arx
<
nb_antennas_rx
;
arx
++
)
{
free
(
rxsig_t_dB
[
arx
]);
}
free
(
rxsig_t_dB
);
free
(
I
);
free
(
Q
);
free
(
rxsig_t_dB
);
free
(
llr
);
free
(
bit
);
free
(
bit_pdcch
);
free
(
llr_pdcch
);
/*
free(chest_f_abs);
for (arx=0; arx<nb_antennas_rx; arx++) {
...
...