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
Michael Black
OpenXG-RAN
Commits
e44a99b3
Commit
e44a99b3
authored
Nov 09, 2022
by
Roberto Louro Magueta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementation of get_cexp_doppler() function to compute the Doppler Effect
parent
8773e423
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
openair1/SIMULATION/TOOLS/random_channel.c
openair1/SIMULATION/TOOLS/random_channel.c
+38
-0
openair1/SIMULATION/TOOLS/sim.h
openair1/SIMULATION/TOOLS/sim.h
+2
-0
No files found.
openair1/SIMULATION/TOOLS/random_channel.c
View file @
e44a99b3
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <complex.h>
#include "PHY/TOOLS/tools_defs.h"
#include "PHY/TOOLS/tools_defs.h"
...
@@ -37,6 +38,7 @@
...
@@ -37,6 +38,7 @@
//#define DEBUG_CH
//#define DEBUG_CH
//#define DEBUG_CH_POWER
//#define DEBUG_CH_POWER
//#define DOPPLER_DEBUG
#include "assertions.h"
#include "assertions.h"
...
@@ -451,6 +453,42 @@ void tdlModel(int tdl_paths, double *tdl_delays, double *tdl_amps_dB, double DS
...
@@ -451,6 +453,42 @@ void tdlModel(int tdl_paths, double *tdl_delays, double *tdl_amps_dB, double DS
}
}
}
}
void
get_cexp_doppler
(
struct
complexd
*
cexp_doppler
,
channel_desc_t
*
chan_desc
)
{
// TS 38.104 - Table G.3-1
uint16_t
Dmin
=
2
;
uint16_t
Ds
=
300
;
double
c
=
299792458
;
double
v
=
chan_desc
->
max_Doppler
*
(
c
/
(
double
)
chan_desc
->
center_freq
);
#ifdef DOPPLER_DEBUG
printf
(
"v = %f
\n
"
,
v
);
#endif
double
phase0
=
2
*
M_PI
*
uniformrandom
();
double
cos_theta
[
chan_desc
->
channel_length
];
double
fs
[
chan_desc
->
channel_length
];
for
(
int
t_idx
=
0
;
t_idx
<
chan_desc
->
channel_length
;
t_idx
++
)
{
double
t
=
t_idx
/
(
chan_desc
->
sampling_rate
*
1e6
);
if
(
t
>=
0
&&
t
<=
Ds
/
v
)
{
cos_theta
[
t_idx
]
=
(
Ds
/
2
-
v
*
t
)
/
sqrt
(
Dmin
*
Dmin
+
(
Ds
/
2
-
v
*
t
)
*
(
Ds
/
2
-
v
*
t
));
}
else
if
(
t
>
Ds
/
v
&&
t
<=
2
*
Ds
/
v
)
{
cos_theta
[
t_idx
]
=
(
-
1
.
5
*
Ds
+
v
*
t
)
/
sqrt
(
Dmin
*
Dmin
+
(
-
1
.
5
*
Ds
+
v
*
t
)
*
(
-
1
.
5
*
Ds
+
v
*
t
));
}
else
{
cos_theta
[
t_idx
]
=
cos
(
fmod
(
t
,
2
*
Ds
/
v
));
}
fs
[
t_idx
]
=
chan_desc
->
max_Doppler
*
cos_theta
[
t_idx
];
double
complex
tmp_cexp_doppler
=
cexp
(
I
*
(
2
*
M_PI
*
fs
[
t_idx
]
*
t
+
phase0
));
cexp_doppler
[
t_idx
].
r
=
creal
(
tmp_cexp_doppler
);
cexp_doppler
[
t_idx
].
i
=
cimag
(
tmp_cexp_doppler
);
#ifdef DOPPLER_DEBUG
printf
(
"(%2i) t_us = %f, cos_theta = %f, fs = %f, cexp_doppler = (%f, %f)
\n
"
,
t_idx
,
t
*
1e6
,
cos_theta
[
t_idx
],
fs
[
t_idx
],
cexp_doppler
[
t_idx
].
r
,
cexp_doppler
[
t_idx
].
i
);
#endif
}
}
double
get_normalization_ch_factor
(
channel_desc_t
*
desc
)
double
get_normalization_ch_factor
(
channel_desc_t
*
desc
)
{
{
if
(
!
(
desc
->
channel_length
>
1
&&
desc
->
modelid
>=
TDL_A
&&
desc
->
modelid
<=
TDL_E
))
{
if
(
!
(
desc
->
channel_length
>
1
&&
desc
->
modelid
>=
TDL_A
&&
desc
->
modelid
<=
TDL_E
))
{
...
...
openair1/SIMULATION/TOOLS/sim.h
View file @
e44a99b3
...
@@ -80,6 +80,8 @@ typedef struct {
...
@@ -80,6 +80,8 @@ typedef struct {
struct
complexd
**
chF
;
struct
complexd
**
chF
;
///Maximum path delay in mus.
///Maximum path delay in mus.
double
Td
;
double
Td
;
///Carrier center frequency
uint64_t
center_freq
;
///Channel bandwidth in MHz.
///Channel bandwidth in MHz.
double
channel_bandwidth
;
double
channel_bandwidth
;
///System sampling rate in Msps.
///System sampling rate in Msps.
...
...
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