AnsweredAssumed Answered

21375 EZ kit block based talkthru(C),FIR make a noise!

Question asked by Sunnyhgh on Oct 30, 2015

Hi:

  I'm  new for dsp.When  dsp perform fir process in excample " block based talkthru(C)"on the 21375 EZ  board,fir make a noise!

here is my code:

 

======SPORT0 interrupt ISR=============

// SPORT0 ADC DMA ISR

void TalkThroughISR(int sig_int) /* No argument is passed in this ISR */

{

  //Increment the block pointer

if(isProcessing)ProcessingTooLong();

    int_cntr++;

    int_cntr %= 3;

    blockReady = 1;

}

 

============================

 

// DMA RX/TX buffer array samples

#define NUM_SAMPLES 384

// FIR TAPS

#define TAPS  83

#define DL  ((TAPS-1)/2)

#define N (NUM_SAMPLES/2+DL )

///////////////// FIR INPUT ARRAY//////////

/*

           N0.  0          1           2          3     .....   191        192   193  194    233

adinputL[ DATA0, DATA1, DATA2, DATA3....,DATA191,  0,      0,      0....,0 ]

           N0.   0          1           2  .....    40(DL)    41         42       43           44           233

adinputR[ "invalid","invalid","invalid",....."invalid",DATA0, DATA1, DATA2, DATA3....,DATA191]

*/

 

 

//FIR input L

float adinputL[N];

//FIR  output L

float adoutputL[N];

//FIR input R

float adinputR[N];

//FIR  output R

float adoutputR[N];

// FIR  states

float adstateL[TAPS+1];

float adstateR[TAPS+1];

// FIR  coeffs

float pm adcoeffs[TAPS]={

  -0.000403038195722,7.129271485026e-19,0.0004522593913585, 0.000761363609974,

  0.0007434622863051,0.0003094515963677,-0.0004442989071892,-0.001205202031486,

  -0.001534621077612,-0.001081448704452,0.0001678836573597, 0.001753810988894,

  0.002855118076214, 0.002664598363695,0.0008806529073619, -0.00195388951795,

  -0.004519403955275,-0.005269625469738,-0.003268848605737, 0.001101928378573,

  0.006016016776022, 0.008867545545789, 0.007545053831489, 0.001734700999099,

  -0.00647021389647, -0.01314835726836, -0.01426439863309,-0.007835843180117,

  0.004512188464698,  0.01755834878578,  0.02438698214213,  0.01959828726337,

  0.002481210944641, -0.02141101045025, -0.04132638701527, -0.04497487457391,

  -0.02353071250617,  0.02404398954612,  0.08930034378228,  0.1562204820565,

    0.2062782787256,  0.2248164317383,  0.2062782787256,  0.1562204820565,

    0.08930034378228,  0.02404398954612, -0.02353071250617, -0.04497487457391,

  -0.04132638701527, -0.02141101045025, 0.002481210944641,  0.01959828726337,

    0.02438698214213,  0.01755834878578, 0.004512188464698,-0.007835843180117,

  -0.01426439863309, -0.01314835726836, -0.00647021389647, 0.001734700999099,

  0.007545053831489, 0.008867545545789, 0.006016016776022, 0.001101928378573,

  -0.003268848605737,-0.005269625469738,-0.004519403955275, -0.00195388951795,

  0.0008806529073619, 0.002664598363695, 0.002855118076214, 0.001753810988894,

  0.0001678836573597,-0.001081448704452,-0.001534621077612,-0.001205202031486,

  -0.0004442989071892,0.0003094515963677,0.0007434622863051, 0.000761363609974,

  0.0004522593913585,7.129271485026e-19,-0.000403038195722

};

 

============Blocks FIR process ===================

 

/* Place the audio processing algorithM here. The input and output are given

  as unsigned integer pointers.*/

void processBlock( int *block_ptr)

{

  volatile int i;

    int temp_out;

    isProcessing = 1;

    /*Clear the Block Ready Semaphore*/

    blockReady = 0;

 

    for(i=0;i<NUM_SAMPLES/2;i++)

    {

      *(adinputL+j)= __builtin_conv_RtoF((*(block_ptr+2*i)));

    *(adinputR+j)= __builtin_conv_RtoF((*(block_ptr+2*i+1)));

    }

  // FIR process .


    fir (adinputL,adoutputL,adcoeffs,adstateL,N,TAPS);

    fir (adinputR,adoutputR,adcoeffs,adstateR,N,TAPS);

 

    for(i=0;i<NUM_SAMPLES;i+=2)

    {

      (*(block_ptr+2*i ))=__builtin_conv_FtoR(*(adoutputL+DL+j));

      (*(block_ptr+2*i+1))=__builtin_conv_FtoR(*(adoutputR+DL+j));

    }

    /*Set the Processing Active Semaphore before starting processing*/

    isProcessing=0;

}

NOISE:

QQ截图20151027125538.png

And what I have to do with this problem?

Outcomes