AnsweredAssumed Answered

FIR Accelerator 21489, errata?

Question asked by AntonioJ on Oct 3, 2014
Latest reply on Jan 16, 2015 by Mitesh



I am trying to implement a simple FIR filter using the accelerator. However there are two things that I observe that do not match the description in the datasheet.


I am trying to implement this filter in the process_audio() function, which is called periodically at the sample rate of the application.

I am trying to filter in a sample by sample basis, so, according to the documentation, I select a window size of 1 (W = 1). I place the new input sample in the memory location pointed by IIFFIR (which is x[n – (N – 1)] according to the Processor HW Ref). This is a single rate filter so, after running the filter, I expect the IIFFIR to be IIFIR+W.  (IIFIR+1) in my case, as stated in the documentation. I find that if I select W=1 in the FIRCTL2 (in the TCB), the actual IIFIR is incrementing in 2s, if I select W=0 in this register, IIFIR increments by 1, which is what I need to use this value as a pointer to the delay line. I need some clarifying on this. Is the documentation wrong?

I also find that the output from the filter is slightly wrong. When I test the impulse response, I observe that the last coefficient coming out first, and then the rest of the coefficients starting by C[0] (look at the attached plot. 0.9 is the last coefficient, C[0] is 0.1, C[1] is 0.2, C[2] is -0.3). I would like to know if there are any mistakes in my code or whether the accelerator does not work as described. Your help is much appreciated.






Here's the code:

#define TAPS_15k 92

#define WINDOW_15k 1


float pm coeffs_filt15k[TAPS_FILT15K] = {

#include "FILTER15KCOEFFS.dat"









… … … (impulse response of the filter)










float output_filt15kR[92];

float dm input_filt15kR[92];




int FIR_TCB_RIGHT_0[13]={

                           0,// CP              = Chain pointer register

                           92,// CC/CL   = Coefficient buffer length register

                           -1,// CM             = Coefficient modifier register

                           coeffs_filt15k+91,   // CI = Cofficient index refister

                           output_filt15kR,// OB       = Ouput data base register

                           1,// OL/OC     = Output buffer length register

                           1,     // OM = Output modifier register

                           output_filt15kR,// OI              = Output data index register

                           input_filt15kR,// IB       = Input data base register

                           92,    // IL/IC = Input buffer length register

                           1,     // IM = Input buffer modifier register

                           input_filt15kR,// II = Input data index register

                           TAPS|WINDOW// IIRCTL= Channel control register, no of TAPS = 92, WINDOW SIZE=1



Void process_audio()


//In_Buf[testCounter] = In_Buf2[testCounter];


       myPointer = FIR_TCB_RIGHT_0[11] | 0x80000;

       //myPointer = TCB_Buf[11] | 0x80000;

       *myPointer = In_Buf2[testCounter];


       /*Selecting FIR accelerator */




       /*PMCTL1 effect latency*/



       temp = (TAPS_15k-1);//|WINDOW_15k;

       FIR_TCB_RIGHT_0[12] = temp; /* Value of FIRCTL2;*/


       temp = (int)FIR_TCB_RIGHT_0+12;

       *pCPFIR= temp;



       /* Set the values for FIRCTL1*/


       temp = FIR_CH1|FIR_EN| FIR_DMAEN ;


       *pFIRCTL1 = temp;  /* Enables and runs the DMA*/


       /* Test if the window is processed*/


       while ((*pFIRDMASTAT & FIR_DMAWDONE)==0);