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
spbro
OpenXG-RAN
Commits
28378406
Commit
28378406
authored
Jan 23, 2022
by
sfn
Committed by
Thomas Schlichter
Jan 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement and test foating point calc for zero forcing
parent
b4a87655
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
229 additions
and
95 deletions
+229
-95
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
+229
-95
No files found.
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
View file @
28378406
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
#include "PHY/NR_REFSIG/nr_refsig.h"
#include "PHY/NR_REFSIG/nr_refsig.h"
#include "PHY/NR_REFSIG/dmrs_nr.h"
#include "PHY/NR_REFSIG/dmrs_nr.h"
#include "common/utils/nr/nr_common.h"
#include "common/utils/nr/nr_common.h"
#include <complex.h>
/* dynamic shift for LLR computation for TM3/4
/* dynamic shift for LLR computation for TM3/4
* set as command line argument, see lte-softmodem.c
* set as command line argument, see lte-softmodem.c
...
@@ -2036,6 +2037,172 @@ void nr_determin(int32_t **a44,//
...
@@ -2036,6 +2037,172 @@ void nr_determin(int32_t **a44,//
_m_empty
();
_m_empty
();
}
}
double
complex
nr_determin_cpx
(
double
complex
*
a44_cpx
,
//
int32_t
size
,
//size
int32_t
sign
){
double
complex
outtemp
,
outtemp1
;
//Allocate the submatrix elements
double
complex
sub_matrix
[(
size
-
1
)
*
(
size
-
1
)];
int16_t
k
,
rr
[
size
-
1
],
cc
[
size
-
1
];
if
(
size
==
1
)
{
return
((
double
complex
)
a44_cpx
[
0
]
*
sign
);
}
else
{
outtemp1
=
0
;
for
(
int
rtx
=
0
;
rtx
<
size
;
rtx
++
)
{
//row calculation for determin
int
ctx
=
0
;
//find the submatrix row and column indices
k
=
0
;
for
(
int
rrtx
=
0
;
rrtx
<
size
;
rrtx
++
)
if
(
rrtx
!=
rtx
)
rr
[
k
++
]
=
rrtx
;
k
=
0
;
for
(
int
cctx
=
0
;
cctx
<
size
;
cctx
++
)
if
(
cctx
!=
ctx
)
cc
[
k
++
]
=
cctx
;
//fill out the sub matrix corresponds to this element
for
(
int
ridx
=
0
;
ridx
<
(
size
-
1
);
ridx
++
)
for
(
int
cidx
=
0
;
cidx
<
(
size
-
1
);
cidx
++
)
sub_matrix
[
cidx
*
(
size
-
1
)
+
ridx
]
=
a44_cpx
[
cc
[
cidx
]
*
size
+
rr
[
ridx
]];
outtemp
=
nr_determin_cpx
(
sub_matrix
,
//a33
size
-
1
,
((
rtx
&
1
)
==
1
?-
1
:
1
)
*
((
ctx
&
1
)
==
1
?-
1
:
1
)
*
sign
);
outtemp1
+=
a44_cpx
[
ctx
*
size
+
rtx
]
*
outtemp
;
}
return
((
double
complex
)
outtemp1
);
}
}
/* Zero Forcing Rx function: nr_matrix_inverse()
* Compute the matrix inverse and determinant up to 4x4 Matrix
*
* */
uint8_t
nr_matrix_inverse
(
int32_t
**
a44
,
//Input matrix//conjH_H_elements[0]
int32_t
**
inv_H_h_H
,
//Inverse
int32_t
*
ad_bc
,
//determin
int32_t
size
,
unsigned
short
nb_rb
,
int32_t
flag
,
//fixed point or floating flag
int32_t
shift0
){
int16_t
k
,
rr
[
size
-
1
],
cc
[
size
-
1
];
if
(
flag
)
{
//fixed point SIMD calc.
//Allocate the submatrix elements
int32_t
**
sub_matrix
;
sub_matrix
=
(
int32_t
**
)
malloc16_clear
(
(
size
-
1
)
*
(
size
-
1
)
*
sizeof
(
int32_t
*
)
);
for
(
int
rtx
=
0
;
rtx
<
(
size
-
1
);
rtx
++
)
{
//row
for
(
int
ctx
=
0
;
ctx
<
(
size
-
1
);
ctx
++
)
{
//column
sub_matrix
[
ctx
*
(
size
-
1
)
+
rtx
]
=
(
int32_t
*
)
malloc16_clear
(
12
*
nb_rb
*
sizeof
(
int32_t
)
);
}
}
//Compute Matrix determinant
nr_determin
(
a44
,
//
ad_bc
,
//determinant
size
,
//size
nb_rb
,
+
1
,
shift0
);
print_shorts
(
"nr_det_"
,(
int16_t
*
)
&
ad_bc
[
0
]);
//Compute Inversion of the H^*H matrix
/* For 2x2 MIMO matrix, we compute
* * |(conj_H_00xH_00+conj_H_10xH_10) (conj_H_00xH_01+conj_H_10xH_11)|
* * H_h_H= | |
* * |(conj_H_01xH_00+conj_H_11xH_10) (conj_H_01xH_01+conj_H_11xH_11)|
* *
* *inv(H_h_H) =(1/det)*[d -b
* * -c a]
* **************************************************************************/
for
(
int
rtx
=
0
;
rtx
<
size
;
rtx
++
)
{
//row
k
=
0
;
for
(
int
rrtx
=
0
;
rrtx
<
size
;
rrtx
++
)
if
(
rrtx
!=
rtx
)
rr
[
k
++
]
=
rrtx
;
for
(
int
ctx
=
0
;
ctx
<
size
;
ctx
++
)
{
//column
k
=
0
;
for
(
int
cctx
=
0
;
cctx
<
size
;
cctx
++
)
if
(
cctx
!=
ctx
)
cc
[
k
++
]
=
cctx
;
//fill out the sub matrix corresponds to this element
for
(
int
ridx
=
0
;
ridx
<
(
size
-
1
);
ridx
++
)
for
(
int
cidx
=
0
;
cidx
<
(
size
-
1
);
cidx
++
)
sub_matrix
[
cidx
*
(
size
-
1
)
+
ridx
]
=
(
int32_t
*
)
&
a44
[
cc
[
cidx
]
*
size
+
rr
[
ridx
]][
0
];
nr_determin
(
sub_matrix
,
inv_H_h_H
[
rtx
*
size
+
ctx
],
//out transpose
size
-
1
,
//size
nb_rb
,
((
rtx
&
1
)
==
1
?-
1
:
1
)
*
((
ctx
&
1
)
==
1
?-
1
:
1
),
shift0
);
printf
(
"H_h_H(r%d,c%d)=%d+j%d --> inv_H_h_H(%d,%d) = %d+j%d
\n
"
,
rtx
,
ctx
,((
short
*
)
a44
[
ctx
*
size
+
rtx
])[
0
],((
short
*
)
a44
[
ctx
*
size
+
rtx
])[
1
],
ctx
,
rtx
,((
short
*
)
inv_H_h_H
[
rtx
*
size
+
ctx
])[
0
],((
short
*
)
inv_H_h_H
[
rtx
*
size
+
ctx
])[
1
]);
}
}
_mm_empty
();
_m_empty
();
}
else
{
//floating point calc.
//Allocate the submatrix elements
double
complex
sub_matrix_cpx
[(
size
-
1
)
*
(
size
-
1
)];
//Convert the IQ samples (in Q15 format) to float complex
double
complex
a44_cpx
[
size
*
size
];
double
complex
inv_H_h_H_cpx
[
size
*
size
];
double
complex
determin_cpx
;
for
(
int
i
=
0
;
i
<
12
*
nb_rb
;
i
++
)
{
for
(
int
rtx
=
0
;
rtx
<
size
;
rtx
++
)
{
//row
for
(
int
ctx
=
0
;
ctx
<
size
;
ctx
++
)
{
//column
a44_cpx
[
ctx
*
size
+
rtx
]
=
((
double
)((
short
*
)
a44
[
ctx
*
size
+
rtx
])[(
i
<<
1
)])
+
I
*
((
double
)((
short
*
)
a44
[
ctx
*
size
+
rtx
])[(
i
<<
1
)
+
1
]);
}
}
//Compute Matrix determinant (copy real value only)
determin_cpx
=
nr_determin_cpx
(
a44_cpx
,
//
size
,
//size
+
1
);
if
(
i
<
4
)
printf
(
"nr_det_cpx = %lf+j%lf
\n
"
,
creal
(
determin_cpx
)
/
(
1
<<
(
size
-
1
)
*
shift0
),
cimag
(
determin_cpx
)
/
(
1
<<
(
size
-
1
)
*
shift0
));
//Round and convert to Q15
if
(
creal
(
determin_cpx
)
>
0
)
//determin of the symmetric matrix is real part only
((
short
*
)
ad_bc
)[
i
<<
1
]
=
(
short
)
((
creal
(
determin_cpx
)
/
(
1
<<
(
size
-
1
)
*
shift0
))
+
0
.
5
);
//
else
((
short
*
)
ad_bc
)[
i
<<
1
]
=
(
short
)
((
creal
(
determin_cpx
)
/
(
1
<<
(
size
-
1
)
*
shift0
))
-
0
.
5
);
//
((
short
*
)
ad_bc
)[(
i
<<
1
)
+
1
]
=
(
short
)
0
;
//Imag=0
//Compute Inversion of the H^*H matrix
for
(
int
rtx
=
0
;
rtx
<
size
;
rtx
++
)
{
//row
k
=
0
;
for
(
int
rrtx
=
0
;
rrtx
<
size
;
rrtx
++
)
if
(
rrtx
!=
rtx
)
rr
[
k
++
]
=
rrtx
;
for
(
int
ctx
=
0
;
ctx
<
size
;
ctx
++
)
{
//column
k
=
0
;
for
(
int
cctx
=
0
;
cctx
<
size
;
cctx
++
)
if
(
cctx
!=
ctx
)
cc
[
k
++
]
=
cctx
;
//fill out the sub matrix corresponds to this element
for
(
int
ridx
=
0
;
ridx
<
(
size
-
1
);
ridx
++
)
for
(
int
cidx
=
0
;
cidx
<
(
size
-
1
);
cidx
++
)
sub_matrix_cpx
[
cidx
*
(
size
-
1
)
+
ridx
]
=
a44_cpx
[
cc
[
cidx
]
*
size
+
rr
[
ridx
]];
inv_H_h_H_cpx
[
rtx
*
size
+
ctx
]
=
nr_determin_cpx
(
sub_matrix_cpx
,
//
size
-
1
,
//size
((
rtx
&
1
)
==
1
?-
1
:
1
)
*
((
ctx
&
1
)
==
1
?-
1
:
1
))
/
determin_cpx
;
if
(
i
==
0
)
printf
(
"H_h_H(r%d,c%d)=%lf+j%lf --> inv_H_h_H(%d,%d) = %lf+j%lf
\n
"
,
rtx
,
ctx
,
creal
(
a44_cpx
[
ctx
*
size
+
rtx
]),
cimag
(
a44_cpx
[
ctx
*
size
+
rtx
]),
ctx
,
rtx
,
creal
(
inv_H_h_H_cpx
[
rtx
*
size
+
ctx
])
*
(
1
<<
15
),
cimag
(
inv_H_h_H_cpx
[
rtx
*
size
+
ctx
])
*
(
1
<<
15
));
if
(
creal
(
inv_H_h_H_cpx
[
rtx
*
size
+
ctx
])
>
0
)
((
short
*
)
inv_H_h_H
[
rtx
*
size
+
ctx
])[
i
<<
1
]
=
(
short
)
((
creal
(
inv_H_h_H_cpx
[
rtx
*
size
+
ctx
])
*
(
1
<<
15
))
+
0
.
5
);
//
else
((
short
*
)
inv_H_h_H
[
rtx
*
size
+
ctx
])[
i
<<
1
]
=
(
short
)
((
creal
(
inv_H_h_H_cpx
[
rtx
*
size
+
ctx
])
*
(
1
<<
15
))
-
0
.
5
);
//
if
(
cimag
(
inv_H_h_H_cpx
[
rtx
*
size
+
ctx
])
>
0
)
((
short
*
)
inv_H_h_H
[
rtx
*
size
+
ctx
])[(
i
<<
1
)
+
1
]
=
(
short
)
((
cimag
(
inv_H_h_H_cpx
[
rtx
*
size
+
ctx
])
*
(
1
<<
15
))
+
0
.
5
);
//
else
((
short
*
)
inv_H_h_H
[
rtx
*
size
+
ctx
])[(
i
<<
1
)
+
1
]
=
(
short
)
((
cimag
(
inv_H_h_H_cpx
[
rtx
*
size
+
ctx
])
*
(
1
<<
15
))
-
0
.
5
);
//
}
}
}
}
return
(
0
);
}
/* Zero Forcing Rx function: nr_conjch0_mult_ch1()
/* Zero Forcing Rx function: nr_conjch0_mult_ch1()
*
*
*
*
...
@@ -2101,11 +2268,9 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp,
...
@@ -2101,11 +2268,9 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp,
int
length
)
int
length
)
{
{
int
*
ch0r
,
*
ch0c
;
int
*
ch0r
,
*
ch0c
;
int32_t
determ_fin
[
12
*
nb_rb
]
__attribute__
((
aligned
(
32
)));
int32_t
***
conjH_H_elements
;
int32_t
***
conjH_H_elements
;
uint32_t
nb_rb_0
=
length
/
12
+
((
length
%
12
)
?
1
:
0
);
uint32_t
nb_rb_0
=
length
/
12
+
((
length
%
12
)
?
1
:
0
);
int32_t
determ_fin
[
12
*
nb_rb_0
]
__attribute__
((
aligned
(
32
)));
///Allocate H^*H matrix elements and sub elements
///Allocate H^*H matrix elements and sub elements
conjH_H_elements
=
(
int32_t
***
)
malloc16_clear
(
n_rx
*
sizeof
(
int32_t
**
)
);
conjH_H_elements
=
(
int32_t
***
)
malloc16_clear
(
n_rx
*
sizeof
(
int32_t
**
)
);
...
@@ -2113,7 +2278,7 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp,
...
@@ -2113,7 +2278,7 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp,
conjH_H_elements
[
aarx
]
=
(
int32_t
**
)
malloc16_clear
(
n_tx
*
n_tx
*
sizeof
(
int32_t
)
);
conjH_H_elements
[
aarx
]
=
(
int32_t
**
)
malloc16_clear
(
n_tx
*
n_tx
*
sizeof
(
int32_t
)
);
for
(
int
rtx
=
0
;
rtx
<
n_tx
;
rtx
++
)
{
//row
for
(
int
rtx
=
0
;
rtx
<
n_tx
;
rtx
++
)
{
//row
for
(
int
ctx
=
0
;
ctx
<
n_tx
;
ctx
++
)
{
//column
for
(
int
ctx
=
0
;
ctx
<
n_tx
;
ctx
++
)
{
//column
conjH_H_elements
[
aarx
][
ctx
*
n_tx
+
rtx
]
=
(
int32_t
*
)
malloc16_clear
(
12
*
nb_rb
*
sizeof
(
int32_t
*
)
);
conjH_H_elements
[
aarx
][
ctx
*
n_tx
+
rtx
]
=
(
int32_t
*
)
malloc16_clear
(
12
*
nb_rb
_0
*
sizeof
(
int32_t
*
)
);
}
}
}
}
}
}
...
@@ -2136,71 +2301,32 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp,
...
@@ -2136,71 +2301,32 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp,
}
}
}
}
int16_t
k
,
rr
[
n_tx
-
1
],
cc
[
n_tx
-
1
];
//Compute the inverse and determinant of the H^*H matrix
int
fpshift
=
6
;
//Allocate the inverse matrix
//Allocate the inversion matrix and submatrix elements
int32_t
**
inv_H_h_H
;
int32_t
**
inv_H_h_H
;
int32_t
**
sub_matrix
;
inv_H_h_H
=
(
int32_t
**
)
malloc16_clear
(
n_tx
*
n_tx
*
sizeof
(
int32_t
*
)
);
inv_H_h_H
=
(
int32_t
**
)
malloc16_clear
(
n_tx
*
n_tx
*
sizeof
(
int32_t
*
)
);
sub_matrix
=
(
int32_t
**
)
malloc16_clear
(
(
n_tx
-
1
)
*
(
n_tx
-
1
)
*
sizeof
(
int32_t
*
)
);
for
(
int
rtx
=
0
;
rtx
<
n_tx
;
rtx
++
)
{
//row
for
(
int
rtx
=
0
;
rtx
<
n_tx
;
rtx
++
)
{
//row
for
(
int
ctx
=
0
;
ctx
<
n_tx
;
ctx
++
)
{
//column
for
(
int
ctx
=
0
;
ctx
<
n_tx
;
ctx
++
)
{
//column
inv_H_h_H
[
ctx
*
n_tx
+
rtx
]
=
(
int32_t
*
)
malloc16_clear
(
12
*
nb_rb
*
sizeof
(
int32_t
)
);
inv_H_h_H
[
ctx
*
n_tx
+
rtx
]
=
(
int32_t
*
)
malloc16_clear
(
12
*
nb_rb_0
*
sizeof
(
int32_t
)
);
if
((
rtx
<
(
n_tx
-
1
))
&&
(
ctx
<
(
n_tx
-
1
)))
sub_matrix
[
ctx
*
(
n_tx
-
1
)
+
rtx
]
=
(
int32_t
*
)
malloc16_clear
(
12
*
nb_rb
*
sizeof
(
int32_t
)
);
}
}
}
}
int
fpshift
=
5
;
//Compute Inversion of the H^*H matrix
int
fp_flag
=
0
;
/* For 2x2 MIMO matrix, we compute
nr_matrix_inverse
(
conjH_H_elements
[
0
],
//Input matrix
* |(conj_H_00xH_00+conj_H_10xH_10) (conj_H_00xH_01+conj_H_10xH_11)|
inv_H_h_H
,
//Inverse
* H_h_H= | |
determ_fin
,
//determin
* |(conj_H_01xH_00+conj_H_11xH_10) (conj_H_01xH_01+conj_H_11xH_11)|
*
*inv(H_h_H) =(1/det)*[d -b
* -c a]
**************************************************************************/
for
(
int
rtx
=
0
;
rtx
<
n_tx
;
rtx
++
)
{
//row
k
=
0
;
for
(
int
rrtx
=
0
;
rrtx
<
n_tx
;
rrtx
++
)
if
(
rrtx
!=
rtx
)
rr
[
k
++
]
=
rrtx
;
for
(
int
ctx
=
0
;
ctx
<
n_tx
;
ctx
++
)
{
//column
k
=
0
;
for
(
int
cctx
=
0
;
cctx
<
n_tx
;
cctx
++
)
if
(
cctx
!=
ctx
)
cc
[
k
++
]
=
cctx
;
//fill out the sub matrix corresponds to this element
for
(
int
ridx
=
0
;
ridx
<
(
n_tx
-
1
);
ridx
++
)
for
(
int
cidx
=
0
;
cidx
<
(
n_tx
-
1
);
cidx
++
)
sub_matrix
[
cidx
*
(
n_tx
-
1
)
+
ridx
]
=
(
int32_t
*
)
&
conjH_H_elements
[
0
][
cc
[
cidx
]
*
n_tx
+
rr
[
ridx
]][
0
];
nr_determin
(
sub_matrix
,
inv_H_h_H
[
rtx
*
n_tx
+
ctx
],
//out transpose
n_tx
-
1
,
//size
nb_rb
,
((
rtx
&
1
)
==
1
?-
1
:
1
)
*
((
ctx
&
1
)
==
1
?-
1
:
1
),
fpshift
);
}
}
//Compute Matrix determinant
nr_determin
(
conjH_H_elements
[
0
],
//
determ_fin
,
//ad-bc
n_tx
,
//size
n_tx
,
//size
nb_rb
,
nb_rb_0
,
+
1
,
fp_flag
,
//fixed point flag
fpshift
);
fpshift
);
print_shorts
(
"nr_det_"
,(
int16_t
*
)
&
determ_fin
[
0
]);
// multiply Matrix inversion pf H_h_H by the rx signal vector
// multiply Matrix inversion pf H_h_H by the rx signal vector
int32_t
outtemp
[
12
*
nb_rb
]
__attribute__
((
aligned
(
32
)));
int32_t
outtemp
[
12
*
nb_rb
_0
]
__attribute__
((
aligned
(
32
)));
int32_t
**
rxdataF_zforcing
;
int32_t
**
rxdataF_zforcing
;
//Allocate rxdataF for zforcing out
//Allocate rxdataF for zforcing out
rxdataF_zforcing
=
(
int32_t
**
)
malloc16_clear
(
n_tx
*
sizeof
(
int32_t
*
)
);
rxdataF_zforcing
=
(
int32_t
**
)
malloc16_clear
(
n_tx
*
sizeof
(
int32_t
*
)
);
for
(
int
rtx
=
0
;
rtx
<
n_tx
;
rtx
++
)
{
//row
for
(
int
rtx
=
0
;
rtx
<
n_tx
;
rtx
++
)
{
//row
rxdataF_zforcing
[
rtx
]
=
(
int32_t
*
)
malloc16_clear
(
12
*
nb_rb
*
sizeof
(
int32_t
)
);
rxdataF_zforcing
[
rtx
]
=
(
int32_t
*
)
malloc16_clear
(
12
*
nb_rb
_0
*
sizeof
(
int32_t
)
);
}
}
for
(
int
rtx
=
0
;
rtx
<
n_tx
;
rtx
++
)
{
//Output Layers row
for
(
int
rtx
=
0
;
rtx
<
n_tx
;
rtx
++
)
{
//Output Layers row
...
@@ -2212,11 +2338,11 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp,
...
@@ -2212,11 +2338,11 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp,
nr_a_mult_b
(
inv_H_h_H
[
ctx
*
n_tx
+
rtx
],
nr_a_mult_b
(
inv_H_h_H
[
ctx
*
n_tx
+
rtx
],
(
int
*
)
&
rxdataF_comp
[
ctx
*
n_rx
][
symbol
*
nb_rb
*
12
],
(
int
*
)
&
rxdataF_comp
[
ctx
*
n_rx
][
symbol
*
nb_rb
*
12
],
outtemp
,
outtemp
,
nb_rb
,
nb_rb
_0
,
fpshift
);
fpshift
);
//9
nr_a_sum_b
((
__m128i
*
)
rxdataF_zforcing
[
rtx
],
nr_a_sum_b
((
__m128i
*
)
rxdataF_zforcing
[
rtx
],
(
__m128i
*
)
outtemp
,
(
__m128i
*
)
outtemp
,
nb_rb
);
//a =a + b
nb_rb
_0
);
//a =a + b
}
}
//#ifdef DEBUG_DLSCH_DEMOD
//#ifdef DEBUG_DLSCH_DEMOD
printf
(
"Computing layer_%d
\n
"
,
rtx
);;
printf
(
"Computing layer_%d
\n
"
,
rtx
);;
...
@@ -2230,7 +2356,7 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp,
...
@@ -2230,7 +2356,7 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp,
for
(
int
rtx
=
0
;
rtx
<
n_tx
;
rtx
++
)
for
(
int
rtx
=
0
;
rtx
<
n_tx
;
rtx
++
)
nr_element_sign
(
rxdataF_zforcing
[
rtx
],
nr_element_sign
(
rxdataF_zforcing
[
rtx
],
(
int
*
)
&
rxdataF_comp
[
rtx
*
n_rx
][
symbol
*
nb_rb
*
12
],
(
int
*
)
&
rxdataF_comp
[
rtx
*
n_rx
][
symbol
*
nb_rb
*
12
],
nb_rb
,
nb_rb
_0
,
+
1
);
+
1
);
//Update LLR thresholds with the Matrix determinant
//Update LLR thresholds with the Matrix determinant
...
@@ -2260,6 +2386,7 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp,
...
@@ -2260,6 +2386,7 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp,
for
(
int
rb
=
0
;
rb
<
3
*
nb_rb_0
;
rb
++
)
{
for
(
int
rb
=
0
;
rb
<
3
*
nb_rb_0
;
rb
++
)
{
//for symmetric H_h_H matrix, the determinant is only real values
//for symmetric H_h_H matrix, the determinant is only real values
if
(
fp_flag
)
{
mmtmpD2
=
_mm_sign_epi16
(
determ_fin_128
[
0
],
*
(
__m128i
*
)
&
nr_realpart
[
0
]);
mmtmpD2
=
_mm_sign_epi16
(
determ_fin_128
[
0
],
*
(
__m128i
*
)
&
nr_realpart
[
0
]);
mmtmpD3
=
mmtmpD2
;
mmtmpD3
=
mmtmpD2
;
mmtmpD3
=
_mm_shufflelo_epi16
(
mmtmpD3
,
_MM_SHUFFLE
(
2
,
3
,
0
,
1
));
mmtmpD3
=
_mm_shufflelo_epi16
(
mmtmpD3
,
_MM_SHUFFLE
(
2
,
3
,
0
,
1
));
...
@@ -2275,9 +2402,16 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp,
...
@@ -2275,9 +2402,16 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp,
dl_ch_mag128b_0
[
0
]
=
_mm_mulhi_epi16
(
dl_ch_mag128b_0
[
0
],
QAM_amp128b
);
dl_ch_mag128b_0
[
0
]
=
_mm_mulhi_epi16
(
dl_ch_mag128b_0
[
0
],
QAM_amp128b
);
dl_ch_mag128b_0
[
0
]
=
_mm_slli_epi16
(
dl_ch_mag128b_0
[
0
],
1
);
dl_ch_mag128b_0
[
0
]
=
_mm_slli_epi16
(
dl_ch_mag128b_0
[
0
],
1
);
dl_ch_mag128r_0
[
0
]
=
_mm_mulhi_epi16
(
dl_ch_mag128r_0
[
0
],
QAM_amp128r
);
dl_ch_mag128r_0
[
0
]
=
_mm_mulhi_epi16
(
dl_ch_mag128r_0
[
0
],
QAM_amp128r
);
dl_ch_mag128r_0
[
0
]
=
_mm_slli_epi16
(
dl_ch_mag128r_0
[
0
],
1
);
dl_ch_mag128r_0
[
0
]
=
_mm_slli_epi16
(
dl_ch_mag128r_0
[
0
],
1
);
}
else
{
dl_ch_mag128_0
[
0
]
=
QAM_amp128
;
dl_ch_mag128_0
[
0
]
=
_mm_srai_epi16
(
dl_ch_mag128_0
[
0
],
fpshift
);
dl_ch_mag128b_0
[
0
]
=
QAM_amp128b
;
dl_ch_mag128b_0
[
0
]
=
_mm_srai_epi16
(
dl_ch_mag128b_0
[
0
],
fpshift
);
dl_ch_mag128r_0
[
0
]
=
QAM_amp128r
;
dl_ch_mag128r_0
[
0
]
=
_mm_srai_epi16
(
dl_ch_mag128r_0
[
0
],
fpshift
);
}
determ_fin_128
+=
1
;
determ_fin_128
+=
1
;
dl_ch_mag128_0
+=
1
;
dl_ch_mag128_0
+=
1
;
...
...
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