Commit d5a04555 authored by Thomas Schlichter's avatar Thomas Schlichter

fix error of taking the absolute value of 'uint64_t'

parent 5ac881b7
...@@ -55,12 +55,12 @@ void __attribute__ ((no_sanitize_address)) multipath_channel(channel_desc_t *des ...@@ -55,12 +55,12 @@ void __attribute__ ((no_sanitize_address)) multipath_channel(channel_desc_t *des
tx128_re, tx128_im, ch128_x, ch128_y, pathloss128; tx128_re, tx128_im, ch128_x, ch128_y, pathloss128;
double path_loss = pow(10,desc->path_loss_dB/20); double path_loss = pow(10,desc->path_loss_dB/20);
int dd = abs(desc->channel_offset); uint64_t dd = desc->channel_offset;
pathloss128 = simde_mm_set1_pd(path_loss); pathloss128 = simde_mm_set1_pd(path_loss);
#ifdef DEBUG_CH #ifdef DEBUG_CH
printf("[CHANNEL] keep = %d : path_loss = %g (%f), nb_rx %d, nb_tx %d, dd %d, len %d \n",keep_channel,path_loss,desc->path_loss_dB,desc->nb_rx,desc->nb_tx,dd,desc->channel_length); printf("[CHANNEL] keep = %d : path_loss = %g (%f), nb_rx %d, nb_tx %d, dd %lu, len %d \n",keep_channel,path_loss,desc->path_loss_dB,desc->nb_rx,desc->nb_tx,dd,desc->channel_length);
#endif #endif
if (keep_channel) { if (keep_channel) {
...@@ -184,11 +184,10 @@ void __attribute__ ((no_sanitize_address)) multipath_channel(channel_desc_t *des ...@@ -184,11 +184,10 @@ void __attribute__ ((no_sanitize_address)) multipath_channel(channel_desc_t *des
{ {
double path_loss = pow(10,desc->path_loss_dB/20); double path_loss = pow(10,desc->path_loss_dB/20);
int dd; uint64_t dd = desc->channel_offset;
dd = abs(desc->channel_offset);
#ifdef DEBUG_CH #ifdef DEBUG_CH
printf("[CHANNEL] keep = %d : path_loss = %g (%f), nb_rx %d, nb_tx %d, dd %d, len %d \n", printf("[CHANNEL] keep = %d : path_loss = %g (%f), nb_rx %d, nb_tx %d, dd %lu, len %d \n",
keep_channel, path_loss, desc->path_loss_dB, desc->nb_rx, desc->nb_tx, dd, desc->channel_length); keep_channel, path_loss, desc->path_loss_dB, desc->nb_rx, desc->nb_tx, dd, desc->channel_length);
#endif #endif
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
void tv_channel(channel_desc_t *desc,double complex ***H,uint32_t length); void tv_channel(channel_desc_t *desc,double complex ***H,uint32_t length);
double frand_a_b(double a, double b); double frand_a_b(double a, double b);
void tv_conv(double complex **h, double complex *x, double complex *y, uint32_t nb_samples, uint8_t nb_taps, int delay); void tv_conv(double complex **h, double complex *x, double complex *y, uint32_t nb_samples, uint8_t nb_taps, uint64_t delay);
void multipath_tv_channel(channel_desc_t *desc, void multipath_tv_channel(channel_desc_t *desc,
double **tx_sig_re, double **tx_sig_re,
...@@ -42,10 +42,10 @@ void multipath_tv_channel(channel_desc_t *desc, ...@@ -42,10 +42,10 @@ void multipath_tv_channel(channel_desc_t *desc,
double complex **tx,**rx,***H_t; double complex **tx,**rx,***H_t;
double path_loss = pow(10,desc->path_loss_dB/20); double path_loss = pow(10,desc->path_loss_dB/20);
int i,j,dd; int i,j;
dd = abs(desc->channel_offset); uint64_t dd = desc->channel_offset;
#ifdef DEBUG_CH #ifdef DEBUG_CH
printf("[TV CHANNEL] keep = %d : path_loss = %g (%f), nb_rx %d, nb_tx %d, dd %d, len %d max_doppler %g\n",keep_channel,path_loss,desc->path_loss_dB,desc->nb_rx,desc->nb_tx,dd,desc->channel_length, printf("[TV CHANNEL] keep = %d : path_loss = %g (%f), nb_rx %d, nb_tx %d, dd %lu, len %d max_doppler %g\n",keep_channel,path_loss,desc->path_loss_dB,desc->nb_rx,desc->nb_tx,dd,desc->channel_length,
desc->max_Doppler); desc->max_Doppler);
#endif #endif
tx = (double complex **)malloc(desc->nb_tx*sizeof(double complex *)); tx = (double complex **)malloc(desc->nb_tx*sizeof(double complex *));
...@@ -190,7 +190,7 @@ void tv_channel(channel_desc_t *desc,double complex ***H,uint32_t length){ ...@@ -190,7 +190,7 @@ void tv_channel(channel_desc_t *desc,double complex ***H,uint32_t length){
} }
// time varying convolution // time varying convolution
void tv_conv(double complex **h, double complex *x, double complex *y, uint32_t nb_samples, uint8_t nb_taps, int dd) void tv_conv(double complex **h, double complex *x, double complex *y, uint32_t nb_samples, uint8_t nb_taps, uint64_t dd)
{ {
for(int i = 0; i < ((int)nb_samples-dd); i++) { for(int i = 0; i < ((int)nb_samples-dd); i++) {
for(int j = 0; j < nb_taps; j++) { for(int j = 0; j < nb_taps; j++) {
......
...@@ -68,7 +68,7 @@ void rxAddInput( const c16_t *input_sig, ...@@ -68,7 +68,7 @@ void rxAddInput( const c16_t *input_sig,
// Energy in one sample to calibrate input noise // Energy in one sample to calibrate input noise
// the normalized OAI value seems to be 256 as average amplitude (numerical amplification = 1) // the normalized OAI value seems to be 256 as average amplitude (numerical amplification = 1)
const double noise_per_sample = pow(10,channelDesc->noise_power_dB/10.0) * 256; const double noise_per_sample = pow(10,channelDesc->noise_power_dB/10.0) * 256;
const int dd = abs(channelDesc->channel_offset); const uint64_t dd = channelDesc->channel_offset;
const int nbTx=channelDesc->nb_tx; const int nbTx=channelDesc->nb_tx;
for (int i=0; i<nbSamples; i++) { for (int i=0; i<nbSamples; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment