Commit b1557be0 authored by lfarizav's avatar lfarizav

Fixing channel problems

parent 866e1962
......@@ -21,7 +21,6 @@
#include "defs.h"
#include "PHY/sse_intrin.h"
// Compute Energy of a complex signal vector, removing the DC component!
// input : points to vector
......@@ -293,6 +292,31 @@ int32_t signal_energy_nodc(int32_t *input,uint32_t length)
}
#endif
#define signal_energy_SSE
#ifdef signal_energy_SSE
double signal_energy_fp(double *s_re[2],double *s_im[2],uint32_t nb_antennas,uint32_t length,uint32_t offset)
{
int32_t aa,i;
double V=0.0,lower_d,upper_d;
__m128d V128, s_re128,s_im128;
V128=_mm_setzero_pd();
for (i=0; i<(length>>1); i++) {
for (aa=0; aa<nb_antennas; aa++) {
//V= V + (s_re[aa][i+offset]*s_re[aa][i+offset]) + (s_im[aa][i+offset]*s_im[aa][i+offset]);
s_re128=_mm_loadu_pd(&s_re[aa][2*i+offset]);
s_im128=_mm_loadu_pd(&s_im[aa][2*i+offset]);
s_re128=_mm_mul_pd(s_re128,s_re128);
s_im128=_mm_mul_pd(s_im128,s_im128);
V128=_mm_add_pd(V128,_mm_add_pd(s_re128,s_im128));
}
}
_mm_storel_pd(&lower_d,V128);
_mm_storeh_pd(&upper_d,V128);
return((lower_d+upper_d)/length/nb_antennas);
}
#else
double signal_energy_fp(double *s_re[2],double *s_im[2],uint32_t nb_antennas,uint32_t length,uint32_t offset)
{
......@@ -304,9 +328,9 @@ double signal_energy_fp(double *s_re[2],double *s_im[2],uint32_t nb_antennas,uin
V= V + (s_re[aa][i+offset]*s_re[aa][i+offset]) + (s_im[aa][i+offset]*s_im[aa][i+offset]);
}
}
return(V/length/nb_antennas);
}
#endif
double signal_energy_fp2(struct complex *s,uint32_t length)
{
......
......@@ -73,7 +73,57 @@ void dac(double *s_re[2],
}
}
}
#define dac_SSE
#ifdef dac_SSE
//This implementation of dac_fixed_gain using SSE does not work
double dac_fixed_gain(double *s_re[2],
double *s_im[2],
uint32_t **input,
uint32_t input_offset,
uint32_t nb_tx_antennas,
uint32_t length,
uint32_t input_offset_meas,
uint32_t length_meas,
uint8_t B,
double txpwr_dBm,
int NB_RE)
{
int i;
int aa;
double amp,amp1,div;
__m128d s_re128,s_im128,input_re128, input_im128;
amp = //sqrt(NB_RE)*pow(10.0,.05*txpwr_dBm)/sqrt(nb_tx_antennas); //this is amp per tx antenna
pow(10.0,.05*txpwr_dBm)/sqrt(nb_tx_antennas); //this is amp per tx antenna
amp1 = 0;
for (aa=0; aa<nb_tx_antennas; aa++) {
amp1 += sqrt((double)signal_energy((int32_t*)&input[aa][input_offset_meas],length_meas)/NB_RE);
}
amp1/=nb_tx_antennas;
div=amp/amp1;
for (i=0; i<(length>>1); i++) {
for (aa=0; aa<nb_tx_antennas; aa++) {
input_re128=_mm_set1_pd(((double)(((short *)input[aa]))[((2*i+input_offset)<<1)]));
input_im128=_mm_set1_pd(((double)(((short *)input[aa]))[((2*i+input_offset)<<1)+1]));
input_re128=_mm_mul_pd(input_re128,_mm_set1_pd(div));
input_im128=_mm_mul_pd(input_im128,_mm_set1_pd(div));
_mm_storeu_pd(&s_re[aa][2*i],input_re128);
_mm_storeu_pd(&s_im[aa][2*i],input_im128);
//s_re[aa][i] = amp*((double)(((short *)input[aa]))[((i+input_offset)<<1)])/amp1; ///(1<<(B-1));
//s_im[aa][i] = amp*((double)(((short *)input[aa]))[((i+input_offset)<<1)+1])/amp1; ///(1<<(B-1));
}
}
for (i=0;i<1048;i++)
printf(" s_re_out[%d] %e\n",i,s_re[0][i]);
// printf("ener %e\n",signal_energy_fp(s_re,s_im,nb_tx_antennas,length,0));
return(signal_energy_fp(s_re,s_im,nb_tx_antennas,length_meas,0)/NB_RE);
}
#else
double dac_fixed_gain(double *s_re[2],
double *s_im[2],
uint32_t **input,
......@@ -119,13 +169,15 @@ double dac_fixed_gain(double *s_re[2],
for (aa=0; aa<nb_tx_antennas; aa++) {
s_re[aa][i] = amp*((double)(((short *)input[aa]))[((i+input_offset)<<1)])/amp1; ///(1<<(B-1));
s_im[aa][i] = amp*((double)(((short *)input[aa]))[((i+input_offset)<<1)+1])/amp1; ///(1<<(B-1));
//if (i<1024)
//printf("s_re [%d]%e\n",i,s_re[aa][i]);
}
}
}
// printf("ener %e\n",signal_energy_fp(s_re,s_im,nb_tx_antennas,length,0));
return(signal_energy_fp(s_re,s_im,nb_tx_antennas,length_meas,0)/NB_RE);
}
#endif
double dac_fixed_gain_prach(double *s_re[2],
double *s_im[2],
uint32_t *input,
......
......@@ -155,8 +155,8 @@ void rf_rx(double **r_re,
}
// Amplify by receiver gain and apply 3rd order non-linearity
r_re[a][i] = rx_gain_lin*(r_re[a][i] + IP3_lin*(pow(r_re[a][i],3.0) + 3.0*r_re[a][i]*r_im[a][i]*r_im[a][i])) + rx_gain_lin*(sqrt(.5*N0W)*gaussdouble(0.0,1.0));
r_im[a][i] = rx_gain_lin*(r_im[a][i] + IP3_lin*(pow(r_im[a][i],3.0) + 3.0*r_im[a][i]*r_re[a][i]*r_re[a][i])) + rx_gain_lin*(sqrt(.5*N0W)*gaussdouble(0.0,1.0));
r_re[a][i] = rx_gain_lin*(r_re[a][i] + IP3_lin*(pow(r_re[a][i],3.0) + 3.0*r_re[a][i]*r_im[a][i]*r_im[a][i])) + rx_gain_lin*(sqrt(.5*N0W)*ziggurat(0.0,1.0));
r_im[a][i] = rx_gain_lin*(r_im[a][i] + IP3_lin*(pow(r_im[a][i],3.0) + 3.0*r_im[a][i]*r_re[a][i]*r_re[a][i])) + rx_gain_lin*(sqrt(.5*N0W)*ziggurat(0.0,1.0));
......@@ -191,7 +191,7 @@ void rf_rx(double **r_re,
//compute next realization of phase-noise process
x_n2 = x_n1;
x_n1 = x_n;
x_n = gaussdouble(0.0,1.0);
x_n = ziggurat(0.0,1.0);
y_n1 = p_noise;
y_n2 = y_n1;
p_noise = pn_a0*x_n + 2*pn_a0*x_n1 + pn_a0*x_n2 - pn_b1*y_n1 - pn_b2*y_n2;
......@@ -199,75 +199,6 @@ void rf_rx(double **r_re,
// pn[i] = p_noise;
}
}
#define RF_RX_SSE
//#define __AVX2__
#ifdef RF_RX_SSE
void rf_rx_simple(double *r_re[2],
double *r_im[2],
unsigned int nb_rx_antennas,
unsigned int length,
double s_time,
double rx_gain_dB)
{
/* static int first_run=0;
static double sum;
static int count;
if (!first_run)
{
first_run=1;
sum=0;
count=0;
}
count++;*/
__m128d rx128_re,rx128_im,rx128_gain_lin,gauss_0_128_sqrt_NOW,gauss_1_128_sqrt_NOW;//double
int i,a;
double rx_gain_lin = pow(10.0,.05*rx_gain_dB);
//double rx_gain_lin = 1.0;
double N0W = pow(10.0,.1*(-174.0 - 10*log10(s_time*1e-9)));
double sqrt_NOW = sqrt(.5*N0W);
double gauss0_sqrt_NOW,gauss1_sqrt_NOW;
//double N0W = 0.0;
// printf("s_time=%f, N0W=%g\n",s_time,10*log10(N0W));
//Loop over input
#ifdef DEBUG_RF
printf("N0W = %f dBm\n",10*log10(N0W));
printf("rx_gain = %f dB(%f)\n",rx_gain_dB,rx_gain_lin);
#endif
//rx128_gain_lin=mm_loadu_pd(rx_gain_lin);
/*count++;
clock_t start=clock();*/
for (i=0; i<(length>>1); i++) {
for (a=0; a<nb_rx_antennas; a++) {
//rx128_gain_lin=mm_mul_set1_ps(rx_gain_lin);
gauss0_sqrt_NOW=sqrt_NOW*gaussdouble(0.0,1.0);
gauss1_sqrt_NOW=sqrt_NOW*gaussdouble(0.0,1.0);
rx128_re = _mm_loadu_pd(&r_re[a][2*i]);//r_re[a][i],r_re[a][i+1]
rx128_im = _mm_loadu_pd(&r_im[a][2*i]);//r_im[a][i],r_im[a][i+1]
rx128_gain_lin = _mm_set1_pd(rx_gain_lin);
gauss_0_128_sqrt_NOW = _mm_set1_pd(gauss0_sqrt_NOW);
gauss_1_128_sqrt_NOW = _mm_set1_pd(gauss1_sqrt_NOW);
// Amplify by receiver gain and apply 3rd order non-linearity
//r_re[a][i] = rx_gain_lin*(r_re[a][i] + sqrt(.5*N0W)*gaussdouble(0.0,1.0));
//r_im[a][i] = rx_gain_lin*(r_im[a][i] + sqrt(.5*N0W)*gaussdouble(0.0,1.0));
rx128_re = _mm_add_pd(rx128_re,gauss_0_128_sqrt_NOW);
rx128_im = _mm_add_pd(rx128_im,gauss_1_128_sqrt_NOW);
rx128_re = _mm_mul_pd(rx128_re,rx128_gain_lin);
rx128_im = _mm_mul_pd(rx128_im,rx128_gain_lin);
_mm_storeu_pd(&r_re[a][2*i],rx128_re);
_mm_storeu_pd(&r_im[a][2*i],rx128_im);
//printf("gaussdouble %e, rx_gain_lin %e\n",gaussdouble(0.0,1.0), rx_gain_lin);
}
}
/*clock_t stop=clock();
printf("do_DL_sig time is %f s, AVERAGE time is %f s, count %d, sum %e\n",(float) (stop-start)/CLOCKS_PER_SEC,(float) (sum+stop-start)/(count*CLOCKS_PER_SEC),count,sum+stop-start);
sum=(sum+stop-start);*/
}
#else
void rf_rx_simple(double *r_re[2],
double *r_im[2],
unsigned int nb_rx_antennas,
......@@ -303,8 +234,8 @@ void rf_rx_simple(double *r_re[2],
// Amplify by receiver gain and apply 3rd order non-linearity
/*count++;
clock_t start=clock();*/
r_re[a][i] = rx_gain_lin*(r_re[a][i] + sqrt(.5*N0W)*gaussdouble(0.0,1.0));
r_im[a][i] = rx_gain_lin*(r_im[a][i] + sqrt(.5*N0W)*gaussdouble(0.0,1.0));
r_re[a][i] = rx_gain_lin*(r_re[a][i] + sqrt(.5*N0W)*ziggurat(0.0,1.0));
r_im[a][i] = rx_gain_lin*(r_im[a][i] + sqrt(.5*N0W)*ziggurat(0.0,1.0));
/*clock_t stop=clock();
printf("do_DL_sig time is %f s, AVERAGE time is %f s, count %d, sum %e\n",(float) (stop-start)/CLOCKS_PER_SEC,(float) (sum+stop-start)/(count*CLOCKS_PER_SEC),count,sum+stop-start);
sum=(sum+stop-start);*/
......@@ -312,84 +243,7 @@ sum=(sum+stop-start);*/
}
}
#endif
#ifdef __AVX2__
void rf_rx_simple_freq(double *r_re[2],
double *r_im[2],
unsigned int nb_rx_antennas,
unsigned int length,
double s_time,
double rx_gain_dB,
unsigned int symbols_per_tti,
unsigned int ofdm_symbol_size,
unsigned int n_samples)
{
/* static int first_run=0;
static double sum;
static int count;
if (!first_run)
{
first_run=1;
sum=0;
count=0;
}
count++;*/
__m256d rx256_re,rx256_im,rx256_gain_lin,gauss_0_256_sqrt_NOW,gauss_1_256_sqrt_NOW;//4 doubles
int i,j,a;
double rx_gain_lin = pow(10.0,.05*rx_gain_dB);
//double rx_gain_lin = 1.0;
double N0W = pow(10.0,.1*(-174.0 - 10*log10(s_time*1e-9)));
double sqrt_NOW = sqrt(.5*N0W);
double gauss0_sqrt_NOW,gauss1_sqrt_NOW;
//double N0W = 0.0;
// printf("s_time=%f, N0W=%g\n",s_time,10*log10(N0W));
//Loop over input
#ifdef DEBUG_RF
printf("N0W = %f dBm\n",10*log10(N0W));
printf("rx_gain = %f dB(%f)\n",rx_gain_dB,rx_gain_lin);
#endif
//rx128_gain_lin=mm_loadu_pd(rx_gain_lin);
/*count++;
clock_t start=clock();*/
for (i=0; i<(length>>2); i++) {
for (a=0; a<nb_rx_antennas; a++) {
if (i%(ofdm_symbol_size>>2)>(n_samples>>2) && i%(ofdm_symbol_size>>2)<(ofdm_symbol_size>>2)-(n_samples>>2))
{
//printf("i = %d\n",i);
//_mm_storeu_pd(&r_re[a][2*i],_mm_setzero_pd());
//_mm_storeu_pd(&r_im[a][2*i],_mm_setzero_pd());
break;
}
else
{
//rx256_gain_lin=mm_mul_set1_ps(rx_gain_lin);
gauss0_sqrt_NOW=sqrt_NOW*gaussdouble(0.0,1.0);
gauss1_sqrt_NOW=sqrt_NOW*gaussdouble(0.0,1.0);
rx256_re = _mm256_load_pd(&r_re[a][2*i]);//r_re[a][i],r_re[a][i+1]
rx256_im = _mm256_load_pd(&r_im[a][2*i]);//r_im[a][i],r_im[a][i+1]
rx256_gain_lin = _mm_set1_pd(rx_gain_lin);
gauss_0_256_sqrt_NOW = _mm_set1_pd(gauss0_sqrt_NOW);
gauss_1_256_sqrt_NOW = _mm_set1_pd(gauss1_sqrt_NOW);
// Amplify by receiver gain and apply 3rd order non-linearity
//r_re[a][i] = rx_gain_lin*(r_re[a][i] + sqrt(.5*N0W)*gaussdouble(0.0,1.0));
//r_im[a][i] = rx_gain_lin*(r_im[a][i] + sqrt(.5*N0W)*gaussdouble(0.0,1.0));
rx256_re = _mm256_add_pd(rx256_re,gauss_0_256_sqrt_NOW);
rx256_im = _mm256_add_pd(rx256_im,gauss_1_256_sqrt_NOW);
rx256_re = _mm256_mul_pd(rx256_re,rx256_gain_lin);
rx256_im = _mm256_mul_pd(rx256_im,rx256_gain_lin);
_mm_storeu_pd(&r_re[a][2*i],rx256_re);
_mm_storeu_pd(&r_im[a][2*i],rx256_im);
}
//printf("gaussdouble %e, rx_gain_lin %e\n",gaussdouble(0.0,1.0), rx_gain_lin);
}
}
/*clock_t stop=clock();
printf("do_DL_sig time is %f s, AVERAGE time is %f s, count %d, sum %e\n",(float) (stop-start)/CLOCKS_PER_SEC,(float) (sum+stop-start)/(count*CLOCKS_PER_SEC),count,sum+stop-start);
sum=(sum+stop-start);*/
}
#endif
#define RF_RX_SSE
#ifdef RF_RX_SSE
void rf_rx_simple_freq(double *r_re[2],
double *r_im[2],
......@@ -417,7 +271,6 @@ void rf_rx_simple_freq(double *r_re[2],
//double rx_gain_lin = 1.0;
double N0W = pow(10.0,.1*(-174.0 - 10*log10(s_time*1e-9)));
double sqrt_NOW = sqrt(.5*N0W);
double gauss0_sqrt_NOW,gauss1_sqrt_NOW;
//double N0W = 0.0;
// printf("s_time=%f, N0W=%g\n",s_time,10*log10(N0W));
......@@ -442,13 +295,11 @@ clock_t start=clock();*/
else
{
//rx128_gain_lin=mm_mul_set1_ps(rx_gain_lin);
gauss0_sqrt_NOW=sqrt_NOW*ziggurat(0.0,1.0);
gauss1_sqrt_NOW=sqrt_NOW*ziggurat(0.0,1.0);
rx128_re = _mm_loadu_pd(&r_re[a][2*i]);//r_re[a][i],r_re[a][i+1]
rx128_im = _mm_loadu_pd(&r_im[a][2*i]);//r_im[a][i],r_im[a][i+1]
rx128_gain_lin = _mm_set1_pd(rx_gain_lin);
gauss_0_128_sqrt_NOW = _mm_set1_pd(gauss0_sqrt_NOW);
gauss_1_128_sqrt_NOW = _mm_set1_pd(gauss1_sqrt_NOW);
gauss_0_128_sqrt_NOW = _mm_set1_pd(sqrt_NOW*ziggurat(0.0,1.0));
gauss_1_128_sqrt_NOW = _mm_set1_pd(sqrt_NOW*ziggurat(0.0,1.0));
// Amplify by receiver gain and apply 3rd order non-linearity
//r_re[a][i] = rx_gain_lin*(r_re[a][i] + sqrt(.5*N0W)*gaussdouble(0.0,1.0));
//r_im[a][i] = rx_gain_lin*(r_im[a][i] + sqrt(.5*N0W)*gaussdouble(0.0,1.0));
......@@ -503,8 +354,8 @@ void rf_rx_simple_freq(double *r_re[2],
// Amplify by receiver gain and apply 3rd order non-linearity
/*count++;
clock_t start=clock();*/
r_re[a][i] = rx_gain_lin*(r_re[a][i] + sqrt(.5*N0W)*gaussdouble(0.0,1.0));
r_im[a][i] = rx_gain_lin*(r_im[a][i] + sqrt(.5*N0W)*gaussdouble(0.0,1.0));
r_re[a][i] = rx_gain_lin*(r_re[a][i] + sqrt(.5*N0W)*ziggurat(0.0,1.0));
r_im[a][i] = rx_gain_lin*(r_im[a][i] + sqrt(.5*N0W)*ziggurat(0.0,1.0));
/*clock_t stop=clock();
printf("do_DL_sig time is %f s, AVERAGE time is %f s, count %d, sum %e\n",(float) (stop-start)/CLOCKS_PER_SEC,(float) (sum+stop-start)/(count*CLOCKS_PER_SEC),count,sum+stop-start);
sum=(sum+stop-start);*/
......
......@@ -36,7 +36,7 @@ double **cos_lut=NULL,**sin_lut=NULL;
//#if 1
#define abstraction_SSE
//#define abstraction_SSE
#ifdef abstraction_SSE
int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
{
......@@ -309,11 +309,6 @@ int freq_channel_prach(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples,int
prach_samples = (prach_fmt<4)?13+839+12:3+139+2;
// do some error checking
// n_samples has to be a odd number because we assume the spectrum is symmetric around the DC and includes the DC
if ((n_samples&1)==0) {
fprintf(stderr, "freq_channel: n_samples has to be odd\n");
return(-1);
}
if (nb_rb-n_ra_prb<6) {
fprintf(stderr, "freq_channel_init: Impossible to allocate PRACH, check r_ra_prb value (r_ra_prb=%d)\n",n_ra_prb);
return(-1);
......
......@@ -465,6 +465,7 @@ void multipath_channel_freq(channel_desc_t *desc,
}
else
{
//printf("else 0: f %d, data in %e, data out %e\n",k*1024+f,tx_sig_re[ii][f+k*ofdm_symbol_size],rx_sig_re[ii][f+k*ofdm_symbol_size]);
rx_sig_re[ii][f+k*ofdm_symbol_size] = 0;
rx_sig_im[ii][f+k*ofdm_symbol_size] = 0;
}
......@@ -496,7 +497,6 @@ void multipath_channel_prach(channel_desc_t *desc,
int ii,j,f;
__m128d rx_tmp128_re_f,rx_tmp128_im_f,rx_tmp128_re,rx_tmp128_im, rx_tmp128_1,rx_tmp128_2,rx_tmp128_3,rx_tmp128_4,tx128_re,tx128_im,chF128_x,chF128_y,pathloss128;
struct complex rx_tmp;
int prach_samples = (prach_fmt<4)?13+839+12:3+139+2;
double path_loss = pow(10,desc->path_loss_dB/20);
pathloss128 = _mm_set1_pd(path_loss);
int nb_rb, n_samples;
......@@ -512,7 +512,7 @@ void multipath_channel_prach(channel_desc_t *desc,
} else {
freq_channel_prach(desc,nb_rb,n_samples,prach_fmt,n_ra_prb);//Find desc->chF_prach
}
for (f=0;f<(prach_samples>>1); f++) {
for (f=0;f<(length>>1); f++) {
//rx_tmp.x = 0;
//rx_tmp.y = 0;
rx_tmp128_re_f = _mm_setzero_pd();
......@@ -561,20 +561,15 @@ void multipath_channel_prach(channel_desc_t *desc,
uint8_t n_ra_prb)
{
int prach_samples;
int ii,j,f;
struct complex rx_tmp;
//double delta_f;
prach_samples = (prach_fmt<4)?13+839+12:3+139+2;
double path_loss = pow(10,desc->path_loss_dB/20);
int nb_rb, n_samples;
nb_rb=fp->N_RB_DL;
n_samples=fp->N_RB_DL*12+1;
//delta_f = (prach_fmt<4)?nb_rb*180000/((n_samples-1)*12):nb_rb*180000/((n_samples-1)*2);
//printf("prach_samples %d, n_ra_prb %d, delta_f %e, prach_fmt %d\n",prach_samples,get_prach_prb_offset(fp, PHY_vars_UE_g[UE_id][CC_id]->prach_resources[0]->ra_TDD_map_index, PHY_vars_eNB_g[0][0]->proc.frame_prach), delta_f,prach_fmt);
#ifdef DEBUG_CH
printf("[CHANNEL_PRACH] keep = %d : path_loss = %g (%f), nb_rx %d, nb_tx %d, len %d \n",keep_channel,path_loss,desc->path_loss_dB,desc->nb_rx,desc->nb_tx,desc->channel_length);
#endif
......@@ -585,7 +580,7 @@ void multipath_channel_prach(channel_desc_t *desc,
//random_channel(desc,0);//Find a(l)
freq_channel_prach(desc,nb_rb,n_samples,prach_fmt,n_ra_prb);//Find desc->chF_prach
}
for (f=0;f<prach_samples; f++) {
for (f=0;f<lenght; f++) {
rx_tmp.x = 0;
rx_tmp.y = 0;
for (ii=0; ii<desc->nb_rx; ii++) {
......
......@@ -219,9 +219,9 @@ void table_nor(unsigned long seed)
fn[i] = (exp (-0.5*dn*dn));
wn[i] = (dn / m1);
}
for ( i = 0; i <= 127; i++ ){
/*for ( i = 0; i <= 127; i++ ){
printf("i %d: kn %d, fn %e, wn %e\n",i,kn[i],fn[i],wn[i]);
}
}*/
return;
}
......
......@@ -1238,7 +1238,7 @@ void do_UL_sig_freq_prach(channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB
// write_output("s_re_f_prach.m","s_re_f_prach_txF", s_re_f_prach,frame_parms->ofdm_symbol_size*12,1,1);
start_meas(&UE2eNB[UE_id][eNB_id][CC_id]->multipath_channel_freq_PRACH);
multipath_channel_prach(UE2eNB[UE_id][eNB_id][CC_id],s_re_f_prach,s_im_f_prach,r_re0_f_prach,r_im0_f_prach,&PHY_vars_UE_g[UE_id][CC_id]->frame_parms,
frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti*12,hold_channel,eNB_id,prach_fmt,n_ra_prb);
(prach_fmt<4)?13+839+12:3+139+2,hold_channel,eNB_id,prach_fmt,n_ra_prb);
stop_meas(&UE2eNB[UE_id][eNB_id][CC_id]->multipath_channel_freq_PRACH);
//for (int idx=0;idx<10;idx++) printf("dumping raw PRACH UL tx subframe (output) %d: r_f[%d] = (%f,%f)\n", subframe, idx, r_re0_f_prach[0][idx],r_im0_f_prach[0][idx]);
......
......@@ -1167,6 +1167,16 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void *
int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc)
{
static int first_run=0;
static double sum;
static int count;
if (!first_run)
{
first_run=1;
sum=0;
count=0;
}
count++;
int ret = nsamps;
int UE_id = device->Mod_id;
......@@ -1243,7 +1253,7 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
&PHY_vars_UE_g[UE_id][CC_id]->frame_parms,
UE_id,
CC_id);
/*clock_t stop=clock();
/*lock_t stop=clock();
printf("do_DL_sig time is %f s, AVERAGE time is %f s, count %d, sum %e\n",(float) (stop-start)/CLOCKS_PER_SEC,(float) (sum+stop-start)/(count*CLOCKS_PER_SEC),count,sum+stop-start);
sum=(sum+stop-start);*/
//stop_meas(&dl_chan_stats_f);
......
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