How to use cfftf (filter.h) correctly on a SHARC 21569?


Recently I work on a program with SHARC 21569 in which fast fourier transform is needed. I choose to use cfftf included in filter.h because I have used to it correctly on a SHARC 21489. BUT, the function cfftf can't get the right result on SHARC 21569, I can't understand the reason. 

Is there anyone tell me how to use cfftf correctly on a SHARC 21569?

Thanks very much!


  • +1
    •  Analog Employees 
    on Apr 29, 2020 5:47 PM 7 months ago

    One reason for the failure could be that for ADSP-21569, 8-bit (byte) addressing is enabled by default, whereas ADSP-21489 only supports 32-bit (word) addressing. (ADSP-21569 also supports 32-bit addressing mode, but it is not the default.) This has an impact on CCES features such as "pragma align" which will align in bytes rather than words on ADSP-21569 in byte-addressing mode. When  building for ADSP-21569 in byte-addressing mode, the values using in "pragma align" should be multiplied by 4. We would recommend changing any pragma align commands to something similar to this:

    #define FFT_SIZE 1024
    #if defined(__BYTE_ADDRESSING__)
      #define ALIGN_OPT (FFT_SIZE * 4)
      #define ALIGN_OPT (FFT_SIZE)
    #pragma align ALIGN_OPT
    float dm input_r[FFT_SIZE];

    This will ensure that the alignment is correct, regardless of the processor you are targeting, or whether you are using byte-address or word-addressing mode on the ADSP-21569.

    The description of the cfftf function in CCES Help does not make this clear. It will be updated in a future release.