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.

TAC5111: How to eliminate background noise and avoid audio distortion

Part Number: TAC5111

Tool/software:

Dear Experts:

When I try to increase the codec gain via amixer, the background noise also becomes noticeably louder, and distortion occurs when the volume is high.

Therefore, I would like to understand how to increase the codec gain while avoiding an increase in background noise and preventing audio distortion

Thank you!

  • Hi,

    I assume you are talking about ADC gain and not DAC, but please let me know if this is wrong. Generally, if gain (or volume) is increased, then this will raise the signal level for all input uniformly, including background noise and the intended subject level, and so we will see an increase in the noise level by the gain amount in dB as well as the subject level until the upper signal limit is exceeded and we see clipping which is heard as distortion. To help mitigate this, I would first suggest that you make sure your microphone is as close as possible to the subject, facing the correct direction to avoid as much background noise in the acoustic space. Next, we can adjust the codec input gain. There is a feature on many of our devices with ADC including the TAC5111 that is called AGC or automatic gain control. With the AGC, you can set a threshold level at which you always want your subject, and the device will increase the gain until the input volume matches the intended dBFS, and decreases the gain when it exceeds it to avoid clipping. You can also set a noise threshold, which is the level at which the input signal is considered noise, and the gain will be reduced. When the signal is above this noise threshold, it will activate this automatic gain increase, so you will still hear an increase in the noise level. Please look at section 7.3.9.1.9 in the datasheet for an explanation of the AGC in the TAC5111. Let me know if you need anything better clarified here.

    Best,

    Mir

  • hi,Jeffres

    Yes, I am talking about ADC gain.  Setting a threshold  for AGC which will raise the signal level for all input uniformly, including background noise, right?

     is there a way to filter the background noise ? such as filter out noise at certain frequencies by configuring registers

    Best Regards

    Gene

  • Hi Gene,

    Yes, if your noise is at specific frequencies, you can implement up to 3 biquad filters on each ADC channel. You can read more about the biquad filters in this app note: www.ti.com/lit/ab/slaaeh6/slaaeh6.pdf

    Best,
    Mir

  • Hi Jeffres

        I found the tac5111 biquad filters not take effect,  I use the TIBQ calculator tool  to generate the Coefficients  and write to register, please help check it 

    below is the command for channel 1;

    i2cset -f -y 4 0x50 0x00 0x08
    #N0
    i2cset -f -y 4 0x50 0x08 0x25
    i2cset -f -y 4 0x50 0x09 0x7C
    i2cset -f -y 4 0x50 0x0A 0xEC
    i2cset -f -y 4 0x50 0x0B 0xB2
    #N1
    i2cset -f -y 4 0x50 0x0C 0x25
    i2cset -f -y 4 0x50 0x0D 0x7C
    i2cset -f -y 4 0x50 0x0E 0xEC
    i2cset -f -y 4 0x50 0x0F 0xB2
    #N2
    i2cset -f -y 4 0x50 0x10 0x25
    i2cset -f -y 4 0x50 0x11 0x7C
    i2cset -f -y 4 0x50 0x12 0xEC
    i2cset -f -y 4 0x50 0x13 0xB2

    #D1
    i2cset -f -y 4 0x50 0x14 0x00
    i2cset -f -y 4 0x50 0x15 0x00
    i2cset -f -y 4 0x50 0x16 0x00
    i2cset -f -y 4 0x50 0x17 0x00

    #D2
    i2cset -f -y 4 0x50 0x18 0xEA
    i2cset -f -y 4 0x50 0x19 0x0C
    i2cset -f -y 4 0x50 0x1A 0x4D
    i2cset -f -y 4 0x50 0x1B 0x35

    #N0
    i2cset -f -y 4 0x50 0x58 0x6C
    i2cset -f -y 4 0x50 0x59 0x58
    i2cset -f -y 4 0x50 0x5A 0x2E
    i2cset -f -y 4 0x50 0x5B 0xEC
    #N1
    i2cset -f -y 4 0x50 0x5C 0x93
    i2cset -f -y 4 0x50 0x5D 0xA7
    i2cset -f -y 4 0x50 0x5E 0xD1
    i2cset -f -y 4 0x50 0x5F 0x14
    #N2
    i2cset -f -y 4 0x50 0x60 0x6c
    i2cset -f -y 4 0x50 0x61 0x58
    i2cset -f -y 4 0x50 0x62 0x2E
    i2cset -f -y 4 0x50 0x63 0xEC

    #D1
    i2cset -f -y 4 0x50 0x64 0x6A
    i2cset -f -y 4 0x50 0x65 0xD3
    i2cset -f -y 4 0x50 0x66 0xA3
    i2cset -f -y 4 0x50 0x67 0x9A

    #D2
    i2cset -f -y 4 0x50 0x68 0xA4
    i2cset -f -y 4 0x50 0x69 0x46
    i2cset -f -y 4 0x50 0x6A 0x8B
    i2cset -f -y 4 0x50 0x6B 0x81

    i2cset -f -y 4 0x50 0x00 0x00
    i2cset -f -y 4 0x50 0x72 0x38

  • Hi Bert,

    Try to write the biquad coefficients to the device again using I2C 8-bit target address 0xa0 instead of 7-bit 0x50. This format includes the 7-bit device address and a R/W bit.

    Best,

    Garret

  • hi Garret

     We use linux system. I don't know whether you learn linux i2c, linux will fill the R/W bit in the driver automatically . and I also use i2cget command to read value from the register, It is also same to the write value. please help check again 

  • hi Garret

         sorry for wrong result, after verify again, actually the tac5111 biquad filters is take effect . but we found the biquad filters doesn't have much effect on background noise,  the normal voice and background noise gain both decreased or increased at same time, may be the way we used is not correct. so do you have any suggestion to use the biquad filters?

        Actuall we don‘t have a Spectrum analyser, so we don't konw the noise frequency,also we don't have much experience in noise suppression, base on your experience,  for this case, do you know common noise in the circuit? what type of filters are common used ?  

      Looking forward to your experience guidance, thanks

  • Hi Bert,

    Can you attach an audio sample or a scope shot of your signal? If you do not have a way to look at the spectrum, we can look at it digitally with an audio sample. Otherwise, it is hard to help since we are unsure about the nature of this noise you are experiencing.

    There are several stages that this noise could be appearing. First, it may be that your microphone is too far from the voice source, or there is too much noise in the room in which you are recording. In this case, try to reduce the noise in the room and place the microphone closer. Next, there may be noise injected if the signal is single-ended, or differential with the wires not wrapped around each other. I would recommend to use the ADC in a differential input mode, and wrap the + and - wires around each other so that any noise that is picked up by long wires would be cancelled out. Next, make sure that your power to the device is appropriately decoupled, this means including the suggested decoupling capacitors close to the chip on your board. Noisy power supply to the device may introduce noise on the audio signal. Are you using your own board or the EVM? If your own board, please send a schematic so we can review it. I would also be interested to see your I2C commands you are using, not just the filter registers, but all registers to configure the chip. Let me know about this.

    Best,
    Mir

  • hi Jeffres

    I have attach audio sample , codec register value, schematic file in below docx file, please help check it .  because customer required, we have to use  single-ended mode for ADC.

    to-TI.docx

    Best regards

  • Hi,

    Sorry about the delay here, I will get to you about it tomorrow.

  • Hi,

    From the audio file in this, we can see that your signal is clipping, so the gain is too high. I see in register 0x52 you have set to 29.5dB of digital gain on the ADC CH1, and I see that the AGC is disabled for this configuration.

    If we zoom in and set it to dB, we see that your noise floor is around -25dB, if the 29.5dB of gain was not present, the noise floor would be around -55dB. So, you could set the AGC to have a noise gate that kicks in around -55dB and your target level ~-12dB or so, so when your signal is detected over the noise floor, it will reach a max gain below the clipping gain value of 30dB extra. I would recommend using PPC3 to program the AGC. 

    Use PPC3 to configure the AGC here:

    Best,
    Mir

  • hi Jeffres 

        I have done as you said for AGC, but still have strong  background noise. I attach record sample in below docx file, please help check , for register 0x52 , I set it 0 dB

    to_ti_0813.docx

  • In addition, Can we use  tac5111 biquad filters to filter the background noise ?  even we open the AGC,  the background noise still increase with normal voice, does the voice and noise overlap ?

  • Hi Bert,

    Looking at your updated audio signal, many of the noise artifacts were removed, but much remained, as any noise above the -55db noise threshold is amplified by the max gain 21.5dB. It appears that with an amplified noise floor of up to -25db, your actual noise floor is around -46dB.

    I would try to increase this noise floor to eliminate more noise, possibly all the way up to -40dB, or maybe -45dB will work. Also, increasing your target level and decreasing your max gain could help to differentiate the noise further.

    Biquad filters will be difficult to implement without knowing the exact frequency of the noise, and could affect the intended input signal.

    We can close this thread and set up a meeting if further assistance or explanation is needed.

    Best,

    Garret

  • Hi Garret

    We provided schematic earlier. Could you please take a look at any improvements made to the hardware?

  • hi Garret

      after set the noise floor to  -40dB , indeed no background noise when no speaking,  but still have a little background noise when speaking ,  especially  when  the speaker is far away from the microphone, the background noise is louder.  how to solve this kind of problem? 

    Also, increasing your target level and decreasing your max gain could help to differentiate the noise further. 

    for your above comment,  I have test it, but doesn't take effect to differentiate the noise, can you explain more?  why increase target level and decrease max gain help differentiate the noise?

  • Hi Holly,

    For the hardware, I recommend AC coupling the unused inputs to GND.

    Bert,

    The target level is the level that the AGC tries to keep the input at, and the max gain is the most amplification that it will apply to get it there. By increasing the target level, you can amplify the intended signal to higher dB level, while the noise will stay the same (as it has already been amplified by the max gain). Also, the intended signal will need less gain to achieve the target level, so increasing the max gain could be only increasing the noise.

    However, the further away the speaker is from the microphone, the intended signal will fall closer to the noise floor. In this case, you would have to increase the max gain to get it up closer to the target level.

    Best,

    Garret

  • Hi Bert,

    One more note here, the background noise you hear with the speaker talking is not a codec problem, but an acoustic problem with your microphone/room. In any microphone-based system, there will be background noise unless you are in an anechoic chamber. This background noise gets amplified along with the intended speech since both sounds are present in the room. We cannot just filter it out, typically this background noise is in the human speech range as well. So, to decrease background noise in your signal compared to the speaker, you can either move the microphone closer to the subject or get a microphone that is more directional so it picks up a smaller physical range in space and is facing the speaker. There are also some noise-reducing algorithms you can try, but this is a DSP problem and typically requires a lot of processing power to do in real time, it would require a computer. We do not support a noise reduction algorithm on our audio codecs. Our codecs just convert the analog mic signal to digital data, so if the mic signal has noise, the same noise will be present in the digital domain. Our AGC has a noise gate feature that gates the signal when there is NOT a subject present, but it cannot remove the noise present in the background at the same time as the speech.

    Best,
    Mir

  • hi Jeffres && Garret

     got it,  thanks very much