define speed of light in utils to avoid multiple local definitions

This commit is contained in:
francescomani
2026-01-09 02:16:49 +01:00
parent 699a5453a0
commit d4e3c5d384
6 changed files with 6 additions and 9 deletions
-2
View File
@@ -48,8 +48,6 @@ void fix_ntn_epoch_hfn(PHY_VARS_NR_UE *UE, int hfn, int frame)
LOG_I(PHY, "setting epoch_hfn = %d\n", *epoch_hfn);
}
#define SPEED_OF_LIGHT 299792458
// calculate TA and Doppler based on the NTN-Config, if abs_subframe_tx < 0 then apply only Doppler
void apply_ntn_timing_advance_and_doppler(PHY_VARS_NR_UE *UE, const NR_DL_FRAME_PARMS *fp, int abs_subframe_tx)
{
+1 -2
View File
@@ -462,8 +462,7 @@ 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);
double v = chan_desc->max_Doppler * ((double) SPEED_OF_LIGHT / (double)chan_desc->center_freq);
#ifdef DOPPLER_DEBUG
printf("v = %f\n", v);