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.

TLV320AIC3262: AGC is not working for digital microphone input

Part Number: TLV320AIC3262

I have a digital MEMS microphone connected to GPI1 on the TLV320AIC3262.

I'm trying to apply automatic gain control (AGC) to normalise the captured speech to amplify when it's quiet or to reduce when it's peaking/clipping.

The problem is that my AGC configuration (PPS file attached) is having no effect at all.

If you open the example audio files attached in Audacity you can see the AGC isn't modifying the audio level.

Example 1 = quiet 1khz reference tone with changing amplitude; the AGC does not amplify;

Example 2 = loud spoken word, the AGC does not reduce gain;

What is wrong with the AGC configuration? Why does it not adjust the gain to the given target level? Is it not applying to GPI1?

7167.base_main_Rate48.cfg

Thanks.

  • Hi David,

    Could you please share the process flow file (*.pfw or *.pfz), along with the PurePath Console version ? The cfg file is for configuring the device memory and registers and it does not contain component level configuration information.

    Regards,
    Diljith M. Thodi
  • Hi David,

    I’ve sent you a message to share your files with me privately, in case you had apprehensions on sharing them in the forum.
    We’ll discuss more once I review your files.

    Regards,
    Diljith M. Thodi
  • Hello Diljith,

    Thanks for your quick reply.

    I have attached the .pfw file (remove the extra .cfg file extension).

    We are not using a PurePath Console but the PurePath Studio version is "5.95 build 1 revision 35815, Component Library Version 6738".

    After we have loaded the base_main_Rate48.cfg file, we load the epilogue.cfg.

    It appears that the AGC configuration is applying a uniform 16dB of gain, which is insufficient gain for quiet voices while introducing distortion for loud voices.

    What we want to achieve is a consistent audio level whether the person is speaking quietly or loudly, and whether they are speaking close or far from the microphone.

    2678.epilogue.cfg

    codec.pfw.cfg

    1423.base_main_Rate48.cfg

  • Hello David,

    Thanking you for sharing the process flow and the test files.

    The test files that you sent, had a clear negative DC offset. In the process flow setting I can see that you have used a Biquad with a HPF setting of 300 Hz.

    The HPF should have removed the DC offset if the recorded signal had passed through this processing chain.

    I suspect that the TI EVM was not the selected Sound Card while performing the recording. The recording was probably done with the PC's in-built microphone.

    As shown in attached file, TI EVM (USB-miniEVM) should be selected as the default device in the Recording Tab. The sampling rate property should be set to 48000 KHz.

    Could you please check and let us know if the Sound Card settings are proper?

    Regards,

    Diljith

  • Hello Diljith,

    Apologies, those two recordings were captured before we applied the DC offset filter.

    I'll re-load the configuration on our device and capture some new recordings.

    But please note we still see the same problem with the AGC only applying a fixed gain even when the DC offset filter is applied.

    Thanks.
  • Hello Diljith,

    Attached are two new audio files which were captured with the exact configuration files previously supplied.

    It's particularly visible in the sine wave recording that the AGC isn't adjusting the gain when the amplitude of the signal through the microphone increases/falls.

    Thanks.

  • https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/6/codec_5F00_agc_5F00_test.7z

    Hello David,

    Thank you for sharing the files. I would need a few more inputs from your side to examine this issue further.

    I have attached a slightly modified version of your process flow. The only modification is that it routes the AGC input on the right I2S channel so that both the AGC output and input can be captured simultaneously.

    Could you use the modified flow, repeat the sine test and loud-sound test and send me the recordings ?

    Regards,

    Diljith M. Thodi

  • Hello Diljith,

    I have applied your configuration and taken two new records, attached below:

  • Hello David,

    Thank you sharing the results with the modified process flow.

    With respect to the output file that you uploaded, Sin1000Hz_AGC_OnlyOnLeftChannel.mp3, I can see that the left channel has low level audio with peaks around -24 dB. The output levels in the right channel are higher and the peak level is around 0.5 (or -6 dB).

    The programmed settling value of AGC_DESIRED_THRESHOLD in the AGC component is 0.5. Please refer to graphic. The settling behavior of the signal in the right channel is also at 0.5. This resembles the expected behavior of the AGC. In the process flow that I shared, the left channel recording should have contained the AGC output and the right channel should have contained the AGC input. Therefore the indications are that there is channel swap in the file that you have shared. If we assume a channel swap, then the AGC appears to be settling at the correct level.

    I also ran a separate experiment using the left channel as input and passed it through the AGC and the output file envelope matches the envelope of the right channel. Therefore, I request you to check if there is a swap in the channel assignments in your recording software.

    Regards,

    Diljith M. Thodi

  • Hello David,

    I haven’t heard back from you, I’m assuming you were able to resolve your issue. If not, just post a reply below. If thread is closed, please create a new thread.

    Regards,
    Diljith M. Thodi