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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
9542e8a8
Commit
9542e8a8
authored
Jun 08, 2017
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alternative version of dlsch_channel_level not needing floating point
parent
3c56a7ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
7 deletions
+27
-7
openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
+4
-7
openair1/PHY/TOOLS/defs.h
openair1/PHY/TOOLS/defs.h
+3
-0
openair1/PHY/TOOLS/log2_approx.c
openair1/PHY/TOOLS/log2_approx.c
+20
-0
No files found.
openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
View file @
9542e8a8
...
...
@@ -3389,11 +3389,9 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
nre=12;
//nb_rb*nre = y * 2^x
int16_t x = log2_approx(nb_rb*nre)-1;
//int16_t one_over_y_q15 = (int16_t)((1<<((int32_t)x+15))/((int32_t)nb_rb*(int32_t)nre));
float y = (float)(nb_rb*nre)/(float)(1<<x);
//printf("1/(nb_rb*nre) = 1/%d = %d*2^(-15) * 2^(-%d)\n",nb_rb*nre,one_over_y_q15,x);
printf("nb_rb*nre = %d = %f * 2^(%d)\n",nb_rb*nre,y,x);
int16_t x = factor2(nb_rb*nre);
int16_t y = (nb_rb*nre)/(1<<x);
printf("nb_rb*nre = %d = %d * 2^(%d)\n",nb_rb*nre,y,x);
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++)
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
...
...
@@ -3432,8 +3430,7 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
avg[(aatx<<1)+aarx] = (((int32_t*)&avg128D)[0] +
((int32_t*)&avg128D)[1] +
((int32_t*)&avg128D)[2] +
((int32_t*)&avg128D)[3]);
avg[(aatx<<1)+aarx] = (int32_t) ((float) avg[(aatx<<1)+aarx]/y);
((int32_t*)&avg128D)[3])/y;
printf("Channel level : %d\n",avg[(aatx<<1)+aarx]);
}
...
...
openair1/PHY/TOOLS/defs.h
View file @
9542e8a8
...
...
@@ -338,6 +338,9 @@ uint8_t log2_approx64(unsigned long long int x);
int16_t
invSqrt
(
int16_t
x
);
uint32_t
angle
(
struct
complex16
perrror
);
/// computes the number of factors 2 in x
unsigned
char
factor2
(
unsigned
int
x
);
/*!\fn int32_t phy_phase_compensation_top (uint32_t pilot_type, uint32_t initial_pilot,
uint32_t last_pilot, int32_t ignore_prefix);
Compensate the phase rotation of the RF. WARNING: This function is currently unused. It has not been tested!
...
...
openair1/PHY/TOOLS/log2_approx.c
View file @
9542e8a8
...
...
@@ -37,6 +37,26 @@ unsigned char log2_approx(unsigned int x)
return
(
l2
);
}
unsigned
char
factor2
(
unsigned
int
x
)
{
int
i
;
unsigned
char
l2
;
l2
=
0
;
for
(
i
=
0
;
i
<
31
;
i
++
)
if
((
x
&
(
1
<<
i
))
!=
0
)
break
;
l2
=
i
;
//printf("factor2(%d) = %d\n",x,l2);
return
(
l2
);
}
unsigned
char
log2_approx64
(
unsigned
long
long
int
x
)
{
...
...
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