This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TLV320AIC3111EVM-K: Changing the filter coefficients during runtime

Part Number: TLV320AIC3111EVM-K
Other Parts Discussed in Thread: TLV320AIC3111

We are using the TLV320AIC3111 to filter and amplify an audio signal that is coming in through the EXT_MIC_IN (J7) and play the filtered signal simultaneously on the HP, speaker and I2S output.
Based on user input, we need to set different filter coefficients, to filter out different kinds of data from the audio stream. We need to do this while the program is running on the board, without the need to disconnect, change the program and reconnect and re download. Is there any way this can be done? Eventually we shall be using an external microcontroller over the I2C which shall control the EVM.

Thanks and Regards, 

Souvik.

  • Souvik, 

    Yes, you can use the Adaptive filtering control.  There are two sets of filter coefficients,  A and B.  page 8 register 1 enables the adaptive filtering for the DAC,  and allows you to switch between the A and B coefficients.  while the A coefficients are in use,  the B coefficients can be written to,  once the B coefficients are written then D0 can be written to,  and it will switch active coefficients to B.  Then the A coefficients can be written to. 

    best regards,

    -Steve Wilson

  • Hello Steve, 

    Thank you for your response. How do I write to these two sets of filter coefficients? It'll be helpful if you provided a reference or an example.

    Regards,

    Souvik

  • Souik,

    The following is copied from a design guide for the AIC3254,  but I"ve changed the register numbers.  

    Using adaptive filtering:

    For applications where filter coefficients are changed on the fly, such as bass-boost and treble-boost, adaptive filtering must be used; both buffers are required. Follow this simplified procedure for such a case.

    page8image3353071792

    Step 1: Enable Adaptive Filtering.

    Step 2: Write filter coefficients to DAC Buffer A and DAC Buffer B (exact copy). This step is not necessary if using default coefficients (all-pass).

    Step 3.Power up DAC(s). At this moment, audio can start playing.

    Step 4.To modify the frequency response, write new filter coefficients to the Buffer A address(starting at page 8).

    Step 5 Switch buffers by writing a '1' to Page 8 / Register 1 / Bit D0.

    Step 6. Rewrite the exact same coefficients to the Buffer A address (starting at page 8. This step ensures that both buffers are synchronized.

    -----------------------

    Writing Filter coefficients:

    # High-pass second order Butterworth filter,
    # fc = 400 Hz
    ###############################################
    #
    # BIQUAD A, Left Channel (Page 44, Register 12, C1-C5)
    w 30 00 08
    w 30 02 7F BD 80 43 7F BD 7F BC 80 85
    #
    # BIQUAD A, Right Channel (Page 45, Register 20, C33-C37)
    w 30 00 08
    w 30 42 7F BD 80 43 7F BD 7F BC 80 85
    #
    #
    ############################################### #
    

    best regards,

    -Steve Wilson

  • Hello Steve, 

    Thanks for your help. From what I'm understanding is you're directly writing to the registers responsible for storing the coefficients.
    However, will that need any changes in my Process Flow Diagram? I already have a Biquad filter being used and its' target processor is miniDSP A. Would I need to change it to miniDSP D? And if I'm doing so, using the Biquad tool on the GDE will write to the same registers right? How can I use the commands you have suggested with the biquad filter block?

    Thanks and Regards,
    Souvik.

  • Souvik, 

    Take a look at this application report

    For the AIC3111 only the DAC filters can be changed on the fly:

    There are two sets of registers,  and you simply program accordingly. The Mini DSP will program Buffer A,  and you can program Buffer B.  Switch the buffers as I explained above. 

    best regards,

    -Steve Wilson