Commit 63143b87 authored by frtabu's avatar frtabu

Go on removing printf arguments warnings, add a suppression file to be used with cppcheck command

parent 875bdaf2
// suppress error about keysP not free, it is done by calling func */
memleak:common/utils/hashtable/obj_hashtable.c
// followings errors are in file not used in oai exec's included in CI
invalidPrintfArgType_sint:openair1/PHY/CODING/TESTBENCH/ltetest.c
memleak:openair1/PHY/CODING/TESTBENCH/ltetest.c
invalidPrintfArgType_sint:openair1/PHY/CODING/TESTBENCH/pdcch_test.c
...@@ -31,18 +31,18 @@ ...@@ -31,18 +31,18 @@
#include "backtrace.h" #include "backtrace.h"
/* Obtain a backtrace and print it to stdout. */ /* Obtain a backtrace and print it to stdout. */
void display_backtrace(void) void display_backtrace(void) {
{
void *array[10]; void *array[10];
size_t size; size_t size;
char **strings; char **strings;
size_t i; size_t i;
char* test=getenv("NO_BACKTRACE"); char *test=getenv("NO_BACKTRACE");
if (test!=0) *((int*)0)=0;
if (test!=0) *((int *)0)=0;
size = backtrace(array, 10); size = backtrace(array, 10);
strings = backtrace_symbols(array, size); strings = backtrace_symbols(array, size);
printf("Obtained %u stack frames.\n", (unsigned int)size);
printf("Obtained %zd stack frames.\n", size);
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
printf("%s\n", strings[i]); printf("%s\n", strings[i]);
...@@ -50,8 +50,7 @@ void display_backtrace(void) ...@@ -50,8 +50,7 @@ void display_backtrace(void)
free(strings); free(strings);
} }
void backtrace_handle_signal(siginfo_t *info) void backtrace_handle_signal(siginfo_t *info) {
{
display_backtrace(); display_backtrace();
//exit(EXIT_FAILURE); //exit(EXIT_FAILURE);
} }
This diff is collapsed.
...@@ -130,7 +130,7 @@ ccodedot11_encode (unsigned int numbytes, ...@@ -130,7 +130,7 @@ ccodedot11_encode (unsigned int numbytes,
*outPtr++ = (out>>1)&1; *outPtr++ = (out>>1)&1;
#ifdef DEBUG_CCODE #ifdef DEBUG_CCODE
printf("%d: %u -> %d (%u)\n",dummy,state,out,ccodedot11_table[state]); printf("%u: %u -> %d (%u)\n",dummy,state,out,ccodedot11_table[state]);
dummy+=2; dummy+=2;
#endif //DEBUG_CCODE #endif //DEBUG_CCODE
bit_index=(bit_index==0)?1:0; bit_index=(bit_index==0)?1:0;
......
...@@ -236,7 +236,7 @@ void sub_block_deinterleaving_cc(uint32_t D,int8_t *d,int8_t *w) { ...@@ -236,7 +236,7 @@ void sub_block_deinterleaving_cc(uint32_t D,int8_t *d,int8_t *w) {
ND = Kpi - D; ND = Kpi - D;
#ifdef RM_DEBUG2 #ifdef RM_DEBUG2
printf("sub_block_interleaving_cc : D = %d (%d), d %p, w %p\n",D,D*3,d,w); printf("sub_block_interleaving_cc : D = %d (%d), d %p, w %p\n",D,D*3,d,w);
printf("RCC = %d, Kpi=%d, ND=%ld\n",RCC,Kpi,ND); printf("RCC = %d, Kpi=%d, ND=%ld\n",RCC,Kpi,(long)ND);
#endif #endif
ND3 = ND*3; ND3 = ND*3;
k=0; k=0;
...@@ -253,7 +253,8 @@ void sub_block_deinterleaving_cc(uint32_t D,int8_t *d,int8_t *w) { ...@@ -253,7 +253,8 @@ void sub_block_deinterleaving_cc(uint32_t D,int8_t *d,int8_t *w) {
d[index3-ND3+1] = w[Kpi+k]; d[index3-ND3+1] = w[Kpi+k];
d[index3-ND3+2] = w[(Kpi<<1)+k]; d[index3-ND3+2] = w[(Kpi<<1)+k];
#ifdef RM_DEBUG2 #ifdef RM_DEBUG2
printf("row %d, index %d k %d index3-ND3 %ld w(%d,%d,%d)\n",row,index,k,index3-ND3,w[k],w[Kpi+k],w[(Kpi<<1)+k]); printf("row %d, index %d k %d index3-ND3 %ld w(%d,%d,%d)\n",
row,index,k,(long)(index3-ND3),w[k],w[Kpi+k],w[(Kpi<<1)+k]);
#endif #endif
index3+=96; index3+=96;
index+=32; index+=32;
...@@ -453,7 +454,6 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC, ...@@ -453,7 +454,6 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
int threed =0; int threed =0;
uint32_t nulled=0; uint32_t nulled=0;
static unsigned char *counter_buffer[MAX_NUM_DLSCH_SEGMENTS][4]; static unsigned char *counter_buffer[MAX_NUM_DLSCH_SEGMENTS][4];
FILE *counter_fd;
char fname[512]; char fname[512];
#endif #endif
...@@ -476,7 +476,6 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC, ...@@ -476,7 +476,6 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
} else if(rvidx==3) { } else if(rvidx==3) {
sprintf(fname, "mcs%d_rate_matching_RB_%d.txt", m, nb_rb); sprintf(fname, "mcs%d_rate_matching_RB_%d.txt", m, nb_rb);
// sprintf(fname,"mcs0_rate_matching_RB_6.txt"); // sprintf(fname,"mcs0_rate_matching_RB_6.txt");
counter_fd = fopen(fname,"w");
} }
#endif #endif
......
...@@ -124,8 +124,8 @@ int lte_segmentation(unsigned char *input_buffer, ...@@ -124,8 +124,8 @@ int lte_segmentation(unsigned char *input_buffer,
Bprime,*Cplus,*Kplus,*Cminus,*Kminus); Bprime,*Cplus,*Kplus,*Cminus,*Kminus);
*F = ((*Cplus)*(*Kplus) + (*Cminus)*(*Kminus) - (Bprime)); *F = ((*Cplus)*(*Kplus) + (*Cminus)*(*Kminus) - (Bprime));
#ifdef DEBUG_SEGMENTATION #ifdef DEBUG_SEGMENTATION
printf("C %u, Cplus %u, Cminus %u, Kplus %u, Kminus %u, Bprime_bytes %u, Bprime %u, F %u\n",*C,*Cplus,*Cminus,*Kplus,*Kminus,Bprime>>3,Bprime,*F); printf("C %u, Cplus %u, Cminus %u, Kplus %u, Kminus %u, Bprime_bytes %u, Bprime %u, F %u\n",
#endif *C,*Cplus,*Cminus,*Kplus,*Kminus,Bprime>>3,Bprime,*F);
if ((input_buffer) && (output_buffers)) { if ((input_buffer) && (output_buffers)) {
for (k=0; k<*F>>3; k++) { for (k=0; k<*F>>3; k++) {
......
...@@ -35,30 +35,22 @@ ...@@ -35,30 +35,22 @@
int lte_dl_mbsfn(PHY_VARS_eNB *eNB, int32_t *output, int lte_dl_mbsfn(PHY_VARS_eNB *eNB, int32_t *output,
short amp, short amp,
int subframe, int subframe,
unsigned char l) unsigned char l) {
{
unsigned int mprime,mprime_dword,mprime_qpsk_symb,m; unsigned int mprime,mprime_dword,mprime_qpsk_symb,m;
unsigned short k=0,a; unsigned short k=0,a;
int32_t qpsk[4]; int32_t qpsk[4];
a = (amp*ONE_OVER_SQRT2_Q15)>>15; a = (amp*ONE_OVER_SQRT2_Q15)>>15;
((short *)&qpsk[0])[0] = a; ((short *)&qpsk[0])[0] = a;
((short *)&qpsk[0])[1] = a; ((short *)&qpsk[0])[1] = a;
((short *)&qpsk[1])[0] = -a; ((short *)&qpsk[1])[0] = -a;
((short *)&qpsk[1])[1] = a; ((short *)&qpsk[1])[1] = a;
((short *)&qpsk[2])[0] = a; ((short *)&qpsk[2])[0] = a;
((short *)&qpsk[2])[1] = -a; ((short *)&qpsk[2])[1] = -a;
((short *)&qpsk[3])[0] = -a; ((short *)&qpsk[3])[0] = -a;
((short *)&qpsk[3])[1] = -a; ((short *)&qpsk[3])[1] = -a;
mprime = 3*(110 - eNB->frame_parms.N_RB_DL); mprime = 3*(110 - eNB->frame_parms.N_RB_DL);
for (m=0; m<eNB->frame_parms.N_RB_DL*6; m++) { for (m=0; m<eNB->frame_parms.N_RB_DL*6; m++) {
if ((l==0) || (l==2)) if ((l==0) || (l==2))
k = m<<1; k = m<<1;
else if (l==1) else if (l==1)
...@@ -69,7 +61,6 @@ int lte_dl_mbsfn(PHY_VARS_eNB *eNB, int32_t *output, ...@@ -69,7 +61,6 @@ int lte_dl_mbsfn(PHY_VARS_eNB *eNB, int32_t *output,
} }
k+=eNB->frame_parms.first_carrier_offset; k+=eNB->frame_parms.first_carrier_offset;
mprime_dword = mprime>>4; mprime_dword = mprime>>4;
mprime_qpsk_symb = mprime&0xf; mprime_qpsk_symb = mprime&0xf;
...@@ -80,22 +71,18 @@ int lte_dl_mbsfn(PHY_VARS_eNB *eNB, int32_t *output, ...@@ -80,22 +71,18 @@ int lte_dl_mbsfn(PHY_VARS_eNB *eNB, int32_t *output,
output[k] = qpsk[(eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3]; output[k] = qpsk[(eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
//output[k] = (lte_gold_table[eNB_offset][subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3; //output[k] = (lte_gold_table[eNB_offset][subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3;
#ifdef DEBUG_DL_MBSFN #ifdef DEBUG_DL_MBSFN
LOG_D(PHY,"subframe %d, l %d, m %d, mprime %d, mprime_dword %d, mprime_qpsk_symbol %d\n", LOG_D(PHY,"subframe %d, l %d, m %d, mprime %d, mprime_dword %d, mprime_qpsk_symbol %d\n",
subframe,l,m,mprime,mprime_dword,mprime_qpsk_symb); subframe,l,m,mprime,mprime_dword,mprime_qpsk_symb);
LOG_D(PHY,"index = %d (k %d)(%x)\n",(eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k,eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]); LOG_D(PHY,"index = %d (k %d)(%x)\n",(eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k,eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]);
#endif #endif
mprime++; mprime++;
#ifdef DEBUG_DL_MBSFN #ifdef DEBUG_DL_MBSFN
if (m<18) if (m<18)
printf("subframe %d, l %d output[%d] = (%d,%d)\n",subframe,l,k,((short *)&output[k])[0],((short *)&output[k])[1]); printf("subframe %d, l %d output[%d] = (%d,%d)\n",subframe,l,k,((short *)&output[k])[0],((short *)&output[k])[1]);
#endif #endif
} }
return(0); return(0);
...@@ -106,15 +93,11 @@ int lte_dl_mbsfn(PHY_VARS_eNB *eNB, int32_t *output, ...@@ -106,15 +93,11 @@ int lte_dl_mbsfn(PHY_VARS_eNB *eNB, int32_t *output,
int lte_dl_mbsfn_rx(PHY_VARS_UE *ue, int lte_dl_mbsfn_rx(PHY_VARS_UE *ue,
int *output, int *output,
int subframe, int subframe,
unsigned char l) unsigned char l) {
{
unsigned int mprime,mprime_dword,mprime_qpsk_symb,m; unsigned int mprime,mprime_dword,mprime_qpsk_symb,m;
unsigned short k=0; unsigned short k=0;
unsigned int qpsk[4]; unsigned int qpsk[4];
// This includes complex conjugate for channel estimation // This includes complex conjugate for channel estimation
((short *)&qpsk[0])[0] = ONE_OVER_SQRT2_Q15; ((short *)&qpsk[0])[0] = ONE_OVER_SQRT2_Q15;
((short *)&qpsk[0])[1] = -ONE_OVER_SQRT2_Q15; ((short *)&qpsk[0])[1] = -ONE_OVER_SQRT2_Q15;
((short *)&qpsk[1])[0] = -ONE_OVER_SQRT2_Q15; ((short *)&qpsk[1])[0] = -ONE_OVER_SQRT2_Q15;
...@@ -123,23 +106,18 @@ int lte_dl_mbsfn_rx(PHY_VARS_UE *ue, ...@@ -123,23 +106,18 @@ int lte_dl_mbsfn_rx(PHY_VARS_UE *ue,
((short *)&qpsk[2])[1] = ONE_OVER_SQRT2_Q15; ((short *)&qpsk[2])[1] = ONE_OVER_SQRT2_Q15;
((short *)&qpsk[3])[0] = -ONE_OVER_SQRT2_Q15; ((short *)&qpsk[3])[0] = -ONE_OVER_SQRT2_Q15;
((short *)&qpsk[3])[1] = ONE_OVER_SQRT2_Q15; ((short *)&qpsk[3])[1] = ONE_OVER_SQRT2_Q15;
mprime = 3*(110 - ue->frame_parms.N_RB_DL); mprime = 3*(110 - ue->frame_parms.N_RB_DL);
for (m=0; m<ue->frame_parms.N_RB_DL*6; m++) { for (m=0; m<ue->frame_parms.N_RB_DL*6; m++) {
mprime_dword = mprime>>4; mprime_dword = mprime>>4;
mprime_qpsk_symb = mprime&0xf; mprime_qpsk_symb = mprime&0xf;
// this is r_mprime from 3GPP 36-211 6.10.1.2 // this is r_mprime from 3GPP 36-211 6.10.1.2
output[k] = qpsk[(ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3]; output[k] = qpsk[(ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
#ifdef DEBUG_DL_MBSFN #ifdef DEBUG_DL_MBSFN
printf("subframe %d, l %d, m %d, mprime %d, mprime_dword %d, mprime_qpsk_symbol %d\n", printf("subframe %d, l %d, m %u, mprime %u, mprime_dword %u, mprime_qpsk_symbol %u\n",
subframe,l,m,mprime, mprime_dword,mprime_qpsk_symb); subframe,l,m,mprime, mprime_dword,mprime_qpsk_symb);
printf("index = %d (k %d) (%x)\n",(ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k,ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]); printf("index = %d (k %d) (%x)\n",(ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k,ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]);
#endif #endif
mprime++; mprime++;
#ifdef DEBUG_DL_MBSFN #ifdef DEBUG_DL_MBSFN
...@@ -148,7 +126,6 @@ int lte_dl_mbsfn_rx(PHY_VARS_UE *ue, ...@@ -148,7 +126,6 @@ int lte_dl_mbsfn_rx(PHY_VARS_UE *ue,
#endif #endif
k++; k++;
} }
return(0); return(0);
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
*/ */
#ifdef MAIN #ifdef MAIN
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#endif #endif
#include "lte_refsig.h" #include "lte_refsig.h"
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
...@@ -43,8 +43,7 @@ char ref24[720] = { ...@@ -43,8 +43,7 @@ char ref24[720] = {
-1,3,1,-3,3,-1,1,3,-3,3,1,3,-3,3,1,1,-1,1,3,-3,3,-3,-1,-3,-3,3,-3,-3,-3,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-3,3,-3,3,-3,-1,1,3,1,-3,1,3,3,-1,-3,-1,-1,-1,-1,3,3,3,1,3,3,-3,1,3,-1,3,-1,3,3,-3,3,1,-1,3,3,1,-1,3,3,-1,-3,3,-3,-1,-1,3,-1,3,-1,-1,1,1,1,1,-1,-1,-3,-1,3,1,-1,1,-1,3,-1,3,1,1,-1,-1,-3,1,1,-3,1,3,-3,1,1,-3,-3,-1,-1,-3,-1,1,3,1,1,-3,-1,-1,-3,3,-3,3,1,-3,3,-3,1,-1,1,-3,1,1,1,-1,-3,3,3,1,1,3,-1,-3,-1,-1,-1,3,1,-3,-3,-1,3,-3,-1,-3,-1,-3,-1,-1,-3,-1,-1,1,-3,-1,-1,1,-1,-3,1,1,-3,1,-3,-3,3,1,1,-1,3,-1,-1,1,1,-1,-1,-3,-1,3,-1,3,-1,1,3,1,-1,3,1,3,-3,-3,1,-1,-1,1,3
}; };
void generate_ul_ref_sigs(void) void generate_ul_ref_sigs(void) {
{
double qbar,phase; double qbar,phase;
unsigned int u,v,Msc_RS,q,m,n; unsigned int u,v,Msc_RS,q,m,n;
...@@ -53,7 +52,7 @@ void generate_ul_ref_sigs(void) ...@@ -53,7 +52,7 @@ void generate_ul_ref_sigs(void)
for (u=0; u<30; u++) { for (u=0; u<30; u++) {
for (v=0; v<2; v++) { for (v=0; v<2; v++) {
qbar = ref_primes[Msc_RS] * (u+1)/(double)31; qbar = ref_primes[Msc_RS] * (u+1)/(double)31;
ul_ref_sigs[u][v][Msc_RS] = (int16_t*)malloc16(2*sizeof(int16_t)*dftsizes[Msc_RS]); ul_ref_sigs[u][v][Msc_RS] = (int16_t *)malloc16(2*sizeof(int16_t)*dftsizes[Msc_RS]);
if ((((int)floor(2*qbar))&1) == 0) if ((((int)floor(2*qbar))&1) == 0)
q = (int)(floor(qbar+.5)) - v; q = (int)(floor(qbar+.5)) - v;
...@@ -61,7 +60,7 @@ void generate_ul_ref_sigs(void) ...@@ -61,7 +60,7 @@ void generate_ul_ref_sigs(void)
q = (int)(floor(qbar+.5)) + v; q = (int)(floor(qbar+.5)) + v;
#ifdef MAIN #ifdef MAIN
printf("Msc_RS %d (%d), u %d, v %d -> q %d (qbar %f)\n",Msc_RS,dftsizes[Msc_RS],u,v,q,qbar); printf("Msc_RS %u (%d), u %u, v %u -> q %u (qbar %f)\n",Msc_RS,dftsizes[Msc_RS],u,v,q,qbar);
#endif #endif
for (n=0; n<dftsizes[Msc_RS]; n++) { for (n=0; n<dftsizes[Msc_RS]; n++) {
...@@ -89,32 +88,26 @@ void generate_ul_ref_sigs(void) ...@@ -89,32 +88,26 @@ void generate_ul_ref_sigs(void)
// These are the sequences for RB 1 // These are the sequences for RB 1
for (u=0; u<30; u++) { for (u=0; u<30; u++) {
ul_ref_sigs[u][0][0] = (int16_t*)malloc16(2*sizeof(int16_t)*dftsizes[0]); ul_ref_sigs[u][0][0] = (int16_t *)malloc16(2*sizeof(int16_t)*dftsizes[0]);
for (n=0; n<dftsizes[0]; n++) { for (n=0; n<dftsizes[0]; n++) {
ul_ref_sigs[u][0][0][n<<1] =(int16_t)(floor(32767*cos(M_PI*ref12[(u*12) + n]/4))); ul_ref_sigs[u][0][0][n<<1] =(int16_t)(floor(32767*cos(M_PI*ref12[(u*12) + n]/4)));
ul_ref_sigs[u][0][0][1+(n<<1)]=(int16_t)(floor(32767*sin(M_PI*ref12[(u*12) + n]/4))); ul_ref_sigs[u][0][0][1+(n<<1)]=(int16_t)(floor(32767*sin(M_PI*ref12[(u*12) + n]/4)));
} }
} }
// These are the sequences for RB 2 // These are the sequences for RB 2
for (u=0; u<30; u++) { for (u=0; u<30; u++) {
ul_ref_sigs[u][0][1] = (int16_t*)malloc16(2*sizeof(int16_t)*dftsizes[1]); ul_ref_sigs[u][0][1] = (int16_t *)malloc16(2*sizeof(int16_t)*dftsizes[1]);
for (n=0; n<dftsizes[1]; n++) { for (n=0; n<dftsizes[1]; n++) {
ul_ref_sigs[u][0][1][n<<1] =(int16_t)(floor(32767*cos(M_PI*ref24[(u*24) + n]/4))); ul_ref_sigs[u][0][1][n<<1] =(int16_t)(floor(32767*cos(M_PI*ref24[(u*24) + n]/4)));
ul_ref_sigs[u][0][1][1+(n<<1)]=(int16_t)(floor(32767*sin(M_PI*ref24[(u*24) + n]/4))); ul_ref_sigs[u][0][1][1+(n<<1)]=(int16_t)(floor(32767*sin(M_PI*ref24[(u*24) + n]/4)));
} }
} }
} }
void generate_ul_ref_sigs_rx(void) void generate_ul_ref_sigs_rx(void) {
{
double qbar,phase; double qbar,phase;
unsigned int u,v,Msc_RS,q,m,n; unsigned int u,v,Msc_RS,q,m,n;
...@@ -123,7 +116,7 @@ void generate_ul_ref_sigs_rx(void) ...@@ -123,7 +116,7 @@ void generate_ul_ref_sigs_rx(void)
for (u=0; u<30; u++) { for (u=0; u<30; u++) {
for (v=0; v<2; v++) { for (v=0; v<2; v++) {
qbar = ref_primes[Msc_RS] * (u+1)/(double)31; qbar = ref_primes[Msc_RS] * (u+1)/(double)31;
ul_ref_sigs_rx[u][v][Msc_RS] = (int16_t*)malloc16(2*sizeof(int16_t)*dftsizes[Msc_RS]); ul_ref_sigs_rx[u][v][Msc_RS] = (int16_t *)malloc16(2*sizeof(int16_t)*dftsizes[Msc_RS]);
if ((((int)floor(2*qbar))&1) == 0) if ((((int)floor(2*qbar))&1) == 0)
q = (int)(floor(qbar+.5)) - v; q = (int)(floor(qbar+.5)) - v;
...@@ -131,7 +124,7 @@ void generate_ul_ref_sigs_rx(void) ...@@ -131,7 +124,7 @@ void generate_ul_ref_sigs_rx(void)
q = (int)(floor(qbar+.5)) + v; q = (int)(floor(qbar+.5)) + v;
#ifdef MAIN #ifdef MAIN
printf("Msc_RS %d (%d), u %d, v %d -> q %d (qbar %f)\n",Msc_RS,dftsizes[Msc_RS],u,v,q,qbar); printf("Msc_RS %u (%d), u %u, v %u -> q %u (qbar %f)\n",Msc_RS,dftsizes[Msc_RS],u,v,q,qbar);
#endif #endif
for (n=0; n<dftsizes[Msc_RS]; n++) { for (n=0; n<dftsizes[Msc_RS]; n++) {
...@@ -159,7 +152,7 @@ void generate_ul_ref_sigs_rx(void) ...@@ -159,7 +152,7 @@ void generate_ul_ref_sigs_rx(void)
// These are the sequences for RB 1 // These are the sequences for RB 1
for (u=0; u<30; u++) { for (u=0; u<30; u++) {
ul_ref_sigs_rx[u][0][0] = (int16_t*)malloc16(2*sizeof(int16_t)*dftsizes[0]); ul_ref_sigs_rx[u][0][0] = (int16_t *)malloc16(2*sizeof(int16_t)*dftsizes[0]);
for (n=0; n<dftsizes[0]; n++) { for (n=0; n<dftsizes[0]; n++) {
ul_ref_sigs_rx[u][0][0][n<<1] = (int16_t)(floor(32767*cos(M_PI*ref12[(u*12) + n]/4))); ul_ref_sigs_rx[u][0][0][n<<1] = (int16_t)(floor(32767*cos(M_PI*ref12[(u*12) + n]/4)));
...@@ -169,21 +162,17 @@ void generate_ul_ref_sigs_rx(void) ...@@ -169,21 +162,17 @@ void generate_ul_ref_sigs_rx(void)
// These are the sequences for RB 2 // These are the sequences for RB 2
for (u=0; u<30; u++) { for (u=0; u<30; u++) {
ul_ref_sigs_rx[u][0][1] = (int16_t*)malloc16(2*sizeof(int16_t)*dftsizes[1]); ul_ref_sigs_rx[u][0][1] = (int16_t *)malloc16(2*sizeof(int16_t)*dftsizes[1]);
for (n=0; n<dftsizes[1]; n++) { for (n=0; n<dftsizes[1]; n++) {
ul_ref_sigs_rx[u][0][1][n<<1] = (int16_t)(floor(32767*cos(M_PI*ref24[(u*24) + n]/4))); ul_ref_sigs_rx[u][0][1][n<<1] = (int16_t)(floor(32767*cos(M_PI*ref24[(u*24) + n]/4)));
ul_ref_sigs_rx[u][0][1][1+(n<<1)]= (int16_t)(floor(32767*sin(M_PI*ref24[(u*24) + n]/4))); ul_ref_sigs_rx[u][0][1][1+(n<<1)]= (int16_t)(floor(32767*sin(M_PI*ref24[(u*24) + n]/4)));
} }
} }
} }
void free_ul_ref_sigs(void) void free_ul_ref_sigs(void) {
{
unsigned int u,v,Msc_RS; unsigned int u,v,Msc_RS;
for (Msc_RS=0; Msc_RS<34; Msc_RS++) { for (Msc_RS=0; Msc_RS<34; Msc_RS++) {
...@@ -204,9 +193,7 @@ void free_ul_ref_sigs(void) ...@@ -204,9 +193,7 @@ void free_ul_ref_sigs(void)
} }
#ifdef MAIN #ifdef MAIN
main() main() {
{
generate_ul_ref_sigs(); generate_ul_ref_sigs();
generate_ul_ref_sigs_rx(); generate_ul_ref_sigs_rx();
free_ul_ref_sigs(); free_ul_ref_sigs();
......
This diff is collapsed.
This diff is collapsed.
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