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
ZhouShuya
OpenXG-RAN
Commits
4221816f
Commit
4221816f
authored
Aug 03, 2018
by
laurent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generate 7.5KHz tables
parent
16314f04
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
165 deletions
+91
-165
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+1
-0
openair1/PHY/MODULATION/gen_75KHz.cpp
openair1/PHY/MODULATION/gen_75KHz.cpp
+78
-0
openair1/PHY/MODULATION/gen_7_5_kHz.m
openair1/PHY/MODULATION/gen_7_5_kHz.m
+0
-107
openair1/PHY/MODULATION/kHz_7_5.h
openair1/PHY/MODULATION/kHz_7_5.h
+0
-45
openair1/PHY/MODULATION/modulation_extern.h
openair1/PHY/MODULATION/modulation_extern.h
+12
-12
openair1/PHY/MODULATION/modulation_vars.h
openair1/PHY/MODULATION/modulation_vars.h
+0
-1
No files found.
cmake_targets/CMakeLists.txt
View file @
4221816f
...
...
@@ -1137,6 +1137,7 @@ set(PHY_SRC_RU
${
OPENAIR1_DIR
}
/PHY/LTE_TRANSPORT/if5_tools.c
${
OPENAIR1_DIR
}
/PHY/MODULATION/slot_fep_ul.c
${
OPENAIR1_DIR
}
/PHY/MODULATION/ul_7_5_kHz.c
${
OPENAIR1_DIR
}
/PHY/MODULATION/gen_75KHz.cpp
${
OPENAIR1_DIR
}
/PHY/MODULATION/beamforming.c
${
OPENAIR1_DIR
}
/PHY/MODULATION/compute_bf_weights.c
${
OPENAIR1_DIR
}
/PHY/INIT/lte_init_ru.c
...
...
openair1/PHY/MODULATION/gen_75KHz.cpp
0 → 100644
View file @
4221816f
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <malloc.h>
#include <assert.h>
#include <complex>
#include <cmath>
#include <map>
#include <PHY/MODULATION/modulation_extern.h>
using
namespace
std
;
void
gen_sig
(
int
RB
,
int
len
,
double
ratio
,
int16_t
*
table_n
,
int16_t
*
table_e
)
{
double
samplerate
=
30.72e6
*
ratio
;
double
ofdm_size
=
2048
*
ratio
;
double
PI
=
std
::
acos
(
-
1
);
std
::
complex
<
int
>
tt
;
complex
<
double
>
t
[
len
];
int
index
=
0
;
double
cp0
=
160
*
ratio
;
double
cp
=
144
*
ratio
;
for
(
int
i
=-
cp0
;
i
<
ofdm_size
;
i
++
)
t
[
index
++
]
=
polar
(
32767.0
,
-
2
*
PI
*
i
*
7.5e3
/
samplerate
);
for
(
int
x
=
0
;
x
<
6
;
x
++
)
for
(
int
i
=-
cp
;
i
<
ofdm_size
;
i
++
)
t
[
index
++
]
=
polar
(
32767.0
,
-
2
*
PI
*
i
*
7.5e3
/
samplerate
);
for
(
int
i
=
0
;
i
<
len
;
i
++
)
{
table_n
[
i
*
2
]
=
floor
(
real
(
t
[
i
]));
table_n
[
i
*
2
+
1
]
=
floor
(
imag
(
t
[
i
]));
}
index
=
0
;
double
cpe
=
512
*
ratio
;
for
(
int
x
=
0
;
x
<
6
;
x
++
)
for
(
int
i
=-
cpe
;
i
<
ofdm_size
;
i
++
)
t
[
index
++
]
=
polar
(
32767.0
,
-
2
*
PI
*
i
*
7.5e3
/
samplerate
);
for
(
int
i
=
0
;
i
<
len
;
i
++
)
{
table_e
[
i
*
2
]
=
floor
(
real
(
t
[
i
]));
table_e
[
i
*
2
+
1
]
=
floor
(
imag
(
t
[
i
]));
}
}
int16_t
*
s6n_kHz_7_5
;
int16_t
*
s6e_kHz_7_5
;
int16_t
*
s15n_kHz_7_5
;
int16_t
*
s15e_kHz_7_5
;
int16_t
*
s25n_kHz_7_5
;
int16_t
*
s25e_kHz_7_5
;
int16_t
*
s50n_kHz_7_5
;
int16_t
*
s50e_kHz_7_5
;
int16_t
*
s75n_kHz_7_5
;
int16_t
*
s75e_kHz_7_5
;
int16_t
*
s100n_kHz_7_5
;
int16_t
*
s100e_kHz_7_5
;
int16_t
**
tables
[
12
]
=
{
&
s6n_kHz_7_5
,
&
s6e_kHz_7_5
,
&
s15n_kHz_7_5
,
&
s15e_kHz_7_5
,
&
s25n_kHz_7_5
,
&
s25e_kHz_7_5
,
&
s50n_kHz_7_5
,
&
s50e_kHz_7_5
,
&
s75n_kHz_7_5
,
&
s75e_kHz_7_5
,
&
s100n_kHz_7_5
,
&
s100e_kHz_7_5
,};
int
tables_size_bytes
[
12
];
#define MyAssert(x) { if(!(x)) { printf("Error in table intialization: %s:%d\n",__FILE__,__LINE__); exit(1);}}
__attribute__
((
constructor
))
static
void
init_7_5KHz
(
void
)
{
const
map
<
int
,
double
>
tables_7_5KHz
=
{{
6
,
1.0
/
16
},{
15
,
1.0
/
8
},{
25
,
1.0
/
4
},{
50
,
1.0
/
2
},{
75
,
3.0
/
4
},{
100
,
1.0
}};
int
tables_idx
=
0
;
for
(
auto
it
=
tables_7_5KHz
.
begin
();
it
!=
tables_7_5KHz
.
end
();
++
it
)
{
int
len
=
15360
*
it
->
second
;
tables_size_bytes
[
tables_idx
]
=
sizeof
(
int16_t
)
*
2
*
len
;
tables_size_bytes
[
tables_idx
+
1
]
=
sizeof
(
int16_t
)
*
2
*
len
;
MyAssert
(
0
==
posix_memalign
((
void
**
)
tables
[
tables_idx
],
16
,
tables_size_bytes
[
tables_idx
]));
MyAssert
(
0
==
posix_memalign
((
void
**
)
tables
[
tables_idx
+
1
],
16
,
tables_size_bytes
[
tables_idx
+
1
]));
gen_sig
(
it
->
first
,
len
,
it
->
second
,
*
tables
[
tables_idx
],
*
tables
[
tables_idx
+
1
]);
tables_idx
+=
2
;
}
}
openair1/PHY/MODULATION/gen_7_5_kHz.m
deleted
100644 → 0
View file @
16314f04
function
[]
=
gen_7_5_kHz
()
[
s6_n2
,
s6_e2
]
=
gen_sig
(
6
);
[
s15_n2
,
s15_e2
]
=
gen_sig
(
15
);
[
s25_n2
,
s25_e2
]
=
gen_sig
(
25
);
[
s50_n2
,
s50_e2
]
=
gen_sig
(
50
);
[
s75_n2
,
s75_e2
]
=
gen_sig
(
75
);
[
s100_n2
,
s100_e2
]
=
gen_sig
(
100
);
fd
=
fopen
(
"kHz_7_5.h"
,
"w"
);
fprintf
(
fd
,
"s16 s6n_kHz_7_5[%d]__attribute__((aligned(16))) = {"
,
length
(
s6_n2
));
fprintf
(
fd
,
"%d,"
,
s6_n2
(
1
:(
end
-
1
)));
fprintf
(
fd
,
"%d};\n\n"
,
s6_n2
(
end
));
fprintf
(
fd
,
"s16 s6e_kHz_7_5[%d]__attribute__((aligned(16))) = {"
,
length
(
s6_e2
));
fprintf
(
fd
,
"%d,"
,
s6_e2
(
1
:(
end
-
1
)));
fprintf
(
fd
,
"%d};\n\n"
,
s6_e2
(
end
));
fprintf
(
fd
,
"s16 s15n_kHz_7_5[%d]__attribute__((aligned(16))) = {"
,
length
(
s15_n2
));
fprintf
(
fd
,
"%d,"
,
s15_n2
(
1
:(
end
-
1
)));
fprintf
(
fd
,
"%d};\n\n"
,
s15_n2
(
end
));
fprintf
(
fd
,
"s16 s15e_kHz_7_5[%d]__attribute__((aligned(16))) = {"
,
length
(
s15_e2
));
fprintf
(
fd
,
"%d,"
,
s15_e2
(
1
:(
end
-
1
)));
fprintf
(
fd
,
"%d};\n\n"
,
s15_e2
(
end
));
fprintf
(
fd
,
"s16 s25n_kHz_7_5[%d]__attribute__((aligned(16))) = {"
,
length
(
s25_n2
));
fprintf
(
fd
,
"%d,"
,
s25_n2
(
1
:(
end
-
1
)));
fprintf
(
fd
,
"%d};\n\n"
,
s25_n2
(
end
));
fprintf
(
fd
,
"s16 s25e_kHz_7_5[%d]__attribute__((aligned(16))) = {"
,
length
(
s25_e2
));
fprintf
(
fd
,
"%d,"
,
s25_e2
(
1
:(
end
-
1
)));
fprintf
(
fd
,
"%d};\n\n"
,
s25_e2
(
end
));
fprintf
(
fd
,
"s16 s50n_kHz_7_5[%d]__attribute__((aligned(16))) = {"
,
length
(
s50_n2
));
fprintf
(
fd
,
"%d,"
,
s50_n2
(
1
:(
end
-
1
)));
fprintf
(
fd
,
"%d};\n\n"
,
s50_n2
(
end
));
fprintf
(
fd
,
"s16 s50e_kHz_7_5[%d]__attribute__((aligned(16))) = {"
,
length
(
s50_e2
));
fprintf
(
fd
,
"%d,"
,
s50_e2
(
1
:(
end
-
1
)));
fprintf
(
fd
,
"%d};\n\n"
,
s50_e2
(
end
));
fprintf
(
fd
,
"s16 s75n_kHz_7_5[%d]__attribute__((aligned(16))) = {"
,
length
(
s75_n2
));
fprintf
(
fd
,
"%d,"
,
s75_n2
(
1
:(
end
-
1
)));
fprintf
(
fd
,
"%d};\n\n"
,
s75_n2
(
end
));
fprintf
(
fd
,
"s16 s75e_kHz_7_5[%d]__attribute__((aligned(16))) = {"
,
length
(
s75_e2
));
fprintf
(
fd
,
"%d,"
,
s75_e2
(
1
:(
end
-
1
)));
fprintf
(
fd
,
"%d};\n\n"
,
s75_e2
(
end
));
fprintf
(
fd
,
"s16 s100n_kHz_7_5[%d]__attribute__((aligned(16)))= {"
,
length
(
s100_n2
));
fprintf
(
fd
,
"%d,"
,
s100_n2
(
1
:(
end
-
1
)));
fprintf
(
fd
,
"%d};\n\n"
,
s100_n2
(
end
));
fprintf
(
fd
,
"s16 s100e_kHz_7_5[%d]__attribute__((aligned(16)))= {"
,
length
(
s100_n2
));
fprintf
(
fd
,
"%d,"
,
s100_e2
(
1
:(
end
-
1
)));
fprintf
(
fd
,
"%d};\n\n"
,
s100_e2
(
end
));
fclose
(
fd
);
end
function
[
s_n2
,
s_e2
]
=
gen_sig
(
RB
)
% 20MHz BW
cp0
=
160
;
cp
=
144
;
cpe
=
512
;
samplerate
=
30.72e6
;
ofdm_size
=
2048
;
len
=
15360
;
switch
(
RB
)
case
6
ratio
=
1
/
16
;
case
15
ratio
=
1
/
8
;
case
25
ratio
=
1
/
4
;
case
50
ratio
=
1
/
2
;
case
75
ratio
=
3
/
4
;
case
100
ratio
=
1
;
otherwise
disp
(
"Wrong Number of RB"
);
end
cp0
=
cp0
*
ratio
;
cp
=
cp
*
ratio
;
cpe
=
cpe
*
ratio
;
samplerate
=
samplerate
*
ratio
;
ofdm_size
=
ofdm_size
*
ratio
;
len
=
len
*
ratio
;
s_n0
=
floor
(
32767
*
exp
(
-
sqrt
(
-
1
)
*
2
*
pi
*
(
-
cp0
:
ofdm_size
-
1
)
*
7.5e3
/
samplerate
));
s_n1
=
floor
(
32767
*
exp
(
-
sqrt
(
-
1
)
*
2
*
pi
*
(
-
cp
:
ofdm_size
-
1
)
*
7.5e3
/
samplerate
));
s_n
=
[
s_n0
s_n1
s_n1
s_n1
s_n1
s_n1
s_n1
];
s_n2
=
zeros
(
1
,
2
*
len
);
s_n2
(
1
:
2
:
end
)
=
real
(
s_n
);
s_n2
(
2
:
2
:
end
)
=
imag
(
s_n
);
s_e
=
floor
(
32767
*
exp
(
-
sqrt
(
-
1
)
*
2
*
pi
*
(
-
cpe
:
ofdm_size
-
1
)
*
7.5e3
/
samplerate
));
s_e
=
[
s_e
s_e
s_e
s_e
s_e
s_e
];
s_e2
=
zeros
(
1
,
2
*
len
);
s_e2
(
1
:
2
:
end
)
=
real
(
s_e
);
s_e2
(
2
:
2
:
end
)
=
imag
(
s_e
);
end
openair1/PHY/MODULATION/kHz_7_5.h
deleted
100644 → 0
View file @
16314f04
This diff is collapsed.
Click to expand it.
openair1/PHY/MODULATION/modulation_extern.h
View file @
4221816f
...
...
@@ -19,18 +19,18 @@
* contact@openairinterface.org
*/
extern
int16_t
s6n_kHz_7_5
[
1920
]
;
extern
int16_t
s6e_kHz_7_5
[
1920
]
;
extern
int16_t
s15n_kHz_7_5
[
3840
]
;
extern
int16_t
s15e_kHz_7_5
[
3840
]
;
extern
int16_t
s25n_kHz_7_5
[
7680
]
;
extern
int16_t
s25e_kHz_7_5
[
7680
]
;
extern
int16_t
s50n_kHz_7_5
[
15360
]
;
extern
int16_t
s50e_kHz_7_5
[
15360
]
;
extern
int16_t
s75n_kHz_7_5
[
23040
]
;
extern
int16_t
s75e_kHz_7_5
[
23040
]
;
extern
int16_t
s100n_kHz_7_5
[
30720
]
;
extern
int16_t
s100e_kHz_7_5
[
30720
]
;
extern
int16_t
*
s6n_kHz_7_5
;
extern
int16_t
*
s6e_kHz_7_5
;
extern
int16_t
*
s15n_kHz_7_5
;
extern
int16_t
*
s15e_kHz_7_5
;
extern
int16_t
*
s25n_kHz_7_5
;
extern
int16_t
*
s25e_kHz_7_5
;
extern
int16_t
*
s50n_kHz_7_5
;
extern
int16_t
*
s50e_kHz_7_5
;
extern
int16_t
*
s75n_kHz_7_5
;
extern
int16_t
*
s75e_kHz_7_5
;
extern
int16_t
*
s100n_kHz_7_5
;
extern
int16_t
*
s100e_kHz_7_5
;
extern
short
conjugate75
[
8
];
...
...
openair1/PHY/MODULATION/modulation_vars.h
View file @
4221816f
...
...
@@ -19,7 +19,6 @@
* contact@openairinterface.org
*/
#include "kHz_7_5.h"
short
conjugate75
[
8
]
__attribute__
((
aligned
(
16
)))
=
{
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
}
;
short
conjugate75_2
[
8
]
__attribute__
((
aligned
(
16
)))
=
{
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
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