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
abb6fadd
Commit
abb6fadd
authored
Aug 31, 2022
by
Roberto Louro Magueta
Committed by
luis_pereira87
Oct 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementation of function add_noise()
parent
f8160bd3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
12 deletions
+51
-12
openair1/SIMULATION/NR_PHY/ulsim.c
openair1/SIMULATION/NR_PHY/ulsim.c
+1
-12
openair1/SIMULATION/TOOLS/multipath_channel.c
openair1/SIMULATION/TOOLS/multipath_channel.c
+26
-0
openair1/SIMULATION/TOOLS/sim.h
openair1/SIMULATION/TOOLS/sim.h
+24
-0
No files found.
openair1/SIMULATION/NR_PHY/ulsim.c
View file @
abb6fadd
...
...
@@ -305,7 +305,6 @@ int main(int argc, char **argv)
int
Imcs
=
9
;
uint8_t
precod_nbr_layers
=
1
;
int
gNB_id
=
0
;
int
ap
;
int
tx_offset
;
int32_t
txlev_sum
=
0
,
atxlev
[
4
];
int
start_rb
=
0
;
...
...
@@ -1319,17 +1318,7 @@ int main(int argc, char **argv)
}
else
{
multipath_tv_channel
(
UE2gNB
,
s_re
,
s_im
,
r_re
,
r_im
,
2
*
slot_length
,
0
);
}
for
(
i
=
0
;
i
<
slot_length
;
i
++
)
{
for
(
ap
=
0
;
ap
<
frame_parms
->
nb_antennas_rx
;
ap
++
)
{
rxdata
[
ap
][
slot_offset
+
i
+
delay
].
r
=
(
int16_t
)((
r_re
[
ap
][
i
])
+
(
sqrt
(
sigma
/
2
)
*
gaussdouble
(
0
.
0
,
1
.
0
)));
// convert to fixed point
rxdata
[
ap
][
slot_offset
+
i
+
delay
].
i
=
(
int16_t
)((
r_im
[
ap
][
i
])
+
(
sqrt
(
sigma
/
2
)
*
gaussdouble
(
0
.
0
,
1
.
0
)));
/* Add phase noise if enabled */
if
(
pdu_bit_map
&
PUSCH_PDU_BITMAP_PUSCH_PTRS
)
{
phase_noise
(
ts
,
&
rxdata
[
ap
][
slot_offset
].
r
,
&
rxdata
[
ap
][
slot_offset
].
i
);
}
}
}
add_noise
(
rxdata
,
(
const
double
**
)
r_re
,
(
const
double
**
)
r_im
,
sigma
,
slot_length
,
slot_offset
,
ts
,
delay
,
pdu_bit_map
,
frame_parms
->
nb_antennas_rx
);
}
/*End input_fd */
...
...
openair1/SIMULATION/TOOLS/multipath_channel.c
View file @
abb6fadd
...
...
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "nfapi_nr_interface_scf.h"
#include "PHY/TOOLS/tools_defs.h"
#include "SIMULATION/RF/rf.h"
#include "sim.h"
...
...
@@ -144,6 +145,31 @@ void multipath_channel(channel_desc_t *desc,
}
#else
void
add_noise
(
c16_t
**
rxdata
,
const
double
**
r_re
,
const
double
**
r_im
,
const
double
sigma
,
const
int
length
,
const
int
slot_offset
,
const
double
ts
,
const
int
delay
,
const
uint16_t
pdu_bit_map
,
const
uint8_t
nb_antennas_rx
)
{
for
(
int
i
=
0
;
i
<
length
;
i
++
)
{
for
(
int
ap
=
0
;
ap
<
nb_antennas_rx
;
ap
++
)
{
c16_t
*
rxd
=
&
rxdata
[
ap
][
slot_offset
+
i
+
delay
];
rxd
->
r
=
r_re
[
ap
][
i
]
+
sqrt
(
sigma
/
2
)
*
gaussdouble
(
0
.
0
,
1
.
0
);
// convert to fixed point
rxd
->
i
=
r_im
[
ap
][
i
]
+
sqrt
(
sigma
/
2
)
*
gaussdouble
(
0
.
0
,
1
.
0
);
/* Add phase noise if enabled */
if
(
pdu_bit_map
&
PUSCH_PDU_BITMAP_PUSCH_PTRS
)
{
phase_noise
(
ts
,
&
rxdata
[
ap
][
slot_offset
+
i
+
delay
].
r
,
&
rxdata
[
ap
][
slot_offset
+
i
+
delay
].
i
);
}
}
}
}
void
multipath_channel
(
channel_desc_t
*
desc
,
double
*
tx_sig_re
[
NB_ANTENNAS_TX
],
double
*
tx_sig_im
[
NB_ANTENNAS_TX
],
...
...
openair1/SIMULATION/TOOLS/sim.h
View file @
abb6fadd
...
...
@@ -348,6 +348,30 @@ void set_channeldesc_name(channel_desc_t *cdesc,char *modelname);
*/
int
random_channel
(
channel_desc_t
*
desc
,
uint8_t
abstraction_flag
);
/**
\brief Add AWGN noise and phase noise if enabled
\param rxdata output data with noise
\param r_re real part of input data without noise
\param r_im imaginary part of input data without noise
\param sigma noise power
\param length number of samples to apply the noise
\param slot_offset slot offset to start applying the noise
\param ts sampling time
\param delay introduce delay in terms of number of samples
\param pdu_bit_map bitmap indicating presence of optional PDUs
\param nb_antennas_rx number of receive antennas
*/
void
add_noise
(
c16_t
**
rxdata
,
const
double
**
r_re
,
const
double
**
r_im
,
const
double
sigma
,
const
int
length
,
const
int
slot_offset
,
const
double
ts
,
const
int
delay
,
const
uint16_t
pdu_bit_map
,
const
uint8_t
nb_antennas_rx
);
/**\fn void multipath_channel(channel_desc_t *desc,
double tx_sig_re[NB_ANTENNAS_TX],
double tx_sig_im[NB_ANTENANS_TX],
...
...
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