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
wangjie
OpenXG-RAN
Commits
4e55c9da
Commit
4e55c9da
authored
Jan 14, 2019
by
Francesco Mani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CFO included in pbchsim
parent
a85e8a8f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
6 deletions
+55
-6
openair1/SIMULATION/NR_PHY/pbchsim.c
openair1/SIMULATION/NR_PHY/pbchsim.c
+53
-4
openair1/SIMULATION/RF/rf.c
openair1/SIMULATION/RF/rf.c
+2
-2
No files found.
openair1/SIMULATION/NR_PHY/pbchsim.c
View file @
4e55c9da
...
...
@@ -87,10 +87,12 @@ int main(int argc, char **argv)
int
i
,
l
,
aa
;
double
sigma2
,
sigma2_dB
=
10
,
SNR
,
snr0
=-
2
.
0
,
snr1
=
2
.
0
;
double
cfo
=
0
;
uint8_t
snr1set
=
0
;
int
**
txdata
;
double
**
s_re
,
**
s_im
,
**
r_re
,
**
r_im
;
double
iqim
=
0
.
0
;
double
ip
=
0
.
0
;
unsigned
char
pbch_pdu
[
6
];
// int sync_pos, sync_pos_slot;
// FILE *rx_frame_file;
...
...
@@ -118,7 +120,7 @@ int main(int argc, char **argv)
double
pbch_sinr
;
int
pbch_tx_ant
;
int
N_RB_DL
=
273
,
mu
=
1
;
int
N_RB_DL
=
106
,
mu
=
1
;
unsigned
char
frame_type
=
0
;
unsigned
char
pbch_phase
=
0
;
...
...
@@ -144,7 +146,7 @@ int main(int argc, char **argv)
randominit
(
0
);
while
((
c
=
getopt
(
argc
,
argv
,
"f:hA:pf:g:i:j:n:s:S:t:x:y:z:N:F:GR:dP:IL:"
))
!=
-
1
)
{
while
((
c
=
getopt
(
argc
,
argv
,
"f:hA:pf:g:i:j:n:
o:
s:S:t:x:y:z:N:F:GR:dP:IL:"
))
!=
-
1
)
{
switch
(
c
)
{
case
'f'
:
write_output_file
=
1
;
...
...
@@ -210,6 +212,11 @@ int main(int argc, char **argv)
n_trials
=
atoi
(
optarg
);
break
;
case
'o'
:
cfo
=
atof
(
optarg
);
msg
(
"Setting CFO to %f Hz
\n
"
,
cfo
);
break
;
case
's'
:
snr0
=
atof
(
optarg
);
msg
(
"Setting SNR0 to %f
\n
"
,
snr0
);
...
...
@@ -323,6 +330,7 @@ int main(int argc, char **argv)
printf
(
"-z Number of RX antennas used in UE
\n
"
);
printf
(
"-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1
\n
"
);
printf
(
"-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2
\n
"
);
printf
(
"-o Carrier frequency offset in Hz
\n
"
);
printf
(
"-N Nid_cell
\n
"
);
printf
(
"-R N_RB_DL
\n
"
);
printf
(
"-O oversampling factor (1,2,4,8,16)
\n
"
);
...
...
@@ -358,26 +366,43 @@ int main(int argc, char **argv)
nr_phy_config_request_sim
(
gNB
,
N_RB_DL
,
N_RB_DL
,
mu
);
phy_init_nr_gNB
(
gNB
,
0
,
0
);
double
fs
,
bw
;
double
fs
,
bw
,
scs
,
eps
;
if
(
mu
==
1
&&
N_RB_DL
==
217
)
{
fs
=
122.88e6
;
bw
=
80e6
;
scs
=
30000
;
}
else
if
(
mu
==
1
&&
N_RB_DL
==
245
)
{
fs
=
122.88e6
;
bw
=
90e6
;
scs
=
30000
;
}
else
if
(
mu
==
1
&&
N_RB_DL
==
273
)
{
fs
=
122.88e6
;
bw
=
100e6
;
scs
=
30000
;
}
else
if
(
mu
==
1
&&
N_RB_DL
==
106
)
{
fs
=
61.44e6
;
bw
=
40e6
;
scs
=
30000
;
}
else
AssertFatal
(
1
==
0
,
"Unsupported numerology for mu %d, N_RB %d
\n
"
,
mu
,
N_RB_DL
);
// cfo with respect to sub-carrier spacing
eps
=
cfo
/
scs
;
int
IFO
;
if
(
eps
!=
0
.
0
){
printf
(
"Introducing a CFO of %lf relative to SCS of %d kHz
\n
"
,
eps
,(
int
)(
scs
/
1000
));
if
(
eps
>
0
)
IFO
=
(
int
)(
eps
+
0
.
5
);
else
IFO
=
(
int
)(
eps
-
0
.
5
);
printf
(
"FFO = %lf; IFO = %d
\n
"
,
eps
-
IFO
,
IFO
);
}
gNB2UE
=
new_channel_desc_scm
(
n_tx
,
n_rx
,
channel_model
,
...
...
@@ -490,6 +515,7 @@ int main(int argc, char **argv)
// printf("txlev %d (%f)\n",txlev,10*log10(txlev));
for
(
i
=
0
;
i
<
frame_length_complex_samples
;
i
++
)
{
for
(
aa
=
0
;
aa
<
frame_parms
->
nb_antennas_tx
;
aa
++
)
{
r_re
[
aa
][
i
]
=
((
double
)(((
short
*
)
txdata
[
aa
]))[(
i
<<
1
)]);
...
...
@@ -512,6 +538,29 @@ int main(int argc, char **argv)
sigma2
=
pow
(
10
,
sigma2_dB
/
10
);
// printf("sigma2 %f (%f dB)\n",sigma2,sigma2_dB);
if
(
eps
!=
0
.
0
)
rf_rx
(
r_re
,
// real part of txdata
r_im
,
// imag part of txdata
NULL
,
// interference real part
NULL
,
// interference imag part
0
,
// interference power
frame_parms
->
nb_antennas_rx
,
// number of rx antennas
frame_length_complex_samples
,
// number of samples in frame
1.0e7
/
frame_length_complex_samples
,
//sampling time (ns)
cfo
,
// frequency offset in Hz
0
.
0
,
// drift (not implemented)
0
.
0
,
// noise figure (not implemented)
0
.
0
,
// rx gain in dB ?
200
,
// 3rd order non-linearity in dB ?
&
ip
,
// initial phase
30.0e3
,
// phase noise cutoff in kHz
-
500
.
0
,
// phase noise amplitude in dBc
0
.
0
,
// IQ imbalance (dB),
0
.
0
);
// IQ phase imbalance (rad)
for
(
i
=
0
;
i
<
frame_length_complex_samples
;
i
++
)
{
for
(
aa
=
0
;
aa
<
frame_parms
->
nb_antennas_rx
;
aa
++
)
{
...
...
openair1/SIMULATION/RF/rf.c
View file @
4e55c9da
...
...
@@ -107,10 +107,10 @@ void rf_rx(double **r_re,
exit
(
-
1
);
}
if
(
fabs
(
f_off
)
>
10000
.
0
)
{
/*
if (fabs(f_off) > 10000.0) {
printf("rf.c: Illegal f_off %f\n",f_off);
exit(-1);
}
}
*/
if
(
fabs
(
drift
)
>
1000
.
0
)
{
printf
(
"rf.c: Illegal drift %f
\n
"
,
drift
);
...
...
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