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
常顺宇
OpenXG-RAN
Commits
63143b87
Commit
63143b87
authored
Jan 28, 2019
by
frtabu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Go on removing printf arguments warnings, add a suppression file to be used with cppcheck command
parent
875bdaf2
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1174 additions
and
1393 deletions
+1174
-1393
ci-scripts/cppcheck_suppressions.list
ci-scripts/cppcheck_suppressions.list
+6
-0
common/utils/backtrace.c
common/utils/backtrace.c
+7
-8
common/utils/hashtable/obj_hashtable.c
common/utils/hashtable/obj_hashtable.c
+189
-172
openair1/PHY/CODING/ccoding_byte.c
openair1/PHY/CODING/ccoding_byte.c
+1
-1
openair1/PHY/CODING/lte_rate_matching.c
openair1/PHY/CODING/lte_rate_matching.c
+3
-4
openair1/PHY/CODING/lte_segmentation.c
openair1/PHY/CODING/lte_segmentation.c
+2
-2
openair1/PHY/LTE_REFSIG/lte_dl_mbsfn.c
openair1/PHY/LTE_REFSIG/lte_dl_mbsfn.c
+4
-27
openair1/PHY/LTE_REFSIG/lte_ul_ref.c
openair1/PHY/LTE_REFSIG/lte_ul_ref.c
+15
-28
openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
+238
-292
openair1/SIMULATION/LTE_PHY/dlsim.c
openair1/SIMULATION/LTE_PHY/dlsim.c
+709
-859
No files found.
ci-scripts/cppcheck_suppressions.list
0 → 100644
View file @
63143b87
// suppress error about keysP not free, it is done by calling func */
memleak:common/utils/hashtable/obj_hashtable.c
// followings errors are in file not used in oai exec's included in CI
invalidPrintfArgType_sint:openair1/PHY/CODING/TESTBENCH/ltetest.c
memleak:openair1/PHY/CODING/TESTBENCH/ltetest.c
invalidPrintfArgType_sint:openair1/PHY/CODING/TESTBENCH/pdcch_test.c
common/utils/backtrace.c
View file @
63143b87
...
...
@@ -31,18 +31,18 @@
#include "backtrace.h"
/* Obtain a backtrace and print it to stdout. */
void
display_backtrace
(
void
)
{
void
display_backtrace
(
void
)
{
void
*
array
[
10
];
size_t
size
;
char
**
strings
;
size_t
i
;
char
*
test
=
getenv
(
"NO_BACKTRACE"
);
if
(
test
!=
0
)
*
((
int
*
)
0
)
=
0
;
char
*
test
=
getenv
(
"NO_BACKTRACE"
);
if
(
test
!=
0
)
*
((
int
*
)
0
)
=
0
;
size
=
backtrace
(
array
,
10
);
strings
=
backtrace_symbols
(
array
,
size
);
printf
(
"Obtained %zd stack frames.
\n
"
,
size
);
printf
(
"Obtained %u stack frames.
\n
"
,
(
unsigned
int
)
size
);
for
(
i
=
0
;
i
<
size
;
i
++
)
printf
(
"%s
\n
"
,
strings
[
i
]);
...
...
@@ -50,8 +50,7 @@ void display_backtrace(void)
free
(
strings
);
}
void
backtrace_handle_signal
(
siginfo_t
*
info
)
{
void
backtrace_handle_signal
(
siginfo_t
*
info
)
{
display_backtrace
();
//exit(EXIT_FAILURE);
}
common/utils/hashtable/obj_hashtable.c
View file @
63143b87
This diff is collapsed.
Click to expand it.
openair1/PHY/CODING/ccoding_byte.c
View file @
63143b87
...
...
@@ -130,7 +130,7 @@ ccodedot11_encode (unsigned int numbytes,
*
outPtr
++
=
(
out
>>
1
)
&
1
;
#ifdef DEBUG_CCODE
printf
(
"%
d
: %u -> %d (%u)
\n
"
,
dummy
,
state
,
out
,
ccodedot11_table
[
state
]);
printf
(
"%
u
: %u -> %d (%u)
\n
"
,
dummy
,
state
,
out
,
ccodedot11_table
[
state
]);
dummy
+=
2
;
#endif //DEBUG_CCODE
bit_index
=
(
bit_index
==
0
)
?
1
:
0
;
...
...
openair1/PHY/CODING/lte_rate_matching.c
View file @
63143b87
...
...
@@ -236,7 +236,7 @@ void sub_block_deinterleaving_cc(uint32_t D,int8_t *d,int8_t *w) {
ND
=
Kpi
-
D
;
#ifdef RM_DEBUG2
printf
(
"sub_block_interleaving_cc : D = %d (%d), d %p, w %p
\n
"
,
D
,
D
*
3
,
d
,
w
);
printf
(
"RCC = %d, Kpi=%d, ND=%ld
\n
"
,
RCC
,
Kpi
,
ND
);
printf
(
"RCC = %d, Kpi=%d, ND=%ld
\n
"
,
RCC
,
Kpi
,
(
long
)
ND
);
#endif
ND3
=
ND
*
3
;
k
=
0
;
...
...
@@ -253,7 +253,8 @@ void sub_block_deinterleaving_cc(uint32_t D,int8_t *d,int8_t *w) {
d
[
index3
-
ND3
+
1
]
=
w
[
Kpi
+
k
];
d
[
index3
-
ND3
+
2
]
=
w
[(
Kpi
<<
1
)
+
k
];
#ifdef RM_DEBUG2
printf
(
"row %d, index %d k %d index3-ND3 %ld w(%d,%d,%d)
\n
"
,
row
,
index
,
k
,
index3
-
ND3
,
w
[
k
],
w
[
Kpi
+
k
],
w
[(
Kpi
<<
1
)
+
k
]);
printf
(
"row %d, index %d k %d index3-ND3 %ld w(%d,%d,%d)
\n
"
,
row
,
index
,
k
,(
long
)(
index3
-
ND3
),
w
[
k
],
w
[
Kpi
+
k
],
w
[(
Kpi
<<
1
)
+
k
]);
#endif
index3
+=
96
;
index
+=
32
;
...
...
@@ -453,7 +454,6 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
int
threed
=
0
;
uint32_t
nulled
=
0
;
static
unsigned
char
*
counter_buffer
[
MAX_NUM_DLSCH_SEGMENTS
][
4
];
FILE
*
counter_fd
;
char
fname
[
512
];
#endif
...
...
@@ -476,7 +476,6 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
}
else
if
(
rvidx
==
3
)
{
sprintf
(
fname
,
"mcs%d_rate_matching_RB_%d.txt"
,
m
,
nb_rb
);
// sprintf(fname,"mcs0_rate_matching_RB_6.txt");
counter_fd
=
fopen
(
fname
,
"w"
);
}
#endif
...
...
openair1/PHY/CODING/lte_segmentation.c
View file @
63143b87
...
...
@@ -124,8 +124,8 @@ int lte_segmentation(unsigned char *input_buffer,
Bprime
,
*
Cplus
,
*
Kplus
,
*
Cminus
,
*
Kminus
);
*
F
=
((
*
Cplus
)
*
(
*
Kplus
)
+
(
*
Cminus
)
*
(
*
Kminus
)
-
(
Bprime
));
#ifdef DEBUG_SEGMENTATION
printf
(
"C %u, Cplus %u, Cminus %u, Kplus %u, Kminus %u, Bprime_bytes %u, Bprime %u, F %u
\n
"
,
*
C
,
*
Cplus
,
*
Cminus
,
*
Kplus
,
*
Kminus
,
Bprime
>>
3
,
Bprime
,
*
F
);
#endif
printf
(
"C %u, Cplus %u, Cminus %u, Kplus %u, Kminus %u, Bprime_bytes %u, Bprime %u, F %u
\n
"
,
*
C
,
*
Cplus
,
*
Cminus
,
*
Kplus
,
*
Kminus
,
Bprime
>>
3
,
Bprime
,
*
F
);
if
((
input_buffer
)
&&
(
output_buffers
))
{
for
(
k
=
0
;
k
<*
F
>>
3
;
k
++
)
{
...
...
openair1/PHY/LTE_REFSIG/lte_dl_mbsfn.c
View file @
63143b87
...
...
@@ -35,30 +35,22 @@
int
lte_dl_mbsfn
(
PHY_VARS_eNB
*
eNB
,
int32_t
*
output
,
short
amp
,
int
subframe
,
unsigned
char
l
)
{
unsigned
char
l
)
{
unsigned
int
mprime
,
mprime_dword
,
mprime_qpsk_symb
,
m
;
unsigned
short
k
=
0
,
a
;
int32_t
qpsk
[
4
];
a
=
(
amp
*
ONE_OVER_SQRT2_Q15
)
>>
15
;
((
short
*
)
&
qpsk
[
0
])[
0
]
=
a
;
((
short
*
)
&
qpsk
[
0
])[
1
]
=
a
;
((
short
*
)
&
qpsk
[
1
])[
0
]
=
-
a
;
((
short
*
)
&
qpsk
[
1
])[
1
]
=
a
;
((
short
*
)
&
qpsk
[
2
])[
0
]
=
a
;
((
short
*
)
&
qpsk
[
2
])[
1
]
=
-
a
;
((
short
*
)
&
qpsk
[
3
])[
0
]
=
-
a
;
((
short
*
)
&
qpsk
[
3
])[
1
]
=
-
a
;
mprime
=
3
*
(
110
-
eNB
->
frame_parms
.
N_RB_DL
);
for
(
m
=
0
;
m
<
eNB
->
frame_parms
.
N_RB_DL
*
6
;
m
++
)
{
if
((
l
==
0
)
||
(
l
==
2
))
k
=
m
<<
1
;
else
if
(
l
==
1
)
...
...
@@ -69,7 +61,6 @@ int lte_dl_mbsfn(PHY_VARS_eNB *eNB, int32_t *output,
}
k
+=
eNB
->
frame_parms
.
first_carrier_offset
;
mprime_dword
=
mprime
>>
4
;
mprime_qpsk_symb
=
mprime
&
0xf
;
...
...
@@ -80,22 +71,18 @@ int lte_dl_mbsfn(PHY_VARS_eNB *eNB, int32_t *output,
output
[
k
]
=
qpsk
[(
eNB
->
lte_gold_mbsfn_table
[
subframe
][
l
][
mprime_dword
]
>>
(
2
*
mprime_qpsk_symb
))
&
3
];
//output[k] = (lte_gold_table[eNB_offset][subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3;
#ifdef DEBUG_DL_MBSFN
LOG_D
(
PHY
,
"subframe %d, l %d, m %d, mprime %d, mprime_dword %d, mprime_qpsk_symbol %d
\n
"
,
subframe
,
l
,
m
,
mprime
,
mprime_dword
,
mprime_qpsk_symb
);
subframe
,
l
,
m
,
mprime
,
mprime_dword
,
mprime_qpsk_symb
);
LOG_D
(
PHY
,
"index = %d (k %d)(%x)
\n
"
,(
eNB
->
lte_gold_mbsfn_table
[
subframe
][
l
][
mprime_dword
]
>>
(
2
*
mprime_qpsk_symb
))
&
3
,
k
,
eNB
->
lte_gold_mbsfn_table
[
subframe
][
l
][
mprime_dword
]);
#endif
mprime
++
;
#ifdef DEBUG_DL_MBSFN
if
(
m
<
18
)
printf
(
"subframe %d, l %d output[%d] = (%d,%d)
\n
"
,
subframe
,
l
,
k
,((
short
*
)
&
output
[
k
])[
0
],((
short
*
)
&
output
[
k
])[
1
]);
#endif
}
return
(
0
);
...
...
@@ -106,15 +93,11 @@ int lte_dl_mbsfn(PHY_VARS_eNB *eNB, int32_t *output,
int
lte_dl_mbsfn_rx
(
PHY_VARS_UE
*
ue
,
int
*
output
,
int
subframe
,
unsigned
char
l
)
{
unsigned
char
l
)
{
unsigned
int
mprime
,
mprime_dword
,
mprime_qpsk_symb
,
m
;
unsigned
short
k
=
0
;
unsigned
int
qpsk
[
4
];
// This includes complex conjugate for channel estimation
((
short
*
)
&
qpsk
[
0
])[
0
]
=
ONE_OVER_SQRT2_Q15
;
((
short
*
)
&
qpsk
[
0
])[
1
]
=
-
ONE_OVER_SQRT2_Q15
;
((
short
*
)
&
qpsk
[
1
])[
0
]
=
-
ONE_OVER_SQRT2_Q15
;
...
...
@@ -123,23 +106,18 @@ int lte_dl_mbsfn_rx(PHY_VARS_UE *ue,
((
short
*
)
&
qpsk
[
2
])[
1
]
=
ONE_OVER_SQRT2_Q15
;
((
short
*
)
&
qpsk
[
3
])[
0
]
=
-
ONE_OVER_SQRT2_Q15
;
((
short
*
)
&
qpsk
[
3
])[
1
]
=
ONE_OVER_SQRT2_Q15
;
mprime
=
3
*
(
110
-
ue
->
frame_parms
.
N_RB_DL
);
for
(
m
=
0
;
m
<
ue
->
frame_parms
.
N_RB_DL
*
6
;
m
++
)
{
mprime_dword
=
mprime
>>
4
;
mprime_qpsk_symb
=
mprime
&
0xf
;
// this is r_mprime from 3GPP 36-211 6.10.1.2
output
[
k
]
=
qpsk
[(
ue
->
lte_gold_mbsfn_table
[
subframe
][
l
][
mprime_dword
]
>>
(
2
*
mprime_qpsk_symb
))
&
3
];
#ifdef DEBUG_DL_MBSFN
printf
(
"subframe %d, l %d, m %
d, mprime %d, mprime_dword %d, mprime_qpsk_symbol %d
\n
"
,
printf
(
"subframe %d, l %d, m %
u, mprime %u, mprime_dword %u, mprime_qpsk_symbol %u
\n
"
,
subframe
,
l
,
m
,
mprime
,
mprime_dword
,
mprime_qpsk_symb
);
printf
(
"index = %d (k %d) (%x)
\n
"
,(
ue
->
lte_gold_mbsfn_table
[
subframe
][
l
][
mprime_dword
]
>>
(
2
*
mprime_qpsk_symb
))
&
3
,
k
,
ue
->
lte_gold_mbsfn_table
[
subframe
][
l
][
mprime_dword
]);
#endif
mprime
++
;
#ifdef DEBUG_DL_MBSFN
...
...
@@ -148,7 +126,6 @@ int lte_dl_mbsfn_rx(PHY_VARS_UE *ue,
#endif
k
++
;
}
return
(
0
);
...
...
openair1/PHY/LTE_REFSIG/lte_ul_ref.c
View file @
63143b87
...
...
@@ -20,9 +20,9 @@
*/
#ifdef MAIN
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#endif
#include "lte_refsig.h"
#include "PHY/defs_eNB.h"
...
...
@@ -43,8 +43,7 @@ char ref24[720] = {
-
1
,
3
,
1
,
-
3
,
3
,
-
1
,
1
,
3
,
-
3
,
3
,
1
,
3
,
-
3
,
3
,
1
,
1
,
-
1
,
1
,
3
,
-
3
,
3
,
-
3
,
-
1
,
-
3
,
-
3
,
3
,
-
3
,
-
3
,
-
3
,
1
,
-
3
,
-
3
,
3
,
-
1
,
1
,
1
,
1
,
3
,
1
,
-
1
,
3
,
-
3
,
-
3
,
1
,
3
,
1
,
1
,
-
3
,
3
,
-
1
,
3
,
3
,
1
,
1
,
-
3
,
3
,
3
,
3
,
3
,
1
,
-
1
,
3
,
-
1
,
1
,
1
,
-
1
,
-
3
,
-
1
,
-
1
,
1
,
3
,
3
,
-
1
,
-
3
,
1
,
1
,
3
,
-
3
,
1
,
1
,
-
3
,
-
1
,
-
1
,
1
,
3
,
1
,
3
,
1
,
-
1
,
3
,
1
,
1
,
-
3
,
-
1
,
-
3
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3
,
-
1
,
1
,
3
,
1
,
-
1
,
3
,
1
,
3
,
-
3
,
-
3
,
1
,
-
1
,
-
1
,
1
,
3
};
void
generate_ul_ref_sigs
(
void
)
{
void
generate_ul_ref_sigs
(
void
)
{
double
qbar
,
phase
;
unsigned
int
u
,
v
,
Msc_RS
,
q
,
m
,
n
;
...
...
@@ -53,7 +52,7 @@ void generate_ul_ref_sigs(void)
for
(
u
=
0
;
u
<
30
;
u
++
)
{
for
(
v
=
0
;
v
<
2
;
v
++
)
{
qbar
=
ref_primes
[
Msc_RS
]
*
(
u
+
1
)
/
(
double
)
31
;
ul_ref_sigs
[
u
][
v
][
Msc_RS
]
=
(
int16_t
*
)
malloc16
(
2
*
sizeof
(
int16_t
)
*
dftsizes
[
Msc_RS
]);
ul_ref_sigs
[
u
][
v
][
Msc_RS
]
=
(
int16_t
*
)
malloc16
(
2
*
sizeof
(
int16_t
)
*
dftsizes
[
Msc_RS
]);
if
((((
int
)
floor
(
2
*
qbar
))
&
1
)
==
0
)
q
=
(
int
)(
floor
(
qbar
+
.
5
))
-
v
;
...
...
@@ -61,7 +60,7 @@ void generate_ul_ref_sigs(void)
q
=
(
int
)(
floor
(
qbar
+
.
5
))
+
v
;
#ifdef MAIN
printf
(
"Msc_RS %
d (%d), u %d, v %d -> q %d
(qbar %f)
\n
"
,
Msc_RS
,
dftsizes
[
Msc_RS
],
u
,
v
,
q
,
qbar
);
printf
(
"Msc_RS %
u (%d), u %u, v %u -> q %u
(qbar %f)
\n
"
,
Msc_RS
,
dftsizes
[
Msc_RS
],
u
,
v
,
q
,
qbar
);
#endif
for
(
n
=
0
;
n
<
dftsizes
[
Msc_RS
];
n
++
)
{
...
...
@@ -89,32 +88,26 @@ void generate_ul_ref_sigs(void)
// These are the sequences for RB 1
for
(
u
=
0
;
u
<
30
;
u
++
)
{
ul_ref_sigs
[
u
][
0
][
0
]
=
(
int16_t
*
)
malloc16
(
2
*
sizeof
(
int16_t
)
*
dftsizes
[
0
]);
ul_ref_sigs
[
u
][
0
][
0
]
=
(
int16_t
*
)
malloc16
(
2
*
sizeof
(
int16_t
)
*
dftsizes
[
0
]);
for
(
n
=
0
;
n
<
dftsizes
[
0
];
n
++
)
{
ul_ref_sigs
[
u
][
0
][
0
][
n
<<
1
]
=
(
int16_t
)(
floor
(
32767
*
cos
(
M_PI
*
ref12
[(
u
*
12
)
+
n
]
/
4
)));
ul_ref_sigs
[
u
][
0
][
0
][
1
+
(
n
<<
1
)]
=
(
int16_t
)(
floor
(
32767
*
sin
(
M_PI
*
ref12
[(
u
*
12
)
+
n
]
/
4
)));
}
}
// These are the sequences for RB 2
for
(
u
=
0
;
u
<
30
;
u
++
)
{
ul_ref_sigs
[
u
][
0
][
1
]
=
(
int16_t
*
)
malloc16
(
2
*
sizeof
(
int16_t
)
*
dftsizes
[
1
]);
ul_ref_sigs
[
u
][
0
][
1
]
=
(
int16_t
*
)
malloc16
(
2
*
sizeof
(
int16_t
)
*
dftsizes
[
1
]);
for
(
n
=
0
;
n
<
dftsizes
[
1
];
n
++
)
{
ul_ref_sigs
[
u
][
0
][
1
][
n
<<
1
]
=
(
int16_t
)(
floor
(
32767
*
cos
(
M_PI
*
ref24
[(
u
*
24
)
+
n
]
/
4
)));
ul_ref_sigs
[
u
][
0
][
1
][
1
+
(
n
<<
1
)]
=
(
int16_t
)(
floor
(
32767
*
sin
(
M_PI
*
ref24
[(
u
*
24
)
+
n
]
/
4
)));
}
}
}
void
generate_ul_ref_sigs_rx
(
void
)
{
void
generate_ul_ref_sigs_rx
(
void
)
{
double
qbar
,
phase
;
unsigned
int
u
,
v
,
Msc_RS
,
q
,
m
,
n
;
...
...
@@ -123,7 +116,7 @@ void generate_ul_ref_sigs_rx(void)
for
(
u
=
0
;
u
<
30
;
u
++
)
{
for
(
v
=
0
;
v
<
2
;
v
++
)
{
qbar
=
ref_primes
[
Msc_RS
]
*
(
u
+
1
)
/
(
double
)
31
;
ul_ref_sigs_rx
[
u
][
v
][
Msc_RS
]
=
(
int16_t
*
)
malloc16
(
2
*
sizeof
(
int16_t
)
*
dftsizes
[
Msc_RS
]);
ul_ref_sigs_rx
[
u
][
v
][
Msc_RS
]
=
(
int16_t
*
)
malloc16
(
2
*
sizeof
(
int16_t
)
*
dftsizes
[
Msc_RS
]);
if
((((
int
)
floor
(
2
*
qbar
))
&
1
)
==
0
)
q
=
(
int
)(
floor
(
qbar
+
.
5
))
-
v
;
...
...
@@ -131,7 +124,7 @@ void generate_ul_ref_sigs_rx(void)
q
=
(
int
)(
floor
(
qbar
+
.
5
))
+
v
;
#ifdef MAIN
printf
(
"Msc_RS %
d (%d), u %d, v %d -> q %d
(qbar %f)
\n
"
,
Msc_RS
,
dftsizes
[
Msc_RS
],
u
,
v
,
q
,
qbar
);
printf
(
"Msc_RS %
u (%d), u %u, v %u -> q %u
(qbar %f)
\n
"
,
Msc_RS
,
dftsizes
[
Msc_RS
],
u
,
v
,
q
,
qbar
);
#endif
for
(
n
=
0
;
n
<
dftsizes
[
Msc_RS
];
n
++
)
{
...
...
@@ -159,7 +152,7 @@ void generate_ul_ref_sigs_rx(void)
// These are the sequences for RB 1
for
(
u
=
0
;
u
<
30
;
u
++
)
{
ul_ref_sigs_rx
[
u
][
0
][
0
]
=
(
int16_t
*
)
malloc16
(
2
*
sizeof
(
int16_t
)
*
dftsizes
[
0
]);
ul_ref_sigs_rx
[
u
][
0
][
0
]
=
(
int16_t
*
)
malloc16
(
2
*
sizeof
(
int16_t
)
*
dftsizes
[
0
]);
for
(
n
=
0
;
n
<
dftsizes
[
0
];
n
++
)
{
ul_ref_sigs_rx
[
u
][
0
][
0
][
n
<<
1
]
=
(
int16_t
)(
floor
(
32767
*
cos
(
M_PI
*
ref12
[(
u
*
12
)
+
n
]
/
4
)));
...
...
@@ -169,21 +162,17 @@ void generate_ul_ref_sigs_rx(void)
// These are the sequences for RB 2
for
(
u
=
0
;
u
<
30
;
u
++
)
{
ul_ref_sigs_rx
[
u
][
0
][
1
]
=
(
int16_t
*
)
malloc16
(
2
*
sizeof
(
int16_t
)
*
dftsizes
[
1
]);
ul_ref_sigs_rx
[
u
][
0
][
1
]
=
(
int16_t
*
)
malloc16
(
2
*
sizeof
(
int16_t
)
*
dftsizes
[
1
]);
for
(
n
=
0
;
n
<
dftsizes
[
1
];
n
++
)
{
ul_ref_sigs_rx
[
u
][
0
][
1
][
n
<<
1
]
=
(
int16_t
)(
floor
(
32767
*
cos
(
M_PI
*
ref24
[(
u
*
24
)
+
n
]
/
4
)));
ul_ref_sigs_rx
[
u
][
0
][
1
][
1
+
(
n
<<
1
)]
=
(
int16_t
)(
floor
(
32767
*
sin
(
M_PI
*
ref24
[(
u
*
24
)
+
n
]
/
4
)));
}
}
}
void
free_ul_ref_sigs
(
void
)
{
void
free_ul_ref_sigs
(
void
)
{
unsigned
int
u
,
v
,
Msc_RS
;
for
(
Msc_RS
=
0
;
Msc_RS
<
34
;
Msc_RS
++
)
{
...
...
@@ -204,9 +193,7 @@ void free_ul_ref_sigs(void)
}
#ifdef MAIN
main
()
{
main
()
{
generate_ul_ref_sigs
();
generate_ul_ref_sigs_rx
();
free_ul_ref_sigs
();
...
...
openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
View file @
63143b87
This diff is collapsed.
Click to expand it.
openair1/SIMULATION/LTE_PHY/dlsim.c
View file @
63143b87
This diff is collapsed.
Click to expand it.
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