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
littleBu
OpenXG-RAN
Commits
31b8d98b
Commit
31b8d98b
authored
Dec 09, 2024
by
Bartosz Podrygajlo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Formating for PHY_ofdm_mod
parent
054506f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
62 deletions
+57
-62
openair1/PHY/MODULATION/ofdm_mod.c
openair1/PHY/MODULATION/ofdm_mod.c
+57
-62
No files found.
openair1/PHY/MODULATION/ofdm_mod.c
View file @
31b8d98b
...
...
@@ -122,36 +122,43 @@ void nr_normal_prefix_mod(c16_t *txdataF, c16_t *txdata, uint8_t nsymb, const NR
}
void
PHY_ofdm_mod
(
int
*
input
,
/// pointer to complex input
int
*
output
,
/// pointer to complex output
int
fftsize
,
/// FFT_SIZE
unsigned
char
nb_symbols
,
/// number of OFDM symbols
unsigned
short
nb_prefix_samples
,
/// cyclic prefix length
Extension_t
etype
/// type of extension
)
void
PHY_ofdm_mod
(
int
*
input
,
/// pointer to complex input
int
*
output
,
/// pointer to complex output
int
fftsize
,
/// FFT_SIZE
unsigned
char
nb_symbols
,
/// number of OFDM symbols
unsigned
short
nb_prefix_samples
,
/// cyclic prefix length
Extension_t
etype
/// type of extension
)
{
if
(
nb_symbols
==
0
)
return
;
if
(
nb_symbols
==
0
)
return
;
int16_t
temp
[
2
*
2
*
6144
*
4
]
__attribute__
((
aligned
(
32
)));
int
i
,
j
;
int16_t
temp
[
2
*
2
*
6144
*
4
]
__attribute__
((
aligned
(
32
)));
int
i
,
j
;
volatile
int
*
output_ptr
=
(
int
*
)
0
;
volatile
int
*
output_ptr
=
(
int
*
)
0
;
int
*
temp_ptr
=
(
int
*
)
0
;
int
*
temp_ptr
=
(
int
*
)
0
;
idft_size_idx_t
idft_size
=
get_idft
(
fftsize
);
#ifdef DEBUG_OFDM_MOD
printf
(
"[PHY] OFDM mod (size %d,prefix %d) Symbols %d, input %p, output %p
\n
"
,
fftsize
,
nb_prefix_samples
,
nb_symbols
,
input
,
output
);
fftsize
,
nb_prefix_samples
,
nb_symbols
,
input
,
output
);
#endif
for
(
i
=
0
;
i
<
nb_symbols
;
i
++
)
{
for
(
i
=
0
;
i
<
nb_symbols
;
i
++
)
{
#ifdef DEBUG_OFDM_MOD
printf
(
"[PHY] symbol %d/%d offset %d (%p,%p -> %p)
\n
"
,
i
,
nb_symbols
,
i
*
fftsize
+
(
i
*
nb_prefix_samples
),
input
,
&
input
[
i
*
fftsize
],
&
output
[(
i
*
fftsize
)
+
((
i
)
*
nb_prefix_samples
)]);
printf
(
"[PHY] symbol %d/%d offset %d (%p,%p -> %p)
\n
"
,
i
,
nb_symbols
,
i
*
fftsize
+
(
i
*
nb_prefix_samples
),
input
,
&
input
[
i
*
fftsize
],
&
output
[(
i
*
fftsize
)
+
((
i
)
*
nb_prefix_samples
)]);
#endif
// on AVX2 need 256-bit alignment
...
...
@@ -161,70 +168,58 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
// Note: will have to adjust for synchronization offset!
switch
(
etype
)
{
case
CYCLIC_PREFIX
:
output_ptr
=
&
output
[(
i
*
fftsize
)
+
((
1
+
i
)
*
nb_prefix_samples
)];
temp_ptr
=
(
int
*
)
temp
;
// msg("Doing cyclic prefix method\n");
{
memcpy
((
void
*
)
output_ptr
,(
void
*
)
temp_ptr
,
fftsize
<<
2
);
}
memcpy
((
void
*
)
&
output_ptr
[
-
nb_prefix_samples
],(
void
*
)
&
output_ptr
[
fftsize
-
nb_prefix_samples
],
nb_prefix_samples
<<
2
);
break
;
case
CYCLIC_SUFFIX
:
output_ptr
=
&
output
[(
i
*
fftsize
)
+
(
i
*
nb_prefix_samples
)];
case
CYCLIC_PREFIX
:
output_ptr
=
&
output
[(
i
*
fftsize
)
+
((
1
+
i
)
*
nb_prefix_samples
)];
temp_ptr
=
(
int
*
)
temp
;
temp_ptr
=
(
int
*
)
temp
;
// msg("Doing cyclic prefix method\n")
;
// msg("Doing cyclic suffix method\n");
{
memcpy
((
void
*
)
output_ptr
,
(
void
*
)
temp_ptr
,
fftsize
<<
2
);
}
memcpy
((
void
*
)
&
output_ptr
[
-
nb_prefix_samples
],
(
void
*
)
&
output_ptr
[
fftsize
-
nb_prefix_samples
],
nb_prefix_samples
<<
2
);
break
;
for
(
j
=
0
;
j
<
fftsize
;
j
++
)
{
output_ptr
[
j
]
=
temp_ptr
[
2
*
j
];
}
case
CYCLIC_SUFFIX
:
output_ptr
=
&
output
[(
i
*
fftsize
)
+
(
i
*
nb_prefix_samples
)];
for
(
j
=
0
;
j
<
nb_prefix_samples
;
j
++
)
output_ptr
[
fftsize
+
j
]
=
output_ptr
[
j
];
temp_ptr
=
(
int
*
)
temp
;
break
;
// msg("Doing cyclic suffix method\n")
;
case
ZEROS
:
for
(
j
=
0
;
j
<
fftsize
;
j
++
)
{
output_ptr
[
j
]
=
temp_ptr
[
2
*
j
];
}
break
;
for
(
j
=
0
;
j
<
nb_prefix_samples
;
j
++
)
output_ptr
[
fftsize
+
j
]
=
output_ptr
[
j
];
case
NONE
:
break
;
// msg("NO EXTENSION!\n");
output_ptr
=
&
output
[
fftsize
];
case
ZEROS
:
temp_ptr
=
(
int
*
)
temp
;
break
;
for
(
j
=
0
;
j
<
fftsize
;
j
++
)
{
output_ptr
[
j
]
=
temp_ptr
[
2
*
j
];
case
NONE
:
// msg("NO EXTENSION!\n");
output_ptr
=
&
output
[
fftsize
];
}
temp_ptr
=
(
int
*
)
temp
;
break
;
for
(
j
=
0
;
j
<
fftsize
;
j
++
)
{
output_ptr
[
j
]
=
temp_ptr
[
2
*
j
];
}
default:
break
;
break
;
default:
break
;
}
}
}
void
do_OFDM_mod
(
c16_t
**
txdataF
,
c16_t
**
txdata
,
uint32_t
frame
,
uint16_t
next_slot
,
LTE_DL_FRAME_PARMS
*
frame_parms
)
{
...
...
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