Fix formatting for apply_channelmod.c

This commit is contained in:
Bartosz Podrygajlo
2025-12-23 10:04:39 +01:00
parent f0d4325cd7
commit 4ec69cad1f
2 changed files with 93 additions and 76 deletions
+25 -7
View File
@@ -21,7 +21,6 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#include <complex.h> #include <complex.h>
#include <common/utils/LOG/log.h> #include <common/utils/LOG/log.h>
#include <openair1/SIMULATION/TOOLS/sim.h> #include <openair1/SIMULATION/TOOLS/sim.h>
@@ -53,11 +52,14 @@ void rxAddInput(const c16_t *input_sig,
{ {
static uint64_t last_TS = 0; static uint64_t last_TS = 0;
if ((channelDesc->sat_height > 0) && (channelDesc->enable_dynamic_delay || channelDesc->enable_dynamic_Doppler)) { // model for transparent satellite on circular orbit if ((channelDesc->sat_height > 0)
&& (channelDesc->enable_dynamic_delay
|| channelDesc->enable_dynamic_Doppler)) { // model for transparent satellite on circular orbit
/* assumptions: /* assumptions:
- The Earth is spherical, the ground station is static, and that the Earth does not rotate. - The Earth is spherical, the ground station is static, and that the Earth does not rotate.
- An access or link is possible from the satellite to the ground station at all times. - An access or link is possible from the satellite to the ground station at all times.
- The ground station is located at the North Pole (positive Zaxis), and the satellite starts from the initial elevation angle 0° in the second quadrant of the YZplane. - The ground station is located at the North Pole (positive Zaxis), and the satellite starts from the initial elevation angle
0° in the second quadrant of the YZplane.
- Satellite moves in the clockwise direction in its circular orbit. - Satellite moves in the clockwise direction in its circular orbit.
*/ */
const double radius_earth = 6377900; // m const double radius_earth = 6377900; // m
@@ -159,7 +161,15 @@ void rxAddInput(const c16_t *input_sig,
if (TS - last_TS >= channelDesc->sampling_rate) { if (TS - last_TS >= channelDesc->sampling_rate) {
last_TS = TS; 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,
"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, "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); LOG_I(HW, "Satellite velocity towards gNB: %f m/s, acceleration towards gNB: %f m/s²\n", -vel_sat_gnb, acc_sat_gnb);
} }
@@ -218,7 +228,15 @@ void rxAddInput(const c16_t *input_sig,
if (TS - last_TS >= channelDesc->sampling_rate) { if (TS - last_TS >= channelDesc->sampling_rate) {
last_TS = TS; 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,
"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, "Downlink delay %f ms, Doppler shift SAT->UE %f kHz\n", prop_delay * 1000, f_Doppler_shift_sat_ue / 1000); LOG_I(HW, "Downlink delay %f ms, Doppler shift SAT->UE %f kHz\n", prop_delay * 1000, f_Doppler_shift_sat_ue / 1000);
} }
} }
@@ -281,10 +299,10 @@ void rxAddInput(const c16_t *input_sig,
if ((TS * nbTx) % CirSize + nbSamples <= CirSize) if ((TS * nbTx) % CirSize + nbSamples <= CirSize)
// Cast to a wrong type for compatibility ! // Cast to a wrong type for compatibility !
LOG_D(HW,"Input power %f, output power: %f, channel path loss %f, noise coeff: %f \n", LOG_D(HW,
"Input power %f, output power: %f, channel path loss %f, noise coeff: %f \n",
10 * log10((double)signal_energy((int32_t *)&input_sig[(TS * nbTx) % CirSize], nbSamples)), 10 * log10((double)signal_energy((int32_t *)&input_sig[(TS * nbTx) % CirSize], nbSamples)),
10 * log10((double)signal_energy((int32_t *)after_channel_sig, nbSamples)), 10 * log10((double)signal_energy((int32_t *)after_channel_sig, nbSamples)),
channelDesc->path_loss_dB, channelDesc->path_loss_dB,
10 * log10(noise_per_sample)); 10 * log10(noise_per_sample));
} }
+1 -2
View File
@@ -31,7 +31,6 @@ void rxAddInput( const c16_t *input_sig,
int nbSamples, int nbSamples,
uint64_t TS, uint64_t TS,
uint32_t CirSize, uint32_t CirSize,
bool apply_noise bool apply_noise);
);
#endif #endif