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
lizhongxiao
OpenXG-RAN
Commits
8c16f16c
Commit
8c16f16c
authored
Jun 06, 2019
by
laurent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add channel simulator in rfsimulator
parent
cba07363
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
+13
-15
targets/ARCH/rfsimulator/simulator.c
targets/ARCH/rfsimulator/simulator.c
+13
-15
No files found.
targets/ARCH/rfsimulator/simulator.c
View file @
8c16f16c
...
...
@@ -106,7 +106,6 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si
// −132.24 dBm is a LTE subcarrier noise, that was used in origin code (15KHz BW thermal noise)
const
double
rxGain
=
132
.
24
-
snr_dB
;
const
double
noise_per_sample
=
sqrt
(
0
.
5
*
noise_figure_watt
)
*
pow
(
10
,
rxGain
/
20
);
// Fixme: we don't fill the offset length samples at begining ?
// anyway, in today code, channel_offset=0
const
int
dd
=
abs
(
channelDesc
->
channel_offset
);
...
...
@@ -145,9 +144,9 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si
if
(
(
TS
*
nbTx
)
%
CirSize
+
nbSamples
<=
CirSize
)
// Cast to a wrong type for compatibility !
LOG_
I
(
HW
,
"Input power %f, output power: %f, channel path loss %f, noise coeff: %f
\n
"
,
10
*
log10
((
double
)
signal_energy
((
int32_t
*
)
&
input_sig
[(
TS
*
nbTx
)
%
CirSize
],
nbSamples
)),
10
*
log10
((
double
)
signal_energy
((
int32_t
*
)
after_channel_sig
,
nbSamples
)),
LOG_
D
(
HW
,
"Input power %f, output power: %f, channel path loss %f, noise coeff: %f
\n
"
,
10
*
log10
((
double
)
signal_energy
((
int32_t
*
)
&
input_sig
[(
TS
*
nbTx
)
%
CirSize
],
nbSamples
)),
10
*
log10
((
double
)
signal_energy
((
int32_t
*
)
after_channel_sig
,
nbSamples
)),
channelDesc
->
path_loss_dB
,
10
*
log10
(
noise_per_sample
));
}
...
...
@@ -548,7 +547,6 @@ int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimestamp, vo
nsamps
,
t
->
nextTimestamp
);
}
}
...
...
@@ -587,9 +585,9 @@ int rfsimulator_set_gains(openair0_device *device, openair0_config_t *openair0_c
}
__attribute__
((
__visibility__
(
"default"
)))
int
device_init
(
openair0_device
*
device
,
openair0_config_t
*
openair0_cfg
)
{
//
set_log(HW,OAILOG_DEBUG);
set_log
(
TMR
,
OAILOG_DEBUG
);
//
set_log(PHY,OAILOG_DEBUG);
//
to change the log level, use this on command line
// --log_config.hw_log_level debug
//
(for phy layer, replace "hw" by "phy"
rfsimulator_state_t
*
rfsimulator
=
(
rfsimulator_state_t
*
)
calloc
(
sizeof
(
rfsimulator_state_t
),
1
);
if
((
rfsimulator
->
ip
=
getenv
(
"RFSIMULATOR"
))
==
NULL
)
{
...
...
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