fixed bugs in UL power control
fixed bug in freq_channel when used with perfect channel estimation git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5778 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -10,7 +10,7 @@ OPENAIR1_TOP = $(OPENAIR1_DIR)
|
||||
OPENAIR2_TOP = $(OPENAIR2_DIR)
|
||||
OPENAIR3 = $(OPENAIR3_DIR)
|
||||
|
||||
CFLAGS = -g -ggdb -O3 -Wno-strict-aliasing -rdynamic -DMAX_NUM_CCs=1 -Wall -DPHYSIM -DNODE_RG -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 $(CPUFLAGS) -DMALLOC_CHECK_=1 -DENABLE_VCD_FIFO # -Wno-packed-bitfield-compat
|
||||
CFLAGS = -g -ggdb -Wno-strict-aliasing -rdynamic -DMAX_NUM_CCs=1 -Wall -DPHYSIM -DNODE_RG -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 $(CPUFLAGS) -DMALLOC_CHECK_=1 -DENABLE_VCD_FIFO # -Wno-packed-bitfield-compat
|
||||
|
||||
|
||||
# DCI Debug
|
||||
@@ -91,7 +91,7 @@ ifdef BIT8_TX
|
||||
CFLAGS += -DBIT8_TX
|
||||
endif
|
||||
|
||||
CFLAGS += -DNO_RRM -DOPENAIR1 #-DOPENAIR2 #-DPHY_ABSTRACTION
|
||||
CFLAGS += -DNO_RRM -DOPENAIR1 -DPHY_ABSTRACTION #-DOPENAIR2
|
||||
|
||||
CFLAGS += -I/usr/include/X11 -I/usr/X11R6/include
|
||||
|
||||
|
||||
@@ -325,7 +325,7 @@ int main(int argc, char **argv) {
|
||||
int llr8_flag=0;
|
||||
|
||||
double effective_rate=0.0;
|
||||
char channel_model_input[10];
|
||||
char channel_model_input[10]="I";
|
||||
opp_enabled=1; // to enable the time meas
|
||||
|
||||
cpu_freq_GHz = (double)get_cpu_freq_GHz();
|
||||
@@ -406,7 +406,7 @@ int main(int argc, char **argv) {
|
||||
num_pdcch_symbols=atoi(optarg);
|
||||
break;
|
||||
case 'g':
|
||||
sprintf(channel_model_input,optarg,10);
|
||||
memcpy(channel_model_input,optarg,10);
|
||||
switch((char)*optarg) {
|
||||
case 'A':
|
||||
channel_model=SCM_A;
|
||||
@@ -2508,11 +2508,11 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
|
||||
for (iii=0; iii<NB_RB; iii++){
|
||||
//fprintf(csv_fd, "%d, %d", (PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->pmi_ext[iii]),(PHY_vars_UE->lte_ue_pdsch_vars[eNB_id_i]->pmi_ext[iii]));
|
||||
fprintf(csv_fd,"%x,%x,",(PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->pmi_ext[iii]),(PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->pmi_ext[iii]));
|
||||
msg(" %x",(PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->pmi_ext[iii]));
|
||||
printf("%x ",(PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->pmi_ext[iii]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PHY_vars_UE->dlsch_ue[0][0]->rnti = (common_flag==0) ? n_rnti: SI_RNTI;
|
||||
coded_bits_per_codeword = get_G(&PHY_vars_eNB->lte_frame_parms,
|
||||
PHY_vars_eNB->dlsch_eNB[0][0]->nb_rb,
|
||||
|
||||
@@ -452,7 +452,8 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
// add common dci
|
||||
DCI_pdu.dci_alloc[0].dci_length = BCCH_pdu_size_bits;
|
||||
DCI_pdu.dci_alloc[0].L = log2Lcommon;
|
||||
@@ -470,13 +471,13 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2
|
||||
DCI_pdu.dci_alloc[1].ra_flag = 0;
|
||||
memcpy((void*)&DCI_pdu.dci_alloc[1].dci_pdu[0], &DLSCH_alloc_pdu[0], dci_length_bytes);
|
||||
DCI_pdu.Num_ue_spec_dci++;
|
||||
|
||||
*/
|
||||
|
||||
DCI_pdu.dci_alloc[2].dci_length = UL_pdu_size_bits;
|
||||
DCI_pdu.dci_alloc[2].L = log2L;
|
||||
DCI_pdu.dci_alloc[2].rnti = rnti;
|
||||
DCI_pdu.dci_alloc[2].format = format0;
|
||||
DCI_pdu.dci_alloc[2].ra_flag = 0;
|
||||
DCI_pdu.dci_alloc[0].dci_length = UL_pdu_size_bits;
|
||||
DCI_pdu.dci_alloc[0].L = log2L;
|
||||
DCI_pdu.dci_alloc[0].rnti = rnti;
|
||||
DCI_pdu.dci_alloc[0].format = format0;
|
||||
DCI_pdu.dci_alloc[0].ra_flag = 0;
|
||||
memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &UL_alloc_pdu[0], UL_pdu_size_bytes);
|
||||
DCI_pdu.Num_ue_spec_dci++;
|
||||
|
||||
@@ -929,6 +930,13 @@ int main(int argc, char **argv) {
|
||||
DCI_pdu.dci_alloc, frame_parms, subframe);
|
||||
DCI_pdu.nCCE = get_nCCE(num_pdcch_symbols,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,subframe));
|
||||
|
||||
if (n_frames==1) {
|
||||
printf("num_dci %d, num_pddch_symbols %d, nCCE %d\n",
|
||||
DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci,
|
||||
num_pdcch_symbols,
|
||||
DCI_pdu.nCCE);
|
||||
}
|
||||
|
||||
// apply RNTI-based nCCE allocation
|
||||
for (i = 0; i < DCI_pdu.Num_common_dci + DCI_pdu.Num_ue_spec_dci; i++) {
|
||||
// SI RNTI
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
#define DEBUG_DAC 1
|
||||
//#define DEBUG_DAC 1
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include "PHY/TOOLS/defs.h"
|
||||
|
||||
@@ -46,7 +46,7 @@ extern int write_output(const char *,const char *,void *,int,int,char);
|
||||
|
||||
//double pn[1024];
|
||||
|
||||
#define DEBUG_RF 1
|
||||
//#define DEBUG_RF 1
|
||||
|
||||
//free(input_data);
|
||||
void rf_rx(double **r_re,
|
||||
|
||||
@@ -85,33 +85,38 @@ void init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples) {
|
||||
void freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples) {
|
||||
|
||||
|
||||
int16_t f;
|
||||
int16_t f,f2,d;
|
||||
uint8_t aarx,aatx,l;
|
||||
double *clut,*slut;
|
||||
static int freq_channel_init=0;
|
||||
static int n_samples_max=0;
|
||||
|
||||
// printf("no of samples:%d,",n_samples);
|
||||
// printf("no of taps:%d,",(int)desc->nb_taps);
|
||||
|
||||
if (freq_channel_init == 0) {
|
||||
init_freq_channel(desc,nb_rb,n_samples);
|
||||
// we are initializing the lut for the largets possible n_samples=12*nb_rb+1
|
||||
// if called with n_samples<12*nb_rb+1, we decimate the lut
|
||||
n_samples_max=12*nb_rb+1;
|
||||
init_freq_channel(desc,nb_rb,n_samples_max);
|
||||
freq_channel_init=1;
|
||||
}
|
||||
d=n_samples_max/n_samples;
|
||||
|
||||
start_meas(&desc->interp_freq);
|
||||
for (f=-n_samples/2;f<n_samples/2;f++) {
|
||||
clut = cos_lut[n_samples/2+f];
|
||||
slut = sin_lut[n_samples/2+f];
|
||||
for (f=-n_samples_max/2,f2=-n_samples/2;f<n_samples_max/2;f+=d,f2++) {
|
||||
clut = cos_lut[n_samples_max/2+f];
|
||||
slut = sin_lut[n_samples_max/2+f];
|
||||
|
||||
for (aarx=0;aarx<desc->nb_rx;aarx++) {
|
||||
for (aatx=0;aatx<desc->nb_tx;aatx++) {
|
||||
desc->chF[aarx+(aatx*desc->nb_rx)][n_samples/2+f].x=0.0;
|
||||
desc->chF[aarx+(aatx*desc->nb_rx)][n_samples/2+f].y=0.0;
|
||||
desc->chF[aarx+(aatx*desc->nb_rx)][n_samples/2+f2].x=0.0;
|
||||
desc->chF[aarx+(aatx*desc->nb_rx)][n_samples/2+f2].y=0.0;
|
||||
for (l=0;l<(int)desc->nb_taps;l++) {
|
||||
|
||||
desc->chF[aarx+(aatx*desc->nb_rx)][n_samples/2+f].x+=(desc->a[l][aarx+(aatx*desc->nb_rx)].x*clut[l]+
|
||||
desc->chF[aarx+(aatx*desc->nb_rx)][n_samples/2+f2].x+=(desc->a[l][aarx+(aatx*desc->nb_rx)].x*clut[l]+
|
||||
desc->a[l][aarx+(aatx*desc->nb_rx)].y*slut[l]);
|
||||
desc->chF[aarx+(aatx*desc->nb_rx)][n_samples/2+f].y+=(-desc->a[l][aarx+(aatx*desc->nb_rx)].x*slut[l]+
|
||||
desc->chF[aarx+(aatx*desc->nb_rx)][n_samples/2+f2].y+=(-desc->a[l][aarx+(aatx*desc->nb_rx)].x*slut[l]+
|
||||
desc->a[l][aarx+(aatx*desc->nb_rx)].y*clut[l]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user