From 7ea608720f31df1c86231dba9ce57efe4c3fcfaa Mon Sep 17 00:00:00 2001
From: Bo Zhao <bo.zhao@iis.fraunhofer.de>
Date: Wed, 28 Aug 2019 15:58:38 +0200
Subject: [PATCH] Extend the length of the channel processing to 32 bits

---
 .../SIMULATION/TOOLS/multipath_tv_channel.c    | 18 +++++++++++-------
 openair1/SIMULATION/TOOLS/sim.h                |  2 +-
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/openair1/SIMULATION/TOOLS/multipath_tv_channel.c b/openair1/SIMULATION/TOOLS/multipath_tv_channel.c
index f4835570bf3..d344992586f 100644
--- a/openair1/SIMULATION/TOOLS/multipath_tv_channel.c
+++ b/openair1/SIMULATION/TOOLS/multipath_tv_channel.c
@@ -27,18 +27,20 @@
 #include "SIMULATION/RF/rf.h"
 #include <complex.h>
 
-void tv_channel(channel_desc_t *desc,double complex ***H,uint16_t length);
+void tv_channel(channel_desc_t *desc,double complex ***H,uint32_t length);
 double frand_a_b(double a, double b);
-void tv_conv(double complex **h, double complex *x, double complex *y, uint16_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, int delay);
 
 void multipath_tv_channel(channel_desc_t *desc,
                           double **tx_sig_re,
                           double **tx_sig_im,
                           double **rx_sig_re,
                           double **rx_sig_im,
-                          uint16_t length,
-                          uint8_t keep_channel) {
-  double complex **tx,**rx,* **H_t,*rx_temp; //, *tv_H_t;
+                          uint32_t length,
+                          uint8_t keep_channel)
+{
+
+  double complex **tx,**rx,***H_t,*rx_temp;//, *tv_H_t;
   double path_loss = pow(10,desc->path_loss_dB/20);
   int i,j,k,dd;
   dd = abs(desc->channel_offset);
@@ -126,7 +128,8 @@ void multipath_tv_channel(channel_desc_t *desc,
 }
 
 //TODO: make phi_rad a parameter of this function
-void tv_channel(channel_desc_t *desc,double complex ***H,uint16_t length) {
+void tv_channel(channel_desc_t *desc,double complex ***H,uint32_t length){
+
   int i,j,p,l,k;
   double *alpha,*phi_rad,pi=acos(-1),*w_Hz;
   alpha = (double *)calloc(desc->nb_paths,sizeof(double));
@@ -193,7 +196,8 @@ void tv_channel(channel_desc_t *desc,double complex ***H,uint16_t length) {
 }
 
 // time varying convolution
-void tv_conv(double complex **h, double complex *x, double complex *y, uint16_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, int dd){
+
   int i,j;
 
   for(i=0; i<((int)nb_samples-dd); i++) {
diff --git a/openair1/SIMULATION/TOOLS/sim.h b/openair1/SIMULATION/TOOLS/sim.h
index 0bc5975d99b..4b1b7edcdd3 100644
--- a/openair1/SIMULATION/TOOLS/sim.h
+++ b/openair1/SIMULATION/TOOLS/sim.h
@@ -426,7 +426,7 @@ void multipath_tv_channel(channel_desc_t *desc,
                           double **tx_sig_im,
                           double **rx_sig_re,
                           double **rx_sig_im,
-                          uint16_t length,
+                          uint32_t length,
                           uint8_t keep_channel);
 
 /**@} */
-- 
GitLab