From 7ba63a20522e0fccb62e830c921bc8ad19edbd5a Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Thu, 24 Apr 2025 09:48:35 +0000 Subject: [PATCH] rfsimulator: for LEO NTN, calculate SAT acceleration towards gNB to determine ta-CommonDriftVariant-r17 --- radio/rfsimulator/apply_channelmod.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/radio/rfsimulator/apply_channelmod.c b/radio/rfsimulator/apply_channelmod.c index 2771706f55..1e873b8a2e 100644 --- a/radio/rfsimulator/apply_channelmod.c +++ b/radio/rfsimulator/apply_channelmod.c @@ -97,7 +97,12 @@ void rxAddInput(const c16_t *input_sig, double dist_sat_gnb = 0; double vel_sat_gnb = 0; + double acc_sat_gnb = 0; if (channelDesc->modelid == SAT_LEO_TRANS) { + const double acc_sat_x = 0; + const double acc_sat_y = -w_sat * w_sat * radius_sat * sin(w_sat * t); + const double acc_sat_z = -w_sat * w_sat * radius_sat * cos(w_sat * t); + const double pos_gnb_x = 0; const double pos_gnb_y = 0; const double pos_gnb_z = radius_earth; @@ -108,6 +113,7 @@ void rxAddInput(const c16_t *input_sig, dist_sat_gnb = sqrt(dir_sat_gnb_x * dir_sat_gnb_x + dir_sat_gnb_y * dir_sat_gnb_y + dir_sat_gnb_z * dir_sat_gnb_z); vel_sat_gnb = (vel_sat_x * dir_sat_gnb_x + vel_sat_y * dir_sat_gnb_y + vel_sat_z * dir_sat_gnb_z) / dist_sat_gnb; + acc_sat_gnb = (acc_sat_x * dir_sat_gnb_x + acc_sat_y * dir_sat_gnb_y + acc_sat_z * dir_sat_gnb_z) / dist_sat_gnb; } const double prop_delay = (dist_ue_sat + dist_sat_gnb) / c; @@ -122,6 +128,7 @@ void rxAddInput(const c16_t *input_sig, last_TS = TS; LOG_I(HW, "Satellite orbit: time %f s, Position = (%f, %f, %f), Velocity = (%f, %f, %f)\n", t, pos_sat_x, pos_sat_y, pos_sat_z, vel_sat_x, vel_sat_y, vel_sat_z); LOG_I(HW, "Uplink delay %f ms, Doppler shift UE->SAT %f kHz\n", prop_delay * 1000, f_Doppler_shift_ue_sat / 1000); + LOG_I(HW, "Satellite velocity towards gNB: %f m/s, acceleration towards gNB: %f m/s²\n", vel_sat_gnb, acc_sat_gnb); const int samples_per_subframe = channelDesc->sampling_rate / 1000; const int abs_subframe = TS / samples_per_subframe; @@ -130,6 +137,7 @@ void rxAddInput(const c16_t *input_sig, .subframe = abs_subframe % 10, .delay = 2 * dist_sat_gnb / (c * 4.072e-9), .drift = 2 * -vel_sat_gnb / (c * 0.2e-9), + .accel = 2 * acc_sat_gnb / (c * 0.2e-10), .position.X = pos_sat_x / 1.3, .position.Y = pos_sat_y / 1.3, .position.Z = pos_sat_z / 1.3,