Post Go back to editing

ADAU1452 FIR TAP count

Category: Software
Product Number: ADAU1452

Hello All,

I was wondering, if I have programmed a DSP application, containing a FIR with 6000 taps, is it allowed that I change the tap count afterwards in, for example, 300 and upload 300 new coëfficients? (using the SPI control port).

Basically, I upload a DSP application in which I reserve room for 6000 taps, but want to upload any FIR afterwards, with a maximum of 6000 taps

with kind regards,

Reini

  • Hello Reini,

    Nice to hear from you! 

    I tried to think of some other ways to do this but the only real solution I have is to create the 6000 tap filter. Then if you load in 300 new coefficients you will have to zero out all the others over 300 so all the 5,700 coefficients are all zeros. So the filter will work as designed. 

    If you setup a 6000 tap filter then all 6000 taps will be calculated every sample period. No way around that. it will burn a lot of MIPS. 

    Dave T

  • Thank you Dave.

    I already reserved 6000 taps, and will zero out the unused taps. I'm a little embarrassed that I didn't thought that out myself haha I will give it a try! It was because of the COUNT parameter in the ...PARAM.h that put me on the wrong track:

    /* Module INPUT_FIR - FIR Filter*/
    #define MOD_MIXER_INPUT_FIR_COUNT                      6000
    #define MOD_MIXER_INPUT_FIR_DEVICE                     "IC2"
    #define MOD_MIXER_INPUT_FIR_ALG0_FIRSIGMA300ALG1FIRCOEFF0_ADDR 80
    #define MOD_MIXER_INPUT_FIR_ALG0_FIRSIGMA300ALG1FIRCOEFF0_VALUE SIGMASTUDIOTYPE_8_24_CONVERT(0)
    #define MOD_MIXER_INPUT_FIR_ALG0_FIRSIGMA300ALG1FIRCOEFF0_TYPE SIGMASTUDIOTYPE_8_24

    Because of MOD_MIXER_INPUT_FIR_COUNT, I thought it was possible to change the amount of taps during runtime. But now I am writing this, I see that COUNT has no register address, so I should have known myself that it was not possible. Sorry for my mistake!

    With kind regards,

    Reini

  • Hello Reini,

    No problem, you made me feel helpful that I can make a suggestion. Slight smile

    I also looked for a parameter for the FIR filter length. I looked at the Filter Pool block and it has a parameter for the filter length but I think it is only used as an index to the next filter and it is not used internally for the counter loop. I think the reason is that the code is somewhat complex in that it figures out how to take advantage of the Quad MAC to combine four multiplies where it can so they can be done in one instruction. So the number of times through the loop depends on how many times it can perform four taps in one instruction. 6,000 is a good number because it evenly divides by four so the 6000 taps are calculated using 1500 instructions. 

    Dave T

  • Thanks again Dave! and check! The compiler shows 1507 cycles to be precise, probably 7 cycles to move the sample in and out the FIR :-)

  • Hello Reini,

    Yes, exactly, there are a few instructions for overhead to set it up and move the results. But once the FIR calculations starts the core is blazing! Slight smile

    Dave T