rfsimulator: add delay and Doppler simulation for circular orbit and add according channel models SAT_LEO_TRANS and SAT_LEO_REGEN

Delay and Doppler computation is done as in Matlab function dopplerShiftCircularOrbit:
https://de.mathworks.com/help/satcom/ref/dopplershiftcircularorbit.html
This commit is contained in:
Thomas Schlichter
2024-08-20 16:46:25 +02:00
parent 68b07d542c
commit 6a8edaf317
4 changed files with 149 additions and 14 deletions
+37 -2
View File
@@ -128,6 +128,7 @@ void fill_channel_desc(channel_desc_t *chan_desc,
chan_desc->first_run = 1;
chan_desc->ip = 0.0;
chan_desc->max_Doppler = max_Doppler;
chan_desc->Doppler_phase_cur = calloc(nb_rx, sizeof(double));
chan_desc->ch = calloc(nb_tx*nb_rx, sizeof(struct complexd *));
chan_desc->chF = calloc(nb_tx*nb_rx, sizeof(struct complexd *));
chan_desc->a = calloc(nb_taps, sizeof(struct complexd *));
@@ -1653,6 +1654,37 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
0);
break;
case SAT_LEO_TRANS:
case SAT_LEO_REGEN:
nb_taps = 1;
Td = 0;
channel_length = 1;
ricean_factor = 0.0;
aoa = 0.0;
maxDoppler = 0;
chan_desc->sat_height = 600e3;
chan_desc->enable_dynamic_delay = true;
chan_desc->enable_dynamic_Doppler = false; // TODO: requires UE to support continuous Doppler estimation, compensation and pre-compensation
fill_channel_desc(chan_desc,nb_tx,
nb_rx,
nb_taps,
channel_length,
default_amp_lin,
NULL,
NULL,
Td,
sampling_rate,
channel_bandwidth,
ricean_factor,
aoa,
forgetting_factor,
maxDoppler,
channel_offset,
path_loss_dB,
0);
printf("%s: satellite orbit height %f km\n", map_int_to_str(channelmod_names, channel_model), chan_desc->sat_height / 1000);
break;
default:
LOG_W(OCM,"channel model not yet supported\n");
free(chan_desc);
@@ -1711,6 +1743,7 @@ void free_channel_desc_scm(channel_desc_t *ch) {
free(ch->R_sqrt[i]);
free(ch->R_sqrt);
free(ch->Doppler_phase_cur);
free(ch->ch);
free(ch->chF);
free(ch->a);
@@ -1743,9 +1776,9 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) {
struct complexd phase, alpha, beta;
start_meas(&desc->random_channel);
// For AWGN channel, the received signal (Srx) is equal to transmitted signal (Stx) plus noise (N), i.e., Srx = Stx + N,
// For AWGN and SAT_LEO_* channels, the received signal (Srx) is equal to transmitted signal (Stx) plus noise (N), i.e., Srx = Stx + N,
// therefore, the channel matrix is the identity matrix.
if (desc->modelid == AWGN) {
if (desc->modelid == AWGN || desc->modelid == SAT_LEO_TRANS || desc->modelid == SAT_LEO_REGEN) {
for (aarx=0; aarx<desc->nb_rx; aarx++) {
for (aatx = 0; aatx < desc->nb_tx; aatx++) {
desc->ch[aarx+(aatx*desc->nb_rx)][0].r = aarx%desc->nb_tx == aatx ? 1.0 : 0.0;
@@ -2071,6 +2104,8 @@ static void display_channelmodel(channel_desc_t *cd,int debug, telnet_printfunc_
cd->forgetting_factor);
prnt("Initial phase: %lf nb_path: %i \n",
cd->ip, cd->nb_paths);
if (cd->modelid == SAT_LEO_TRANS || cd->modelid == SAT_LEO_REGEN)
prnt("satellite orbit height: %f\n", cd->sat_height);
for (int i=0; i<cd->nb_taps ; i++) {
prnt("taps: %i lin. ampli. : %lf delay: %lf \n",i,cd->amps[i], cd->delays[i]);
+16
View File
@@ -126,6 +126,18 @@ typedef struct {
char *model_name;
/// flags to properly trigger memory free
unsigned int free_flags;
/// time stamp when the time varying channel emulation starts (when client connected)
uint64_t start_TS;
/// height of LEO satellite
float sat_height;
/// flag to enable dynamic delay simulation for LEO satellite
bool enable_dynamic_delay;
/// flag to enable dynamic Doppler simulation for LEO satellite
bool enable_dynamic_Doppler;
/// Doppler phase increment (might vary over time, e.g. for LEO satellite)
float Doppler_phase_inc;
/// current Doppler phase of each RX antenna (for continuous phase from one block to the next)
float *Doppler_phase_cur;
} channel_desc_t;
typedef struct {
@@ -218,6 +230,8 @@ typedef enum {
EPA_low,
EPA_medium,
EPA_high,
SAT_LEO_TRANS,
SAT_LEO_REGEN,
} SCM_t;
#define CHANNELMOD_MAP_INIT \
{"custom",custom},\
@@ -253,6 +267,8 @@ typedef enum {
{"EPA_low",EPA_low},\
{"EPA_medium",EPA_medium},\
{"EPA_high",EPA_high},\
{"SAT_LEO_TRANS",SAT_LEO_TRANS},\
{"SAT_LEO_REGEN",SAT_LEO_REGEN},\
{NULL, -1}
#define CONFIG_HLP_SNR "Set average SNR in dB (for --siml1 option)\n"