compute_bf_weights.c 1.43 KB
Newer Older
1 2
#include <stdio.h>
#include <stdint.h>
3
#include <stdlib.h>
4 5 6 7 8
#include "PHY/impl_defs_lte.h"

int f_read(char *calibF_fname, int nb_ant, int nb_freq, int32_t **tdd_calib_coeffs){

  FILE *calibF_fd;
9
  int i,j,calibF_e;
10 11 12 13 14 15 16 17
  
  calibF_fd = fopen(calibF_fname,"r");
 
  if (calibF_fd) {
    printf("Loading Calibration matrix from %s\n", calibF_fname);
  
    for(i=0;i<nb_ant;i++){
      for(j=0;j<nb_freq*2;j++){
18
        if (fscanf(calibF_fd, "%d", &calibF_e) != 1) abort();
19 20 21 22 23 24 25
        tdd_calib_coeffs[i][j] = (int16_t)calibF_e;
      }
    }
    printf("%d\n",(int)tdd_calib_coeffs[0][0]);
    printf("%d\n",(int)tdd_calib_coeffs[1][599]);
  } else
   printf("%s not found, running with defaults\n",calibF_fname);
26 27
  /* TODO: what to return? is this code used at all? */
  return 0;
28 29 30 31 32
}


int estimate_DLCSI_from_ULCSI(int32_t **calib_dl_ch_estimates, int32_t **ul_ch_estimates, int32_t **tdd_calib_coeffs, int nb_ant, int nb_freq) {

33 34
  /* TODO: what to return? is this code used at all? */
  return 0;
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

}

int compute_BF_weights(int32_t **beam_weights, int32_t **calib_dl_ch_estimates, PRECODE_TYPE_t precode_type, int nb_ant, int nb_freq) {
  switch (precode_type) {
  //case MRT
  case 0 :
  //case ZF
  break;
  case 1 :
  //case MMSE
  break;
  case 2 :
  break;
  default :
  break;  
}
52 53
  /* TODO: what to return? is this code used at all? */
  return 0;
54 55 56
} 

// temporal test function
57
/*
58 59 60 61
void main(){
  // initialization
  // compare
  printf("Hello world!\n");
62 63
}
*/