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
2b40675b
Commit
2b40675b
authored
Nov 09, 2022
by
Roberto Louro Magueta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply Doppler Effect
parent
52381833
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
9 deletions
+35
-9
openair1/SIMULATION/TOOLS/multipath_channel.c
openair1/SIMULATION/TOOLS/multipath_channel.c
+20
-5
openair1/SIMULATION/TOOLS/random_channel.c
openair1/SIMULATION/TOOLS/random_channel.c
+6
-4
openair1/SIMULATION/TOOLS/sim.h
openair1/SIMULATION/TOOLS/sim.h
+9
-0
No files found.
openair1/SIMULATION/TOOLS/multipath_channel.c
View file @
2b40675b
...
...
@@ -29,6 +29,7 @@
#include "sim.h"
//#define DEBUG_CH
//#define DOPPLER_DEBUG
uint8_t
multipath_channel_nosigconv
(
channel_desc_t
*
desc
)
{
...
...
@@ -201,11 +202,16 @@ void __attribute__ ((no_sanitize_address)) multipath_channel(channel_desc_t *des
}
#endif
struct
complexd
cexp_doppler
[
length
];
if
(
desc
->
max_Doppler
!=
0
.
0
)
{
get_cexp_doppler
(
cexp_doppler
,
desc
,
length
);
}
for
(
int
i
=
0
;
i
<
((
int
)
length
-
dd
);
i
++
)
{
for
(
int
ii
=
0
;
ii
<
desc
->
nb_rx
;
ii
++
)
{
struct
complexd
rx_tmp
=
{
0
};
for
(
int
j
=
0
;
j
<
desc
->
nb_tx
;
j
++
)
{
struct
complexd
*
chan
=
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)];
struct
complexd
*
chan
=
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)];
for
(
int
l
=
0
;
l
<
(
int
)
desc
->
channel_length
;
l
++
)
{
if
((
i
>=
0
)
&&
(
i
-
l
)
>=
0
)
{
struct
complexd
tx
;
...
...
@@ -215,14 +221,23 @@ void __attribute__ ((no_sanitize_address)) multipath_channel(channel_desc_t *des
rx_tmp
.
i
+=
(
tx
.
i
*
chan
[
l
].
r
)
+
(
tx
.
r
*
chan
[
l
].
i
);
}
if
(
i
==
0
&&
log_channel
==
1
)
{
printf
(
"channel[%d][%d][%d] = %f dB
\t
(%e, %e)
\n
"
,
ii
,
j
,
l
,
10
*
log10
(
pow
(
chan
[
l
].
r
,
2
.
0
)
+
pow
(
chan
[
l
].
i
,
2
.
0
)),
chan
[
l
].
r
,
chan
[
l
].
i
);
printf
(
"channel[%d][%d][%d] = %f dB
\t
(%e, %e)
\n
"
,
ii
,
j
,
l
,
10
*
log10
(
pow
(
chan
[
l
].
r
,
2
.
0
)
+
pow
(
chan
[
l
].
i
,
2
.
0
)),
chan
[
l
].
r
,
chan
[
l
].
i
);
}
}
//l
}
// j
if
(
desc
->
max_Doppler
!=
0
.
0
)
rx_tmp
=
cdMul
(
rx_tmp
,
cexp_doppler
[
i
]);
#ifdef DOPPLER_DEBUG
printf
(
"[k %2i] cexp_doppler = (%7.4f, %7.4f), abs(cexp_doppler) = %.4f
\n
"
,
i
,
cexp_doppler
[
i
].
r
,
cexp_doppler
[
i
].
i
,
sqrt
(
cexp_doppler
[
i
].
r
*
cexp_doppler
[
i
].
r
+
cexp_doppler
[
i
].
i
*
cexp_doppler
[
i
].
i
));
#endif
rx_sig_re
[
ii
][
i
+
dd
]
=
rx_tmp
.
r
*
path_loss
;
rx_sig_im
[
ii
][
i
+
dd
]
=
rx_tmp
.
i
*
path_loss
;
#ifdef DEBUG_CH
...
...
openair1/SIMULATION/TOOLS/random_channel.c
View file @
2b40675b
...
...
@@ -453,7 +453,7 @@ 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
)
void
get_cexp_doppler
(
struct
complexd
*
cexp_doppler
,
channel_desc_t
*
chan_desc
,
const
uint32_t
length
)
{
// TS 38.104 - Table G.3-1
uint16_t
Dmin
=
2
;
...
...
@@ -466,9 +466,10 @@ void get_cexp_doppler(struct complexd *cexp_doppler, channel_desc_t *chan_desc)
#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
cos_theta
[
length
];
double
fs
[
length
];
for
(
uint32_t
t_idx
=
0
;
t_idx
<
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
));
...
...
@@ -1898,6 +1899,7 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) {
#ifdef DEBUG_CH
printf
(
"(%d,%d,%d)->(%e,%e)
\n
"
,
k
,
aarx
,
aatx
,
desc
->
ch
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
k
].
r
,
desc
->
ch
[
aarx
+
(
aatx
*
desc
->
nb_rx
)][
k
].
i
);
#endif
}
//channel_length
#ifdef DEBUG_CH_POWER
ch_power_count
++
;
...
...
openair1/SIMULATION/TOOLS/sim.h
View file @
2b40675b
...
...
@@ -348,6 +348,15 @@ void set_channeldesc_owner(channel_desc_t *cdesc, channelmod_moduleid_t module_i
\param module_name is the C string to use as model name for the channel pointed by cdesc
*/
void
set_channeldesc_name
(
channel_desc_t
*
cdesc
,
char
*
modelname
);
/** \fn void get_cexp_doppler(struct complexd *cexp_doppler, channel_desc_t *chan_desc, const uint32_t length)
\brief This routine generates the complex exponential to apply the Doppler shift
\param cexp_doppler Output with the complex exponential of Doppler shift
\param desc Pointer to the channel descriptor
\param length Size of complex exponential of Doppler shift
*/
void
get_cexp_doppler
(
struct
complexd
*
cexp_doppler
,
channel_desc_t
*
chan_desc
,
const
uint32_t
length
);
/** \fn void random_channel(channel_desc_t *desc)
\brief This routine generates a random channel response (time domain) according to a tapped delay line model.
\param desc Pointer to the channel descriptor
...
...
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