Commit f04846cf authored by Raymond Knopp's avatar Raymond Knopp

2 and 4 antenna testing with ulsim functional. >=3 dB gains from 2 to 4 antennas on SCM channels

parent bbe6db03
......@@ -852,7 +852,7 @@ endif (${RU} STREQUAL 0)
# Hardware dependant options
###################################
add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4")
add_list1_option(NB_ANTENNAS_RX "4" "Number of antennas in reception" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4")
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU")
......
......@@ -518,7 +518,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
AssertFatal (fp->symbols_per_tti > 11, "fp->symbols_per_tti %d < 12\n", fp->symbols_per_tti);
AssertFatal (fp->N_RB_UL > 5, "fp->N_RB_UL %d < 6\n", fp->N_RB_UL);
for (i = 0; i < 2; i++) {
for (i = 0; i < fp->nb_antennas_rx; i++) {
// FIXME We should get rid of this
pusch_vars[ULSCH_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
......@@ -591,7 +591,7 @@ void phy_free_lte_eNB(PHY_VARS_eNB *eNB) {
free_and_zero(prach_vars->rxsigF[0]);
for (int ULSCH_id=0; ULSCH_id<NUMBER_OF_ULSCH_MAX; ULSCH_id++) {
for (i = 0; i < 2; i++) {
for (i = 0; i < fp->nb_antennas_rx; i++) {
free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext[i]);
free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext2[i]);
free_and_zero(pusch_vars[ULSCH_id]->drs_ch_estimates[i]);
......
......@@ -121,8 +121,8 @@ int lte_est_timing_advance_pusch(LTE_DL_FRAME_PARMS *frame_parms,
int sync_pos = 0;//(frame_parms->ofdm_symbol_size-cyclic_shift*frame_parms->ofdm_symbol_size/12)%(frame_parms->ofdm_symbol_size);
AssertFatal(frame_parms->ofdm_symbol_size > 127,"frame_parms->ofdm_symbol_size %d<128\n",frame_parms->ofdm_symbol_size);
AssertFatal(frame_parms->nb_antennas_rx >0 && frame_parms->nb_antennas_rx<3,"frame_parms->nb_antennas_rx %d not in [0,1]\n",
frame_parms->nb_antennas_rx);
AssertFatal(frame_parms->nb_antennas_rx >0 && frame_parms->nb_antennas_rx<=NB_ANTENNAS_RX,"frame_parms->nb_antennas_rx %d not in [1...%d]\n",
frame_parms->nb_antennas_rx,NB_ANTENNAS_RX);
for (i = 0; i < frame_parms->ofdm_symbol_size; i++) {
temp = 0;
......
......@@ -630,11 +630,15 @@ void ulsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t symbol,
uint16_t nb_rb) {
#if defined(__x86_64__) || defined(__i386__)
__m128i *rxdataF_comp128_0,*ul_ch_mag128_0,*ul_ch_mag128_0b;
__m128i *rxdataF_comp128_1,*ul_ch_mag128_1,*ul_ch_mag128_1b;
__m128i *rxdataF_comp128_0=NULL,*ul_ch_mag128_0=NULL,*ul_ch_mag128_0b=NULL;
__m128i *rxdataF_comp128_1=NULL,*ul_ch_mag128_1=NULL,*ul_ch_mag128_1b=NULL;
__m128i *rxdataF_comp128_2=NULL,*ul_ch_mag128_2=NULL,*ul_ch_mag128_2b=NULL;
__m128i *rxdataF_comp128_3=NULL,*ul_ch_mag128_3=NULL,*ul_ch_mag128_3b=NULL;
#elif defined(__arm__)
int16x8_t *rxdataF_comp128_0,*ul_ch_mag128_0,*ul_ch_mag128_0b;
int16x8_t *rxdataF_comp128_1,*ul_ch_mag128_1,*ul_ch_mag128_1b;
int16x8_t *rxdataF_comp128_2,*ul_ch_mag128_2,*ul_ch_mag128_2b;
int16x8_t *rxdataF_comp128_3,*ul_ch_mag128_3,*ul_ch_mag128_3b;
#endif
int32_t i;
......@@ -646,15 +650,39 @@ void ulsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
ul_ch_mag128_1 = (__m128i *)&ul_ch_mag[1][symbol*frame_parms->N_RB_DL*12];
ul_ch_mag128_0b = (__m128i *)&ul_ch_magb[0][symbol*frame_parms->N_RB_DL*12];
ul_ch_mag128_1b = (__m128i *)&ul_ch_magb[1][symbol*frame_parms->N_RB_DL*12];
if (frame_parms->nb_antennas_rx>2) {
rxdataF_comp128_2 = (__m128i *)&rxdataF_comp[2][symbol*frame_parms->N_RB_DL*12];
ul_ch_mag128_2 = (__m128i *)&ul_ch_mag[2][symbol*frame_parms->N_RB_DL*12];
ul_ch_mag128_2b = (__m128i *)&ul_ch_magb[2][symbol*frame_parms->N_RB_DL*12];
}
if (frame_parms->nb_antennas_rx>3) {
rxdataF_comp128_3 = (__m128i *)&rxdataF_comp[3][symbol*frame_parms->N_RB_DL*12];
ul_ch_mag128_3 = (__m128i *)&ul_ch_mag[3][symbol*frame_parms->N_RB_DL*12];
ul_ch_mag128_3b = (__m128i *)&ul_ch_magb[3][symbol*frame_parms->N_RB_DL*12];
}
// MRC on each re of rb, both on MF output and magnitude (for 16QAM/64QAM llr computation)
if (frame_parms->nb_antennas_rx==2)
for (i=0; i<nb_rb*3; i++) {
rxdataF_comp128_0[i] = _mm_adds_epi16(_mm_srai_epi16(rxdataF_comp128_0[i],1),_mm_srai_epi16(rxdataF_comp128_1[i],1));
ul_ch_mag128_0[i] = _mm_adds_epi16(_mm_srai_epi16(ul_ch_mag128_0[i],1),_mm_srai_epi16(ul_ch_mag128_1[i],1));
ul_ch_mag128_0b[i] = _mm_adds_epi16(_mm_srai_epi16(ul_ch_mag128_0b[i],1),_mm_srai_epi16(ul_ch_mag128_1b[i],1));
rxdataF_comp128_0[i] = _mm_srai_epi16(_mm_adds_epi16(rxdataF_comp128_0[i],rxdataF_comp128_1[i]),1);
ul_ch_mag128_0[i] = _mm_srai_epi16(_mm_adds_epi16(ul_ch_mag128_0[i],ul_ch_mag128_1[i]),1);
ul_ch_mag128_0b[i] = _mm_srai_epi16(_mm_adds_epi16(ul_ch_mag128_0b[i],ul_ch_mag128_1b[i]),1);
rxdataF_comp128_0[i] = _mm_add_epi16(rxdataF_comp128_0[i],(*(__m128i *)&jitterc[0]));
}
if (frame_parms->nb_antennas_rx==3)
for (i=0; i<nb_rb*3; i++) {
rxdataF_comp128_0[i] = _mm_srai_epi16(_mm_adds_epi16(rxdataF_comp128_0[i],_mm_adds_epi16(rxdataF_comp128_1[i],rxdataF_comp128_2[i])),1);
ul_ch_mag128_0[i] = _mm_srai_epi16(_mm_adds_epi16(ul_ch_mag128_0[i],_mm_adds_epi16(ul_ch_mag128_1[i],ul_ch_mag128_2[i])),1);
ul_ch_mag128_0b[i] = _mm_srai_epi16(_mm_adds_epi16(ul_ch_mag128_0b[i],_mm_adds_epi16(ul_ch_mag128_1b[i],ul_ch_mag128_2b[i])),1);
rxdataF_comp128_0[i] = _mm_add_epi16(rxdataF_comp128_0[i],(*(__m128i *)&jitterc[0]));
}
if (frame_parms->nb_antennas_rx==4)
for (i=0; i<nb_rb*3; i++) {
rxdataF_comp128_0[i] = _mm_srai_epi16(_mm_adds_epi16(rxdataF_comp128_0[i],_mm_adds_epi16(rxdataF_comp128_1[i],_mm_adds_epi16(rxdataF_comp128_2[i],rxdataF_comp128_3[i]))),2);
ul_ch_mag128_0[i] = _mm_srai_epi16(_mm_adds_epi16(ul_ch_mag128_0[i],_mm_adds_epi16(ul_ch_mag128_1[i],_mm_adds_epi16(ul_ch_mag128_2[i],ul_ch_mag128_3[i]))),2);
ul_ch_mag128_0b[i] = _mm_srai_epi16(_mm_adds_epi16(ul_ch_mag128_0b[i],_mm_adds_epi16(ul_ch_mag128_1b[i],_mm_adds_epi16(ul_ch_mag128_2b[i],ul_ch_mag128_3b[i]))),2);
rxdataF_comp128_0[i] = _mm_add_epi16(rxdataF_comp128_0[i],(*(__m128i *)&jitterc[0]));
}
#elif defined(__arm__)
rxdataF_comp128_0 = (int16x8_t *)&rxdataF_comp[0][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp128_1 = (int16x8_t *)&rxdataF_comp[1][symbol*frame_parms->N_RB_DL*12];
......@@ -796,7 +824,7 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
mmtmpU0 = _mm_srai_epi32(mmtmpU0,output_shift);
mmtmpU1 = _mm_packs_epi32(mmtmpU0,mmtmpU0);
ul_ch_mag128[2] = _mm_unpacklo_epi16(mmtmpU1,mmtmpU1);
LOG_D(PHY,"comp: symbol %d rb %d => %d,%d,%d (output_shift %d)\n",symbol,rb,*((int16_t *)&ul_ch_mag128[0]),*((int16_t *)&ul_ch_mag128[1]),*((int16_t *)&ul_ch_mag128[2]),output_shift);
//LOG_I(PHY,"comp: ant %d symbol %d rb %d => %d,%d,%d (output_shift %d)\n",aarx,symbol,rb,*((int16_t *)&ul_ch_mag128[0]),*((int16_t *)&ul_ch_mag128[1]),*((int16_t *)&ul_ch_mag128[2]),output_shift);
#elif defined(__arm__)
mmtmpU0 = vmull_s16(ul_ch128[0], ul_ch128[0]);
mmtmpU0 = vqshlq_s32(vqaddq_s32(mmtmpU0,vrev64q_s32(mmtmpU0)),-output_shift128);
......@@ -835,6 +863,7 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
// print_ints("c1",&mmtmpU3);
rxdataF_comp128[0] = _mm_packs_epi32(mmtmpU2,mmtmpU3);
/*
LOG_I(PHY,"Antenna %d:",aarx);
print_shorts("rx:",&rxdataF128[0]);
print_shorts("ch:",&ul_ch128[0]);
print_shorts("pack:",&rxdataF_comp128[0]);
......@@ -852,9 +881,12 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
mmtmpU2 = _mm_unpacklo_epi32(mmtmpU0,mmtmpU1);
mmtmpU3 = _mm_unpackhi_epi32(mmtmpU0,mmtmpU1);
rxdataF_comp128[1] = _mm_packs_epi32(mmtmpU2,mmtmpU3);
// print_shorts("rx:",rxdataF128[1]);
// print_shorts("ch:",ul_ch128[1]);
// print_shorts("pack:",rxdataF_comp128[1]);
/*
LOG_I(PHY,"Antenna %d:",aarx);
print_shorts("rx:",&rxdataF128[1]);
print_shorts("ch:",&ul_ch128[1]);
print_shorts("pack:",&rxdataF_comp128[1]);
*/
// multiply by conjugated channel
mmtmpU0 = _mm_madd_epi16(ul_ch128[2],rxdataF128[2]);
// mmtmpU0 contains real part of 4 consecutive outputs (32-bit)
......@@ -868,9 +900,12 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
mmtmpU2 = _mm_unpacklo_epi32(mmtmpU0,mmtmpU1);
mmtmpU3 = _mm_unpackhi_epi32(mmtmpU0,mmtmpU1);
rxdataF_comp128[2] = _mm_packs_epi32(mmtmpU2,mmtmpU3);
// print_shorts("rx:",rxdataF128[2]);
// print_shorts("ch:",ul_ch128[2]);
// print_shorts("pack:",rxdataF_comp128[2]);
/*
LOG_I(PHY,"Antenna %d:",aarx);
print_shorts("rx:",&rxdataF128[2]);
print_shorts("ch:",&ul_ch128[2]);
print_shorts("pack:",&rxdataF_comp128[2]);
*/
// Add a jitter to compensate for the saturation in "packs" resulting in a bias on the DC after IDFT
rxdataF_comp128[0] = _mm_add_epi16(rxdataF_comp128[0],(*(__m128i *)&jitter[0]));
rxdataF_comp128[1] = _mm_add_epi16(rxdataF_comp128[1],(*(__m128i *)&jitter[0]));
......@@ -1096,7 +1131,7 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
avgs = cmax(avgs,avgU[aarx]);
// log2_maxh = 4+(log2_approx(avgs)/2);
log2_maxh = (log2_approx(avgs)/2)+ log2_approx(frame_parms->nb_antennas_rx-1)+4;
log2_maxh = (log2_approx(avgs)/2); //+ log2_approx(frame_parms->nb_antennas_rx-1)+4;
LOG_D(PHY,"[ULSCH] log2_maxh = %d (%d,%d)\n",log2_maxh,avgU[0],avgs);
for (l=0; l<(frame_parms->symbols_per_tti-ulsch[UE_id]->harq_processes[harq_pid]->srs_active); l++) {
......@@ -1216,62 +1251,41 @@ void dump_ulsch(PHY_VARS_eNB *eNB,int frame,int subframe,uint8_t UE_id,int round
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Kplus*3,1,0);
if (eNB->common_vars.rxdata) {
sprintf(fname,"/tmp/rxsig0_r%d.m",round);
sprintf(vname,"rxs0_r%d",round);
LOG_UM(fname,vname, &eNB->common_vars.rxdata[0][0],eNB->frame_parms.samples_per_tti*10,1,1);
for (int aarx=0;aarx<eNB->frame_parms.nb_antennas_rx;aarx++) {
sprintf(fname,"/tmp/rxsig%d_r%d.m",aarx,round);
sprintf(vname,"rxs%d_r%d",aarx,round);
LOG_UM(fname,vname, &eNB->common_vars.rxdata[aarx][0],eNB->frame_parms.samples_per_tti*10,1,1);
if (eNB->frame_parms.nb_antennas_rx>1)
if (eNB->common_vars.rxdata) {
sprintf(fname,"/tmp/rxsig1_r%d.m",round);
sprintf(vname,"rxs1_r%d",round);
LOG_UM(fname,vname, &eNB->common_vars.rxdata[1][0],eNB->frame_parms.samples_per_tti*10,1,1);
}
}
sprintf(fname,"/tmp/rxsigF0_r%d.m",round);
sprintf(vname,"rxsF0_r%d",round);
LOG_UM(fname,vname, (void *)&eNB->common_vars.rxdataF[0][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
if (eNB->frame_parms.nb_antennas_rx>1) {
sprintf(fname,"/tmp/rxsigF1_r%d.m",round);
sprintf(vname,"rxsF1_r%d",round);
LOG_UM(vname,fname, &eNB->common_vars.rxdataF[1][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
if (eNB->common_vars.rxdataF) {
for (int aarx=0;aarx<eNB->frame_parms.nb_antennas_rx;aarx++) {
sprintf(fname,"/tmp/rxsigF%d_r%d.m",aarx,round);
sprintf(vname,"rxsF%d_r%d",aarx,round);
LOG_UM(fname,vname, (void *)&eNB->common_vars.rxdataF[aarx][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
}
}
if (eNB->pusch_vars[UE_id]->rxdataF_ext) {
for (int aarx=0;aarx<eNB->frame_parms.nb_antennas_rx;aarx++) {
sprintf(fname,"/tmp/rxsigF%d_ext_r%d.m",aarx,round);
sprintf(vname,"rxsF%d_ext_r%d",aarx,round);
LOG_UM(fname,vname, &eNB->pusch_vars[UE_id]->rxdataF_ext[aarx][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
}
sprintf(fname,"/tmp/rxsigF0_ext_r%d.m",round);
sprintf(vname,"rxsF0_ext_r%d",round);
LOG_UM(fname,vname, &eNB->pusch_vars[UE_id]->rxdataF_ext[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
if (eNB->frame_parms.nb_antennas_rx>1) {
sprintf(fname,"/tmp/rxsigF1_ext_r%d.m",round);
sprintf(vname,"rxsF1_ext_r%d",round);
LOG_UM(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_ext[1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
}
/*
if (eNB->srs_vars[UE_id].srs_ch_estimates) LOG_UM("/tmp/srs_est0.m","srsest0",eNB->srs_vars[UE_id].srs_ch_estimates[0],eNB->frame_parms.ofdm_symbol_size,1,1);
if (eNB->frame_parms.nb_antennas_rx>1)
if (eNB->srs_vars[UE_id].srs_ch_estimates) LOG_UM("/tmp/srs_est1.m","srsest1",eNB->srs_vars[UE_id].srs_ch_estimates[1],eNB->frame_parms.ofdm_symbol_size,1,1);
*/
sprintf(fname,"/tmp/drs_est0_r%d.m",round);
sprintf(vname,"drsest0_r%d",round);
LOG_UM(fname,vname,eNB->pusch_vars[UE_id]->drs_ch_estimates[0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
if (eNB->frame_parms.nb_antennas_rx>1) {
sprintf(fname,"/tmp/drs_est1_r%d.m",round);
sprintf(vname,"drsest1_r%d",round);
LOG_UM(fname,vname,eNB->pusch_vars[UE_id]->drs_ch_estimates[1],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
}
sprintf(fname,"/tmp/ulsch0_rxF_comp0_r%d.m",round);
sprintf(vname,"ulsch0_rxF_comp0_r%d",round);
LOG_UM(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_comp[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
if (eNB->frame_parms.nb_antennas_rx>1) {
sprintf(fname,"/tmp/ulsch0_rxF_comp1_r%d.m",round);
sprintf(vname,"ulsch0_rxF_comp1_r%d",round);
LOG_UM(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_comp[1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
for (int aarx=0;aarx<eNB->frame_parms.nb_antennas_rx;aarx++) {
sprintf(fname,"/tmp/drs_est%d_r%d.m",aarx,round);
sprintf(vname,"drsest%d_r%d",aarx,round);
LOG_UM(fname,vname,eNB->pusch_vars[UE_id]->drs_ch_estimates[aarx],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
sprintf(fname,"/tmp/ulsch%d_rxF_comp0_r%d.m",aarx,round);
sprintf(vname,"ulsch_rxF%d_comp0_r%d",aarx,round);
LOG_UM(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_comp[aarx][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
}
// LOG_M("ulsch_rxF_comp1.m","ulsch0_rxF_comp1",&eNB->pusch_vars[UE_id]->rxdataF_comp[0][1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
......
......@@ -342,7 +342,6 @@ int main(int argc, char **argv) {
int UE_id = 0;
static int nb_rb=25,first_rb=0,mcs=0,round=0;
//unsigned char l;
static int awgn_flag = 0 ;
SCM_t channel_model=Rice1;
unsigned char *input_buffer=0,harq_pid;
unsigned short input_buffer_length;
......@@ -1087,7 +1086,6 @@ int main(int argc, char **argv) {
}
}
if (awgn_flag == 0) {
if (UE2eNB->max_Doppler == 0) {
multipath_channel(UE2eNB,s_re,s_im,r_re,r_im,
eNB->frame_parms.samples_per_tti,hold_channel,0);
......@@ -1095,7 +1093,6 @@ int main(int argc, char **argv) {
multipath_tv_channel(UE2eNB,s_re,s_im,r_re,r_im,
2*eNB->frame_parms.samples_per_tti,hold_channel);
}
}
if(abstx) {
if(saving_bler==0)
......@@ -1303,7 +1300,7 @@ int main(int argc, char **argv) {
LOG_UDUMPMSG(SIM,dataArray(table_rx),table_rx->size,LOG_DUMP_DOUBLE,"The receiver raw data: \n");
}
dump_ulsch_stats(NULL,eNB,0);
dump_ulsch_stats(stdout,eNB,0);
printf("\n**********rb: %d ***mcs : %d *********SNR = %f dB (%f): TX %u dB (gain %f dB), N0W %f dB, I0 %u dB, delta_IF %d [ (%d,%d) dB / (%u,%u) dB ]**************************\n",
nb_rb,mcs,SNR,SNR2,
tx_lev_dB,
......
......@@ -39,10 +39,10 @@ uint8_t multipath_channel_nosigconv(channel_desc_t *desc)
//#define CHANNEL_SSE
#ifdef CHANNEL_SSE
void multipath_channel(channel_desc_t *desc,
double tx_sig_re[2][30720*2],
double tx_sig_im[2][30720*2],
double rx_sig_re[2][30720*2],
double rx_sig_im[2][30720*2],
double tx_sig_re[NB_ANTENNAS_TX][30720*2],
double tx_sig_im[NB_ANTENANS_TX][30720*2],
double rx_sig_re[NB_ANTENNAS_RX][30720*2],
double rx_sig_im[NB_ANTENNAS_RX][30720*2],
uint32_t length,
uint8_t keep_channel,
int log_channel)
......@@ -146,10 +146,10 @@ void multipath_channel(channel_desc_t *desc,
#else
void multipath_channel(channel_desc_t *desc,
double *tx_sig_re[2],
double *tx_sig_im[2],
double *rx_sig_re[2],
double *rx_sig_im[2],
double *tx_sig_re[NB_ANTENNAS_TX],
double *tx_sig_im[NB_ANTENNAS_TX],
double *rx_sig_re[NB_ANTENNAS_RX],
double *rx_sig_im[NB_ANTENNAS_RX],
uint32_t length,
uint8_t keep_channel,
int log_channel)
......@@ -198,6 +198,7 @@ void multipath_channel(channel_desc_t *desc,
rx_tmp.x += (tx.x * desc->ch[ii+(j*desc->nb_rx)][l].x) - (tx.y * desc->ch[ii+(j*desc->nb_rx)][l].y);
rx_tmp.y += (tx.y * desc->ch[ii+(j*desc->nb_rx)][l].x) + (tx.x * desc->ch[ii+(j*desc->nb_rx)][l].y);
if (i==0 && log_channel == 1) {
printf("channel[%d][%d][%d] = %f dB (%e,%e)\n",ii,j,l,10*log10(pow(desc->ch[ii+(j*desc->nb_rx)][l].x,2.0)+pow(desc->ch[ii+(j*desc->nb_rx)][l].y,2.0)),
desc->ch[ii+(j*desc->nb_rx)][l].x,
......@@ -208,11 +209,11 @@ void multipath_channel(channel_desc_t *desc,
rx_sig_re[ii][i+dd] = rx_tmp.x*path_loss;
rx_sig_im[ii][i+dd] = rx_tmp.y*path_loss;
/* if ((ii==0)&&((i%32)==0)) {
printf("%p %p %f,%f => %e,%e\n",rx_sig_re[ii],rx_sig_im[ii],rx_tmp.x,rx_tmp.y,rx_sig_re[ii][i-dd],rx_sig_im[ii][i-dd]);
}*/
#ifdef DEBUG_CHANNEL
if ((i%32)==0) {
printf("rx aa %d: %p %p %f,%f => %e,%e\n",ii,rx_sig_re[ii],rx_sig_im[ii],rx_tmp.x,rx_tmp.y,rx_sig_re[ii][i-dd],rx_sig_im[ii][i-dd]);
}
#endif
//rx_sig_re[ii][i] = sqrt(.5)*(tx_sig_re[0][i] + tx_sig_re[1][i]);
//rx_sig_im[ii][i] = sqrt(.5)*(tx_sig_im[0][i] + tx_sig_im[1][i]);
......
......@@ -300,10 +300,10 @@ void set_channeldesc_owner(channel_desc_t *cdesc, channelmod_moduleid_t module_i
int random_channel(channel_desc_t *desc, uint8_t abstraction_flag);
/**\fn void multipath_channel(channel_desc_t *desc,
double tx_sig_re[2],
double tx_sig_im[2],
double rx_sig_re[2],
double rx_sig_im[2],
double tx_sig_re[NB_ANTENNAS_TX],
double tx_sig_im[NB_ANTENANS_TX],
double rx_sig_re[NB_ANTENNAS_RX],
double rx_sig_im[NB_ANTENNAS_RX],
uint32_t length,
uint8_t keep_channel,
int log_channel)
......@@ -320,10 +320,10 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag);
*/
void multipath_channel(channel_desc_t *desc,
double *tx_sig_re[2],
double *tx_sig_im[2],
double *rx_sig_re[2],
double *rx_sig_im[2],
double *tx_sig_re[NB_ANTENNAS_TX],
double *tx_sig_im[NB_ANTENNAS_TX],
double *rx_sig_re[NB_ANTENNAS_RX],
double *rx_sig_im[NB_ANTENNAS_RX],
uint32_t length,
uint8_t keep_channel,
int log_channel);
......
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