Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
openairinterface5G
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
16
Merge Requests
16
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
oai
openairinterface5G
Commits
cf4a005e
Commit
cf4a005e
authored
Sep 09, 2015
by
Xiwen JIANG
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Beamforming channel estimation based on UE specific reference signal
parent
5adc20ca
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
915 additions
and
222 deletions
+915
-222
openair1/PHY/INIT/lte_init.c
openair1/PHY/INIT/lte_init.c
+2
-2
openair1/PHY/LTE_ESTIMATION/bf_freq_domain_filters.m
openair1/PHY/LTE_ESTIMATION/bf_freq_domain_filters.m
+20
-20
openair1/PHY/LTE_ESTIMATION/defs.h
openair1/PHY/LTE_ESTIMATION/defs.h
+0
-1
openair1/PHY/LTE_ESTIMATION/filt12_32.h
openair1/PHY/LTE_ESTIMATION/filt12_32.h
+14
-0
openair1/PHY/LTE_ESTIMATION/lte_dl_bf_channel_estimation.c
openair1/PHY/LTE_ESTIMATION/lte_dl_bf_channel_estimation.c
+650
-34
openair1/PHY/LTE_REFSIG/defs.h
openair1/PHY/LTE_REFSIG/defs.h
+6
-2
openair1/PHY/LTE_REFSIG/lte_dl_ue_spec.c
openair1/PHY/LTE_REFSIG/lte_dl_ue_spec.c
+66
-59
openair1/PHY/LTE_REFSIG/lte_dl_uespec.c
openair1/PHY/LTE_REFSIG/lte_dl_uespec.c
+0
-0
openair1/PHY/LTE_REFSIG/lte_gold.c
openair1/PHY/LTE_REFSIG/lte_gold.c
+26
-26
openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
+57
-26
openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
+35
-31
openair1/PHY/LTE_TRANSPORT/pilots_ue_spec.c
openair1/PHY/LTE_TRANSPORT/pilots_ue_spec.c
+2
-2
openair1/PHY/LTE_TRANSPORT/proto.h
openair1/PHY/LTE_TRANSPORT/proto.h
+2
-0
openair1/PHY/MODULATION/slot_fep.c
openair1/PHY/MODULATION/slot_fep.c
+16
-8
openair1/PHY/defs.h
openair1/PHY/defs.h
+2
-2
openair1/SIMULATION/LTE_PHY/dlsim.c
openair1/SIMULATION/LTE_PHY/dlsim.c
+17
-9
No files found.
openair1/PHY/INIT/lte_init.c
View file @
cf4a005e
...
...
@@ -948,8 +948,8 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS
pdsch
->
rxdataF_uespec_pilots
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
frame_parms
->
N_RB_DL
*
12
);
pdsch
->
rxdataF_comp0
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
num
);
pdsch
->
dl_ch_estimates_ext
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
num
);
pdsch
->
dl_bf_ch_estimates
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
num
);
pdsch
->
dl_bf_ch_estimates_ext
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
frame_parms
->
symbols_per_tti
*
(
frame_parms
->
ofdm_symbol_size
+
LTE_CE_FILTER_LENGTH
)
);
pdsch
->
dl_bf_ch_estimates
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
frame_parms
->
ofdm_symbol_size
*
7
*
2
);
pdsch
->
dl_bf_ch_estimates_ext
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
num
);
pdsch
->
dl_ch_rho_ext
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
num
);
pdsch
->
dl_ch_rho2_ext
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
num
);
pdsch
->
dl_ch_mag0
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
num
);
...
...
openair1/PHY/LTE_ESTIMATION/bf_freq_domain_filters.m
View file @
cf4a005e
filt
er_length = 12
;
filt
_len = 16
;
F = -3/4:1/4:7/4;
F_l = zeros(8,
12
);
F_r = zeros(8,
12
);
F_m = zeros(8,
12
);
F_l = zeros(8,
filt_len
);
F_r = zeros(8,
filt_len
);
F_m = zeros(8,
filt_len
);
F2 =-3/5:1/5:8/5;
for i=0:3
F_l(i+1,:) = floor(16384*[F(8+i:-1:4) zeros(1,7-i)]);
F_r(i+1,:) = floor(16384*[zeros(1,4+i) F(4:end-i)]);
F_m(i+1,:) = floor(16384*[F(4-i:8) F(7:-1:1+i)]);
F_l(i+1,:) = floor(16384*[F(8+i:-1:4) zeros(1,7-i)
zeros(1,4)
]);
F_r(i+1,:) = floor(16384*[zeros(1,4+i) F(4:end-i)
zeros(1,4)
]);
F_m(i+1,:) = floor(16384*[F(4-i:8) F(7:-1:1+i)
zeros(1,4)
]);
end
for i=0:1
F_l(i+5,:) = floor(16384*[F(8:-1:4-i) zeros(1,7-i)]);
F_r(i+5,:) = floor(16384*[zeros(1,5+i) F2(5+i) F2(7:end-i)]);
F_m(i+5,:) = floor(16384*[F(4-i:8) F2(8-i) F2(6:-1:1+i)]);
F_l(i+5,:) = floor(16384*[F(8:-1:4-i) zeros(1,7-i)
zeros(1,4)
]);
F_r(i+5,:) = floor(16384*[zeros(1,5+i) F2(5+i) F2(7:end-i)
zeros(1,4)
]);
F_m(i+5,:) = floor(16384*[F(4-i:8) F2(8-i) F2(6:-1:1+i)
zeros(1,4)
]);
end
for i=2:3
F_l(i+5,:) = floor(16384*[F2(end:-1:7) F2(8-i) zeros(1,5)]);
F_r(i+5,:) = floor(16384*[zeros(1,4+i) F(4:end-i)]);
F_m(i+5,:) = floor(16384*[F2(4-i:6) F2(4+i) F(8:-1:1+i)]);
F_l(i+5,:) = floor(16384*[F2(end:-1:7) F2(8-i) zeros(1,5)
zeros(1,4)
]);
F_r(i+5,:) = floor(16384*[zeros(1,4+i) F(4:end-i)
zeros(1,4)
]);
F_m(i+5,:) = floor(16384*[F2(4-i:6) F2(4+i) F(8:-1:1+i)
zeros(1,4)
]);
end
fd = fopen("filt1
2
_32.h","w");
fd = fopen("filt1
6
_32.h","w");
for i=0:3
fprintf(fd,"short filt
12_l%d[12] = {\n",i
);
fprintf(fd,"short filt
%d_l%d[%d] = {\n",filt_len,i,filt_len
);
fprintf(fd,"%d,",F_l(i+1,1:end-1));
fprintf(fd,"%d};\n\n",F_l(i+1,end));
fprintf(fd,"short filt
12_r%d[12] = {\n",i
);
fprintf(fd,"short filt
%d_r%d[%d] = {\n",filt_len,i,filt_len
);
fprintf(fd,"%d,",F_r(i+1,1:end-1));
fprintf(fd,"%d};\n\n",F_r(i+1,end));
fprintf(fd,"short filt
12_m%d[12] = {\n",i
);
fprintf(fd,"short filt
%d_m%d[%d] = {\n",filt_len,i,filt_len
);
fprintf(fd,"%d,",F_m(i+1,1:end-1));
fprintf(fd,"%d};\n\n",F_m(i+1,end));
end
for i=0:3
fprintf(fd,"short filt
12_l%d_dc[12] = {\n",i
);
fprintf(fd,"short filt
%d_l%d_dc[%d] = {\n",filt_len,i,filt_len
);
fprintf(fd,"%d,",F_l(i+5,1:end-1));
fprintf(fd,"%d};\n\n",F_l(i+5,end));
fprintf(fd,"short filt
12_r%d_dc[12] = {\n",i
);
fprintf(fd,"short filt
%d_r%d_dc[%d] = {\n",filt_len,i,filt_len
);
fprintf(fd,"%d,",F_r(i+5,1:end-1));
fprintf(fd,"%d};\n\n",F_r(i+5,end));
fprintf(fd,"short filt
12_m%d_dc[12] = {\n",i
);
fprintf(fd,"short filt
%d_m%d_dc[%d] = {\n",filt_len,i,filt_len
);
fprintf(fd,"%d,",F_m(i+5,1:end-1));
fprintf(fd,"%d};\n\n",F_m(i+5,end));
end
...
...
openair1/PHY/LTE_ESTIMATION/defs.h
View file @
cf4a005e
...
...
@@ -123,7 +123,6 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
uint8_t
l
,
uint8_t
symbol
);
int
lte_dl_bf_channel_estimation
(
PHY_VARS_UE
*
phy_vars_ue
,
module_id_t
eNB_id
,
uint8_t
eNB_offset
,
...
...
openair1/PHY/LTE_ESTIMATION/filt12_32.h
View file @
cf4a005e
...
...
@@ -70,3 +70,17 @@ short filt12_r3_dc[12] = {
short
filt12_m3_dc
[
12
]
=
{
-
9831
,
-
6554
,
-
3277
,
0
,
3276
,
6553
,
9830
,
16384
,
12288
,
8192
,
4096
,
0
};
short
filt12_1
[
12
]
=
{
16384
,
16384
,
16384
,
16384
,
16384
,
16384
,
16384
,
16384
,
16384
,
16384
,
16384
,
16384
};
short
filt12_2l0
[
12
]
=
{
16384
,
12288
,
8192
,
4096
,
-
4096
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
short
filt12_2r0
[
12
]
=
{
0
,
4096
,
8192
,
12288
,
16384
,
20480
,
0
,
0
,
0
,
0
,
0
,
0
};
short
filt12_2l1
[
12
]
=
{
20480
,
16384
,
12288
,
8192
,
4096
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
short
filt12_2r1
[
12
]
=
{
-
4096
,
0
,
4096
,
8192
,
12288
,
16384
,
0
,
0
,
0
,
0
,
0
,
0
};
openair1/PHY/LTE_ESTIMATION/lte_dl_bf_channel_estimation.c
View file @
cf4a005e
...
...
@@ -31,10 +31,9 @@
#endif
#include "defs.h"
#include "PHY/defs.h"
#include "filt1
2
_32.h"
#include "filt1
6
_32.h"
//#define DEBUG_CH
/*To be accomplished*/
int
lte_dl_bf_channel_estimation
(
PHY_VARS_UE
*
phy_vars_ue
,
uint8_t
eNB_id
,
uint8_t
eNB_offset
,
...
...
@@ -43,53 +42,670 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
unsigned
char
symbol
)
{
unsigned
char
aarx
;
int
uespec_pilot
[
9
][
200
];
short
*
pil
,
*
rxF
;
unsigned
short
rb
,
nb_rb
=
0
;
unsigned
char
aarx
,
l
,
lprime
,
nsymb
,
skip_half
=
0
,
sss_symb
,
pss_symb
=
0
,
rb_alloc_ind
,
harq_pid
,
uespec_pilots
=
0
;
int
beamforming_mode
,
ch_offset
;
uint8_t
subframe
;
int8_t
uespec_nushift
,
uespec_poffset
=
0
,
pil_offset
;
uint8_t
pilot0
,
pilot1
,
pilot2
,
pilot3
;
//LTE_UE_PDSCH *lte_ue_pdsch_vars = phy_vars_ue->lte_ue_pdsch_vars[eNB_id];
int
**
rxdataF
=
phy_vars_ue
->
lte_ue_common_vars
.
rxdataF
;
int32_t
**
dl_bf_ch_estimates
=
phy_vars_ue
->
lte_ue_pdsch_vars
[
eNB_id
]
->
dl_bf_ch_estimates
;
short
ch
[
2
],
*
pil
,
*
rxF
,
*
dl_bf_ch
,
*
dl_bf_ch_prev
;
short
*
fl
,
*
fm
,
*
fr
,
*
fl_dc
,
*
fm_dc
,
*
fr_dc
,
*
f1
,
*
f2l
,
*
f2r
;
int
beamforming_mode
=
phy_vars_ue
->
transmission_mode
>
7
?
phy_vars_ue
->
transmission_mode
:
0
;
// define interpolation filters
//....
unsigned
int
*
rb_alloc
;
int
**
rxdataF
;
int32_t
**
dl_bf_ch_estimates
;
int
uespec_pilot
[
300
];
//ch_offset = phy_vars_ue->lte_frame_parms.ofdm_symbol_size*symbol;
LTE_DL_FRAME_PARMS
*
frame_parms
=
&
phy_vars_ue
->
lte_frame_parms
;
LTE_UE_DLSCH_t
**
dlsch_ue
=
phy_vars_ue
->
dlsch_ue
[
eNB_id
];
LTE_DL_UE_HARQ_t
*
dlsch0_harq
;
//generate ue specific pilots
if
(
beamforming_mode
==
7
)
lte_dl_ue_spec_rx
(
phy_vars_ue
,
&
uespec_pilot
[
p
-
5
][
0
],
Ns
,
p
,
0
);
else
if
(
beamforming_mode
>
7
)
lte_dl_ue_spec_rx
(
phy_vars_ue
,
&
uespec_pilot
[
p
-
6
][
0
],
Ns
,
p
,
0
);
else
if
(
beamforming_mode
==
0
)
msg
(
"No beamforming is performed.
\n
"
);
harq_pid
=
dlsch_ue
[
0
]
->
current_harq_pid
;
dlsch0_harq
=
dlsch_ue
[
0
]
->
harq_processes
[
harq_pid
];
rb_alloc
=
dlsch0_harq
->
rb_alloc
;
rxdataF
=
phy_vars_ue
->
lte_ue_common_vars
.
rxdataF
;
dl_bf_ch_estimates
=
phy_vars_ue
->
lte_ue_pdsch_vars
[
eNB_id
]
->
dl_bf_ch_estimates
;
beamforming_mode
=
phy_vars_ue
->
transmission_mode
[
eNB_id
]
>
6
?
phy_vars_ue
->
transmission_mode
[
eNB_id
]
:
0
;
if
(
phy_vars_ue
->
high_speed_flag
==
0
)
// use second channel estimate position for temporary storage
ch_offset
=
frame_parms
->
ofdm_symbol_size
;
else
msg
(
"Beamforming mode not supported yet.
\n
"
);
ch_offset
=
frame_parms
->
ofdm_symbol_size
*
symbol
;
uespec_nushift
=
frame_parms
->
Nid_cell
%
3
;
subframe
=
Ns
>>
1
;
if
(
beamforming_mode
==
7
)
{
if
(
beamforming_mode
==
7
)
{
//generate ue specific pilots
lprime
=
symbol
/
3
-
1
;
lte_dl_ue_spec_rx
(
phy_vars_ue
,
uespec_pilot
,
Ns
,
5
,
lprime
,
0
,
dlsch0_harq
->
nb_rb
);
write_output
(
"uespec_pilot_rx.m"
,
"uespec_pilot"
,
uespec_pilot
,
300
,
1
,
1
);
if
(
frame_parms
->
Ncp
==
0
){
if
(
symbol
==
3
||
symbol
==
6
||
symbol
==
9
||
symbol
==
12
)
uespec_pilots
=
1
;
}
else
{
if
(
symbol
==
4
||
symbol
==
7
||
symbol
==
10
)
uespec_pilots
=
1
;
}
for
(
aarx
=
0
;
aarx
<
phy_vars_ue
->
lte_frame_parms
.
nb_antennas_rx
;
aarx
++
)
{
if
((
frame_parms
->
Ncp
==
0
&&
(
symbol
==
6
||
symbol
==
12
))
||
(
frame_parms
->
Ncp
==
1
&&
symbol
==
7
))
uespec_poffset
=
2
;
if
(
phy_vars_ue
->
lte_frame_parms
.
Ncp
==
0
)
{
// normal prefix
pilot0
=
3
;
pilot1
=
6
;
pilot2
=
9
;
pilot3
=
12
;
}
else
{
// extended prefix
pilot0
=
4
;
pilot1
=
7
;
pilot2
=
10
;
}
//define the filter
pil_offset
=
(
uespec_nushift
+
uespec_poffset
)
%
3
;
// printf("symbol=%d,pil_offset=%d\n",symbol,pil_offset);
switch
(
pil_offset
)
{
case
0
:
fl
=
filt16_l0
;
fm
=
filt16_m0
;
fr
=
filt16_r0
;
fl_dc
=
filt16_l0
;
fm_dc
=
filt16_m0
;
fr_dc
=
filt16_r0
;
f1
=
filt16_1
;
f2l
=
filt16_2l0
;
f2r
=
filt16_2r0
;
break
;
case
1
:
fl
=
filt16_l1
;
fm
=
filt16_m1
;
fr
=
filt16_r1
;
fl_dc
=
filt16_l1
;
fm_dc
=
filt16_m1
;
fr_dc
=
filt16_r1
;
f1
=
filt16_1
;
f2l
=
filt16_2l1
;
f2r
=
filt16_2r1
;
break
;
/* pil = (short *)&uespec_pilot[0][0];
rxF = (short *)&rxdataF_uespec[aarx][(symbol-1)/3*frame_parms->N_RB_DL*(3+frame_parms->Ncp)];
dl_ch = (short *)&dl_bf_ch_estimates[aarx][ch_offset];
case
2
:
fl
=
filt16_l2
;
fm
=
filt16_m2
;
fr
=
filt16_r2
;
fl_dc
=
filt16_l2
;
fm_dc
=
filt16_m2
;
fr_dc
=
filt16_r2
;
f1
=
filt16_1
;
f2l
=
filt16_2l0
;
f2r
=
filt16_2r0
;
break
;
memset(dl_ch,0,4*(phy_vars_ue->lte_frame_parms.ofdm_symbol_size));
//estimation and interpolation */
case
3
:
fl
=
filt16_l3
;
fm
=
filt16_m3
;
fr
=
filt16_r3
;
fl_dc
=
filt16_l3
;
fm_dc
=
filt16_m3
;
fr_dc
=
filt16_r3
;
f1
=
filt16_1
;
f2l
=
filt16_2l1
;
f2r
=
filt16_2r1
;
break
;
}
}
else
if
(
beamforming_mode
==
0
)
msg
(
"lte_dl_bf_channel_estimation:No beamforming is performed.
\n
"
);
else
msg
(
"lte_dl_bf_channel_estimation:Beamforming mode not supported yet.
\n
"
);
}
else
if
(
beamforming_mode
==
0
){
msg
(
"No beamforming is performed.
\n
"
);
return
(
-
1
);
l
=
symbol
;
nsymb
=
(
frame_parms
->
Ncp
==
NORMAL
)
?
14
:
12
;
if
(
frame_parms
->
frame_type
==
TDD
)
{
//TDD
sss_symb
=
nsymb
-
1
;
pss_symb
=
2
;
}
else
{
msg
(
"Beamforming mode is not supported yet.
\n
"
)
;
return
(
-
1
)
;
sss_symb
=
(
nsymb
>>
1
)
-
2
;
pss_symb
=
(
nsymb
>>
1
)
-
1
;
}
for
(
aarx
=
0
;
aarx
<
frame_parms
->
nb_antennas_rx
;
aarx
++
)
{
rxF
=
(
short
*
)
&
rxdataF
[
aarx
][
pil_offset
+
frame_parms
->
first_carrier_offset
+
symbol
*
frame_parms
->
ofdm_symbol_size
];
pil
=
(
short
*
)
uespec_pilot
;
dl_bf_ch
=
(
short
*
)
&
dl_bf_ch_estimates
[
aarx
][
ch_offset
];
memset
(
dl_bf_ch
,
0
,
4
*
(
frame_parms
->
ofdm_symbol_size
));
//memset(dl_bf_ch,0,2*(frame_parms->ofdm_symbol_size));
if
(
phy_vars_ue
->
high_speed_flag
==
0
)
// multiply previous channel estimate by ch_est_alpha
if
(
frame_parms
->
Ncp
==
0
)
multadd_complex_vector_real_scalar
(
dl_bf_ch
-
(
frame_parms
->
ofdm_symbol_size
<<
1
),
phy_vars_ue
->
ch_est_alpha
,
dl_bf_ch
-
(
frame_parms
->
ofdm_symbol_size
<<
1
),
1
,
frame_parms
->
ofdm_symbol_size
);
else
msg
(
"lte_dl_bf_channel_estimation: beamforming channel estimation not supported for TM7 Extended CP.
\n
"
);
// phy_vars_ue->ch_est_beta should be defined equaling 1/3
//estimation and interpolation
if
((
frame_parms
->
N_RB_DL
&
1
)
==
0
)
// even number of RBs
for
(
rb
=
0
;
rb
<
frame_parms
->
N_RB_DL
;
rb
++
)
{
if
(
rb
<
32
)
rb_alloc_ind
=
(
rb_alloc
[
0
]
>>
rb
)
&
1
;
else
if
(
rb
<
64
)
rb_alloc_ind
=
(
rb_alloc
[
1
]
>>
(
rb
-
32
))
&
1
;
else
if
(
rb
<
96
)
rb_alloc_ind
=
(
rb_alloc
[
2
]
>>
(
rb
-
64
))
&
1
;
else
if
(
rb
<
100
)
rb_alloc_ind
=
(
rb_alloc
[
3
]
>>
(
rb
-
96
))
&
1
;
else
rb_alloc_ind
=
0
;
// For second half of RBs skip DC carrier
if
(
rb
==
(
frame_parms
->
N_RB_DL
>>
1
))
{
rxF
=
&
rxdataF
[
aarx
][(
1
+
(
symbol
*
(
frame_parms
->
ofdm_symbol_size
)))];
}
if
(
rb_alloc_ind
==
1
)
{
if
(
uespec_pilots
==
1
)
{
if
(
beamforming_mode
==
7
)
{
if
(
frame_parms
->
Ncp
==
0
)
{
ch
[
0
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
0
]
-
(
int
)
pil
[
1
]
*
rxF
[
1
])
>>
15
);
ch
[
1
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
1
]
+
(
int
)
pil
[
1
]
*
rxF
[
0
])
>>
15
);
multadd_real_vector_complex_scalar
(
fl
,
ch
,
dl_bf_ch
,
16
);
//printf("rxF[%d]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",pil_offset,rxF[0],rxF[1],pil[0],pil[1],ch[0],ch[1]);
ch
[
0
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
8
]
-
(
int
)
pil
[
1
]
*
rxF
[
9
])
>>
15
);
ch
[
1
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
9
]
+
(
int
)
pil
[
1
]
*
rxF
[
8
])
>>
15
);
multadd_real_vector_complex_scalar
(
fm
,
ch
,
dl_bf_ch
,
16
);
ch
[
0
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
16
]
-
(
int
)
pil
[
1
]
*
rxF
[
17
])
>>
15
);
ch
[
1
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
17
]
+
(
int
)
pil
[
1
]
*
rxF
[
16
])
>>
15
);
multadd_real_vector_complex_scalar
(
fr
,
ch
,
dl_bf_ch
,
16
);
}
}
else
{
msg
(
"lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c):TM7 beamgforming channel estimation not supported for extented CP
\n
"
);
exit
(
-
1
);
}
}
else
{
msg
(
"lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c): transmission mode not supported.
\n
"
);
}
nb_rb
++
;
}
rxF
+=
24
;
dl_bf_ch
+=
24
;
}
else
{
// Odd number of RBs
for
(
rb
=
0
;
rb
<
frame_parms
->
N_RB_DL
>>
1
;
rb
++
)
{
skip_half
=
0
;
if
(
rb
<
32
)
rb_alloc_ind
=
(
rb_alloc
[
0
]
>>
rb
)
&
1
;
else
if
(
rb
<
64
)
rb_alloc_ind
=
(
rb_alloc
[
1
]
>>
(
rb
-
32
))
&
1
;
else
if
(
rb
<
96
)
rb_alloc_ind
=
(
rb_alloc
[
2
]
>>
(
rb
-
64
))
&
1
;
else
if
(
rb
<
100
)
rb_alloc_ind
=
(
rb_alloc
[
3
]
>>
(
rb
-
96
))
&
1
;
else
rb_alloc_ind
=
0
;
// PBCH
if
((
subframe
==
0
)
&&
(
rb
>
((
frame_parms
->
N_RB_DL
>>
1
)
-
3
))
&&
(
rb
<
((
frame_parms
->
N_RB_DL
>>
1
)
+
3
))
&&
(
l
>=
(
nsymb
>>
1
))
&&
(
l
<
((
nsymb
>>
1
)
+
4
)))
{
rb_alloc_ind
=
0
;
}
//PBCH subframe 0, symbols nsymb>>1 ... nsymb>>1 + 3
if
((
subframe
==
0
)
&&
(
rb
==
((
frame_parms
->
N_RB_DL
>>
1
)
-
3
))
&&
(
l
>=
(
nsymb
>>
1
))
&&
(
l
<
((
nsymb
>>
1
)
+
4
)))
skip_half
=
1
;
else
if
((
subframe
==
0
)
&&
(
rb
==
((
frame_parms
->
N_RB_DL
>>
1
)
+
3
))
&&
(
l
>=
(
nsymb
>>
1
))
&&
(
l
<
((
nsymb
>>
1
)
+
4
)))
skip_half
=
2
;
//SSS
if
(((
subframe
==
0
)
||
(
subframe
==
5
))
&&
(
rb
>
((
frame_parms
->
N_RB_DL
>>
1
)
-
3
))
&&
(
rb
<
((
frame_parms
->
N_RB_DL
>>
1
)
+
3
))
&&
(
l
==
sss_symb
)
)
{
rb_alloc_ind
=
0
;
}
//SSS
if
(((
subframe
==
0
)
||
(
subframe
==
5
))
&&
(
rb
==
((
frame_parms
->
N_RB_DL
>>
1
)
-
3
))
&&
(
l
==
sss_symb
))
skip_half
=
1
;
else
if
(((
subframe
==
0
)
||
(
subframe
==
5
))
&&
(
rb
==
((
frame_parms
->
N_RB_DL
>>
1
)
+
3
))
&&
(
l
==
sss_symb
))
skip_half
=
2
;
//PSS in subframe 0/5 if FDD
if
(
frame_parms
->
frame_type
==
FDD
)
{
//FDD
if
(((
subframe
==
0
)
||
(
subframe
==
5
))
&&
(
rb
>
((
frame_parms
->
N_RB_DL
>>
1
)
-
3
))
&&
(
rb
<
((
frame_parms
->
N_RB_DL
>>
1
)
+
3
))
&&
(
l
==
pss_symb
)
)
{
rb_alloc_ind
=
0
;
}
if
(((
subframe
==
0
)
||
(
subframe
==
5
))
&&
(
rb
==
((
frame_parms
->
N_RB_DL
>>
1
)
-
3
))
&&
(
l
==
pss_symb
))
skip_half
=
1
;
else
if
(((
subframe
==
0
)
||
(
subframe
==
5
))
&&
(
rb
==
((
frame_parms
->
N_RB_DL
>>
1
)
+
3
))
&&
(
l
==
pss_symb
))
skip_half
=
2
;
}
if
((
frame_parms
->
frame_type
==
TDD
)
&&
(
subframe
==
6
))
{
//TDD Subframe 6
if
((
rb
>
((
frame_parms
->
N_RB_DL
>>
1
)
-
3
))
&&
(
rb
<
((
frame_parms
->
N_RB_DL
>>
1
)
+
3
))
&&
(
l
==
pss_symb
)
)
{
rb_alloc_ind
=
0
;
}
if
((
rb
==
((
frame_parms
->
N_RB_DL
>>
1
)
-
3
))
&&
(
l
==
pss_symb
))
skip_half
=
1
;
else
if
((
rb
==
((
frame_parms
->
N_RB_DL
>>
1
)
+
3
))
&&
(
l
==
pss_symb
))
skip_half
=
2
;
}
//printf("symbol=%d,pil_offset=%d\ni,rb_alloc_ind=%d,uespec_pilots=%d,beamforming_mode=%d,Ncp=%d,skip_half=%d\n",symbol,pil_offset,rb_alloc_ind,uespec_pilots,beamforming_mode,frame_parms->Ncp,skip_half);
if
(
rb_alloc_ind
==
1
)
{
if
(
uespec_pilots
==
1
)
{
if
(
beamforming_mode
==
7
)
{
if
(
frame_parms
->
Ncp
==
0
)
{
if
(
skip_half
==
1
)
{
if
(
pil_offset
<
2
)
{
ch
[
0
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
0
]
-
(
int
)
pil
[
1
]
*
rxF
[
1
])
>>
15
);
ch
[
1
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
1
]
+
(
int
)
pil
[
1
]
*
rxF
[
0
])
>>
15
);
multadd_real_vector_complex_scalar
(
f2l
,
ch
,
dl_bf_ch
,
16
);
pil
+=
2
;
ch
[
0
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
8
]
-
(
int
)
pil
[
1
]
*
rxF
[
9
])
>>
15
);
ch
[
1
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
9
]
+
(
int
)
pil
[
1
]
*
rxF
[
8
])
>>
15
);
multadd_real_vector_complex_scalar
(
f2r
,
ch
,
dl_bf_ch
,
16
);
pil
+=
2
;
}
else
{
ch
[
0
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
0
]
-
(
int
)
pil
[
1
]
*
rxF
[
1
])
>>
15
);
ch
[
1
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
1
]
+
(
int
)
pil
[
1
]
*
rxF
[
0
])
>>
15
);
multadd_real_vector_complex_scalar
(
f1
,
ch
,
dl_bf_ch
,
16
);
pil
+=
2
;
}
}
else
if
(
skip_half
==
2
)
{
if
(
pil_offset
<
2
)
{
ch
[
0
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
16
]
-
(
int
)
pil
[
1
]
*
rxF
[
17
])
>>
15
);
ch
[
1
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
17
]
+
(
int
)
pil
[
1
]
*
rxF
[
16
])
>>
15
);
multadd_real_vector_complex_scalar
(
f1
,
ch
,
dl_bf_ch
,
16
);
pil
+=
2
;
}
else
{
ch
[
0
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
8
]
-
(
int
)
pil
[
1
]
*
rxF
[
9
])
>>
15
);
ch
[
1
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
9
]
+
(
int
)
pil
[
1
]
*
rxF
[
8
])
>>
15
);
multadd_real_vector_complex_scalar
(
f2l
,
ch
,
dl_bf_ch
,
16
);
pil
+=
2
;
ch
[
0
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
16
]
-
(
int
)
pil
[
1
]
*
rxF
[
17
])
>>
15
);
ch
[
1
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
17
]
+
(
int
)
pil
[
1
]
*
rxF
[
16
])
>>
15
);
multadd_real_vector_complex_scalar
(
f2r
,
ch
,
dl_bf_ch
,
16
);
pil
+=
2
;
}
}
else
{
ch
[
0
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
0
]
-
(
int
)
pil
[
1
]
*
rxF
[
1
])
>>
15
);
ch
[
1
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
1
]
+
(
int
)
pil
[
1
]
*
rxF
[
0
])
>>
15
);
multadd_real_vector_complex_scalar
(
fl
,
ch
,
dl_bf_ch
,
16
);
//printf("symbol=%d,rxF[%d]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,pil_offset,rxF[0],rxF[1],pil[0],pil[1],ch[0],ch[1]);
pil
+=
2
;
ch
[
0
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
8
]
-
(
int
)
pil
[
1
]
*
rxF
[
9
])
>>
15
);
ch
[
1
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
9
]
+
(
int
)
pil
[
1
]
*
rxF
[
8
])
>>
15
);
multadd_real_vector_complex_scalar
(
fm
,
ch
,
dl_bf_ch
,
16
);
//printf("symbol=%d,rxF[%d]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,pil_offset,rxF[0],rxF[1],pil[0],pil[1],ch[0],ch[1]);
pil
+=
2
;
ch
[
0
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
16
]
-
(
int
)
pil
[
1
]
*
rxF
[
17
])
>>
15
);
ch
[
1
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
17
]
+
(
int
)
pil
[
1
]
*
rxF
[
16
])
>>
15
);
multadd_real_vector_complex_scalar
(
fr
,
ch
,
dl_bf_ch
,
16
);
//printf("symbol=%d,rxF[%d]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,pil_offset,rxF[0],rxF[1],pil[0],pil[1],ch[0],ch[1]);
pil
+=
2
;
}
}
else
{
msg
(
"lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c):TM7 beamgforming channel estimation not supported for extented CP
\n
"
);
exit
(
-
1
);
}
}
else
{
msg
(
"lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c):transmission mode not supported.
\n
"
);
}
}
nb_rb
++
;
}
rxF
+=
24
;
dl_bf_ch
+=
24
;
}
// first half loop
// Do middle RB (around DC)
if
(
rb
<
32
)
rb_alloc_ind
=
(
rb_alloc
[
0
]
>>
rb
)
&
1
;
else
if
(
rb
<
64
)
rb_alloc_ind
=
(
rb_alloc
[
1
]
>>
(
rb
-
32
))
&
1
;
else
if
(
rb
<
96
)
rb_alloc_ind
=
(
rb_alloc
[
2
]
>>
(
rb
-
64
))
&
1
;
else
if
(
rb
<
100
)
rb_alloc_ind
=
(
rb_alloc
[
3
]
>>
(
rb
-
96
))
&
1
;
else
rb_alloc_ind
=
0
;
// PBCH
if
((
subframe
==
0
)
&&
(
rb
>=
((
frame_parms
->
N_RB_DL
>>
1
)
-
3
))
&&
(
rb
<
((
frame_parms
->
N_RB_DL
>>
1
)
+
3
))
&&
(
l
>=
(
nsymb
>>
1
))
&&
(
l
<
((
nsymb
>>
1
)
+
4
)))
{
rb_alloc_ind
=
0
;
}
//SSS
if
(((
subframe
==
0
)
||
(
subframe
==
5
))
&&
(
rb
>=
((
frame_parms
->
N_RB_DL
>>
1
)
-
3
))
&&
(
rb
<
((
frame_parms
->
N_RB_DL
>>
1
)
+
3
))
&&
(
l
==
sss_symb
)
)
{
rb_alloc_ind
=
0
;
}
if
(
frame_parms
->
frame_type
==
FDD
)
{
//PSS
if
(((
subframe
==
0
)
||
(
subframe
==
5
))
&&
(
rb
>=
((
frame_parms
->
N_RB_DL
>>
1
)
-
3
))
&&
(
rb
<
((
frame_parms
->
N_RB_DL
>>
1
)
+
3
))
&&
(
l
==
pss_symb
)
)
{
rb_alloc_ind
=
0
;
}
}
if
((
frame_parms
->
frame_type
==
TDD
)
&&
(
subframe
==
6
))
{
//PSS
if
((
rb
>
((
frame_parms
->
N_RB_DL
>>
1
)
-
3
))
&&
(
rb
<
((
frame_parms
->
N_RB_DL
>>
1
)
+
3
))
&&
(
l
==
pss_symb
)
)
{
rb_alloc_ind
=
0
;
}
}
//printf("DC rb %d (%p)\n",rb,rxF);
if
(
rb_alloc_ind
==
1
)
{
if
(
pil_offset
<
2
)
{
ch
[
0
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
0
]
-
(
int
)
pil
[
1
]
*
rxF
[
1
])
>>
15
);
ch
[
1
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
1
]
+
(
int
)
pil
[
1
]
*
rxF
[
0
])
>>
15
);
multadd_real_vector_complex_scalar
(
fl_dc
,
ch
,
dl_bf_ch
,
16
);
//printf("symbol=%d,rxF[%d]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,pil_offset,rxF[0],rxF[1],pil[0],pil[1],ch[0],ch[1]);
pil
+=
2
;;
ch
[
0
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
8
]
-
(
int
)
pil
[
1
]
*
rxF
[
9
])
>>
15
);
ch
[
1
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
9
]
+
(
int
)
pil
[
1
]
*
rxF
[
8
])
>>
15
);
multadd_real_vector_complex_scalar
(
fm_dc
,
ch
,
dl_bf_ch
,
16
);
//printf("symbol=%d,rxF[%d]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,pil_offset,rxF[8],rxF[9],pil[0],pil[1],ch[0],ch[1]);
pil
+=
2
;;
rxF
=
(
short
*
)
&
rxdataF
[
aarx
][
symbol
*
(
frame_parms
->
ofdm_symbol_size
)];
ch
[
0
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
6
]
-
(
int
)
pil
[
1
]
*
rxF
[
7
])
>>
15
);
ch
[
1
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
7
]
+
(
int
)
pil
[
1
]
*
rxF
[
6
])
>>
15
);
multadd_real_vector_complex_scalar
(
fr_dc
,
ch
,
dl_bf_ch
,
16
);
//printf("symbol=%d,rxF[%d]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,pil_offset,rxF[6],rxF[7],pil[0],pil[1],ch[0],ch[1]);
pil
+=
2
;;
}
else
{
ch
[
0
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
0
]
-
(
int
)
pil
[
1
]
*
rxF
[
1
])
>>
15
);
ch
[
1
]
=
(
short
)(((
int
)
pil
[
0
]
*
rxF
[
1
]
+
(
int
)
pil
[
1
]
*
rxF
[
0
])
>>
15
);
multadd_real_vector_complex_scalar
(
fl_dc
,
ch
,
dl_bf_ch
,
16
);
//printf("symbol=%d,rxF[%d]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,pil_offset,rxF[0],rxF[1],pil[0],pil[1],ch[0],ch[1]);
pil
+=
2
;;