D-Tech

Exporting Custom FIR filter to no-OS

Discussion created by D-Tech on Aug 27, 2017
Latest reply on Aug 27, 2017 by DragosB

I've used the filter wizard to generate a custom FIR filter for the AD9361:

 

AD9361_RXFIRConfig rx_fir_config = {
 3, // rx
 -12, // rx_gain
 1, // rx_dec
 {1679,-2836,3272,-4644,710,-5675,-2502,-5888,-2647,-2306,2681,6305,12324,16757,21036,23017,23017,21036,16757,12324,6305,2681,-2306,-2647,-5888,-2502,-5675,710,-4644,3272,-2836,1679,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // rx_coef[128]
 32, // rx_coef_size
 {983040000,245760000,122880000,61440000,61440000,61440000}, // rx_path_clks[6]
 4303447 // rx_bandwidth
};

AD9361_TXFIRConfig tx_fir_config = {
 3, // tx
 -6, // tx_gain
 1, // tx_int
 {852,-1683,1312,-2978,-710,-4068,-2769,-4174,-2106,-791,3130,6858,11806,15905,19449,21231,21231,19449,15905,11806,6858,3130,-791,-2106,-4174,-2769,-4068,-710,-2978,1312,-1683,852,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // tx_coef[128]
 32, // tx_coef_size
 {983040000,245760000,122880000,61440000,61440000,61440000}, // tx_path_clks[6]
 3765501 // tx_bandwidth
};

 

I assume I just replace what's in main.c with the above? I noticed that the rx and tx path clocks are all 0 in the default fir config structures. Why the difference? Here is the default rx:

 

AD9361_RXFIRConfig rx_fir_config = { // BPF PASSBAND 3/20 fs to 1/4 fs
 3, // rx
 0, // rx_gain
 1, // rx_dec
 {-4, -6, -37, 35, 186, 86, -284, -315,
  107, 219, -4, 271, 558, -307, -1182, -356,
  658, 157, 207, 1648, 790, -2525, -2553, 748,
  865, -476, 3737, 6560, -3583, -14731, -5278, 14819,
  14819, -5278, -14731, -3583, 6560, 3737, -476, 865,
  748, -2553, -2525, 790, 1648, 207, 157, 658,
  -356, -1182, -307, 558, 271, -4, 219, 107,
  -315, -284, 86, 186, 35, -37, -6, -4,
  0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0}, // rx_coef[128]
  64, // rx_coef_size
  {0, 0, 0, 0, 0, 0}, //rx_path_clks[6]
  0 // rx_bandwidth
};

Outcomes