Commit 79e8653f authored by Xiwen JIANG's avatar Xiwen JIANG

add read_F.c to openairinterface1/PHY/TOOLS

parent 47634381
#include<stdio.h>
#include<stdint.h>
int f_read(char *calibF_fname, int nb_antM, int nb_freq, int16_t (*calibF_mtx)[nb_freq*2]){
FILE *calibF_fd;
int i,j,l,calibF_e;
calibF_fd = fopen(calibF_fname,"r");
if (calibF_fd) {
printf("Loading Calibration matrix from %s\n", calibF_fname);
for(i=0;i<nb_antM;i++){
for(j=0;j<nb_freq*2;j++){
fscanf(calibF_fd, "%d", &calibF_e);
calibF_mtx[i][j] = (int16_t)calibF_e;
}
}
printf("%d\n",(int)calibF_mtx[0][0]);
printf("%d\n",(int)calibF_mtx[1][599]);
} else
printf("%s not found, running with defaults\n",calibF_fname);
}
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