fix difficult to read code

This commit is contained in:
Laurent THOMAS
2022-03-24 14:38:17 +01:00
committed by Robert Schmidt
parent 42c1679545
commit a7e7d05da3
49 changed files with 258 additions and 431 deletions
+3 -3
View File
@@ -52,7 +52,7 @@
either we regenerate the channel (call again random_channel(desc,0)), or we keep it over subframes
legacy: we regenerate each sub frame in UL, and each frame only in DL
*/
void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_sig,
void rxAddInput( c16_t *input_sig, c16_t *after_channel_sig,
int rxAnt,
channel_desc_t *channelDesc,
int nbSamples,
@@ -73,7 +73,7 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si
const int nbTx=channelDesc->nb_tx;
for (int i=0; i<((int)nbSamples-dd); i++) {
struct complex16 *out_ptr=after_channel_sig+dd+i;
c16_t *out_ptr=after_channel_sig+dd+i;
struct complexd rx_tmp= {0};
for (int txAnt=0; txAnt < nbTx; txAnt++) {
@@ -87,7 +87,7 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si
// but it is not very usefull
// it would be better to split out each antenna in a separate flow
// that will allow to mix ru antennas freely
struct complex16 tx16=input_sig[((TS+i-l)*nbTx+txAnt)%CirSize];
c16_t tx16=input_sig[((TS+i-l)*nbTx+txAnt)%CirSize];
rx_tmp.r += tx16.r * channelModel[l].r - tx16.i * channelModel[l].i;
rx_tmp.i += tx16.i * channelModel[l].r + tx16.r * channelModel[l].i;
} //l
+2 -2
View File
@@ -25,8 +25,8 @@
#define __RFSIMULATOR_H
double gaussZiggurat(double mean, double variance);
void tableNor(unsigned long seed);
void rxAddInput( struct complex16 *input_sig,
struct complex16 *after_channel_sig,
void rxAddInput( c16_t *input_sig,
c16_t *after_channel_sig,
int rxAnt,
channel_desc_t *channelDesc,
int nbSamples,
+4 -4
View File
@@ -100,7 +100,7 @@ static telnetshell_vardef_t rfsimu_vardef[] = {
};
pthread_mutex_t Sockmutex;
typedef struct complex16 sample_t; // 2*16 bits complex number
typedef c16_t sample_t; // 2*16 bits complex number
typedef struct buffer_s {
int conn_sock;
@@ -495,7 +495,7 @@ static bool flushInput(rfsimulator_state_t *t, int timeout, int nsamps_for_initi
setblocking(conn_sock, notBlocking);
allocCirBuf(t, conn_sock);
LOG_I(HW,"A client connected, sending the current time\n");
struct complex16 v= {0};
c16_t v= {0};
void *samplesVoid[t->tx_num_channels];
for ( int i=0; i < t->tx_num_channels; i++)
@@ -665,7 +665,7 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest
// We send timestamp for nb samples required
// assuming this should have been done earlier if a Tx would exist
pthread_mutex_unlock(&Sockmutex);
struct complex16 v= {0};
c16_t v= {0};
void *dummyS[t->tx_num_channels];
for ( int i=0; i < t->tx_num_channels; i++)
@@ -728,7 +728,7 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest
for (int a=0; a<nbAnt; a++) {//loop over number of Rx antennas
if ( ptr->channel_model != NULL ) // apply a channel model
rxAddInput( ptr->circularBuf, (struct complex16 *) samplesVoid[a],
rxAddInput( ptr->circularBuf, (c16_t *) samplesVoid[a],
a,
ptr->channel_model,
nsamps,
+1 -1
View File
@@ -1941,7 +1941,7 @@ void write_dummy(PHY_VARS_UE *UE, openair0_timestamp timestamp) {
// we have to write to tell explicitly to the eNB, else it will wait for us forever
// we write the next subframe (always write in future of what we received)
//
struct complex16 v= {0};
c16_t v= {0};
void *samplesVoid[UE->frame_parms.nb_antennas_tx];
for ( int i=0; i < UE->frame_parms.nb_antennas_tx; i++)