This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

FFT filter code for Sam4s2a

The below code is FFT filter code for SAM4SD32C

 

"<

uint32_t ifftFlag = 0;
uint32_t doBitReverse = 1;
uint32_t fftSize = 1024;

#define TEST_LENGTH_SAMPLES 2048

 

for(xt=0;xt<2048;xt++)
            {
                mt[xt] =  adc_get_channel_value(ADC, ADC_CHANNEL_0);

               testInput_f32_10khz[xt] =(0.6-((float)mt[xt]/4100.00))*16.00;
                delay_us(10);
                
        
            arm_cfft_f32(&arm_cfft_sR_f32_len1024, testInput_f32_10khz, ifftFlag, doBitReverse);
            arm_cmplx_mag_f32(testInput_f32_10khz, testOutput, fftSize);
            arm_max_f32(testOutput, fftSize, &maxValue, &testIndex);
            maxi = maxValue;
            printf("Maxi %d test Index %d\n",maxi,testIndex);
        
        }

>"

 

I trying to work out the same code in SAM4S2A controller

 

But the output values maxi and testIndex are changing.Due to this output is not as getting and testIndex value is getting 0.

 

can any one help me out to resolve the issue.

Parents
  • You need to give more information!

    For a start, you haven't shown the definitions of maxi and testIndex

    the output values maxi and testIndex are changing

    Is that not what you expect?

    If they never changed, why would you bother calculating them? Just use constants!

Reply
  • You need to give more information!

    For a start, you haven't shown the definitions of maxi and testIndex

    the output values maxi and testIndex are changing

    Is that not what you expect?

    If they never changed, why would you bother calculating them? Just use constants!

Children
No data