Hi there,
I am using the Fixed point FIR filter library provided by TI on F28069.
The filter I have is a BPF fir16 with order of 16 and it is working great but the problem I have is that it's taking longer than what's specified in the filter library document.
I am referring to the "C28x Fixed Point DSP Library" v1.01 written on 10th Jan 2011. On the page 32 it has a Benchmark information with a table showing how many cycles of instruction it takes for a different number of taps.
As I'm using 16 taps, I expected my fir calculation to take 58 cycles, which is 644ns at 90MHz. However, it's taking approx. 1.1us, nearly double the expected time. The way I've measured the time is by toggling a GPIO before the fir calculation and toggling the GPIO after the fir calculation has been done.
Could someone please explain to me why the FIR calculation takes so much longer than the specification?
Thanks
Ayaka
#include <fir.h>
/* FIR16 coefficients (fir_16o_400k) FIR16 BP order=16 Hamming Fs=400000Hz Fc=5000-80000Hz {-126,11,189,-298,-1815,-2091,1990,8979,12563,8979,1990,-2091,-1815,-298,189,11,-126,} */ #define FIR_ORDER_RX 16 #define RX_COEFF {\ 12563,-8248557,722886,12449749,-19466007,-118882602,-137035587,130416651,588513154}
#define FIR_ORDER_SIZE ((FIR_ORDER_RX+2)/2) #pragma DATA_SECTION(alRxBuf,"firRx"); long alRxBuf[FIR_ORDER_SIZE]; /* Define Constant Co-efficient Array (used for Tx and Rx and place the .econst/.const section in non-volatile memory */ const long RxCoeff_const[FIR_ORDER_SIZE]= RX_COEFF; long RxCoeff[FIR_ORDER_SIZE]; #define FIR_ORDER FIR_ORDER_RX FIR16 fir_rx = FIR16_DEFAULTS; void init_filter(void) { fir_rx.dbuffer_ptr = alRxBuf; fir_rx.coeff_ptr=(long *)RxCoeff; fir_rx.order=FIR_ORDER; fir_rx.init(&fir_rx); } void process_task(int sample) { GpioDataRegs.GPATOGGLE.bit.GPIO31 = 1; fir_rx.inpunt = sample; fir_rx.calc(&fir_rx); GpioDataRegs.GPATOGGLE.bit.GPIO31 = 1; }