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.

TLV320AIC3204: How to disable specific Biquad filter in Decimation filters.

Part Number: TLV320AIC3204

Hi,

I want to know how can I disable Biquad filter. Specifically I am using ADC Decimation Filter B for sampling audio over microphone, In that there are 3 Biquad filters. I want to disable Biquad filter C. Or is there any way to disable it, If yes then I want to disable it.

Thank you,

Kishan

  • Hi Kishan,

    I will look into this and post back next week due the the US holiday.

    Regards,

    Arthur

  • Hi Arthur,

    I am waiting for your reply, Have a happy holiday.

    Thank you,

    Kishan

  • Hello,

    We thank you for your patience.

    Best Regards,

    Carson

    LPA Applications Engineer

  • Hi,

    If it is not possible to disable Biquad Filter C, can you tell us what are the default N0, N1, N2, D1, D2 co-eff values for Biquad filter C?

    Thank you,

    Kishan

  • Hi Kishan,

    Thank you for your patience while I look into this,

    Regards,

    Arthur

  • Hi Kishan,

    I assume that you are using this below configuration.

    In order to functionally disable biquad C (Hc) you can set N0 = 2^23 (i.e write 0xff the three registers that contain this coefficient) and then set N1,N2,D1,D2 to all 0x00. 

    This will make the transfer function of this filter = 1, which will effectively bypass it.

    I hope this helps.

    Regards,

    Arthur

  • Hi Arthur,

    Thank you for the work out. I will modify the values for disabling the filter and test the audio. I will share the result with you.

    Thank you,

    Kishan 

  • Please let us know your results from this test.

    Regards,

    Arthur

  • Hi Arthur,

    I wrote 0xff in three registers of N0 coefficient but I did get blank audio means the audio was silent. The values I wrote is:

    N0  0xFFFFFF00

    N1  0x00000000

    N2  0x00000000

    D1  0x00000000

    D2  0x00000000

    Thank you,

    Kishan

  • Hi Kishan,

    I will attempt this on an EVM and report back my findings/procedure. 

    I will respond back in 3 days.

    Regards,
    Arthur

  • Hi Arthur,

    Just to inform you that I am using sampling rate is 16000 bits/sec.

    ADC_Fs = 16000Hz.

    Thank you,

    Kishan

  • Hi again Arthur,

    I have two questions.

    1. The values you shared for N0 = 0xFFFFFFL does not match with my calculation. As 2^23 equals to 8388608 in decimal and if we write in N0 = 0x800000 which is 8388608 in decimal, rest of all N1, N2, D1, D2 are all zero then the transfer function becomes 1. Can I directly write 0x800000 in N0 coefficient registers or do I need to write 2's complement of 0x800000? 

    2. When I obtain the Biquad filter values from TIBQ calculator. Can I directly write those values in the Biquad coef registers or do I need to calculate it further like dividing values or two's complement of the values then write it into the registers?

    Thank you,

    Kishan

  • Hi Kishan,

    I have not yet tested this. however you are correct you should program 0x800000.

    I don't believe this value should be 2's complement because biquad coefficients wont be negative. 

    Regarding TIBQ. the coefficients should be normalized to the 'D0' value.

    So for example when I used TIBQ it generates coefficients where D0 = 32768

    However the AIC3204 has D0 = 2^23 = 8388608

    so the coefficients from TIBQ would need to be multiplied by (8388608/32768) 256 to get the same frequency repose in AIC3204

    Regards,
    Arthur

  • Hi Arthur,

    As you said coefficients from TIBQ would need to be multiplied by (8388608/32768) 256. I think that is for the 16 bit resolution but when we use 24 bit resolution we don't need to multiply with any value. Am I right?

    I have obtained the values from TIBQ calculator:

    Text "* Sample Rate = 16000"

    Text "* Filter 1 High Pass 2nd Order Butterworth, 40 Hz Fc 0.0 dB "

    Text "* Filter 2 High Pass 1st Order Butterworth, 91 Hz Fc 0.0 dB "

    Text "* Filter 3 Low Pass 2nd Order Butterworth, 7800 Hz Fc 0.0 dB "

     

    Text "* BQ: H(z) = (N0 + 2*N1/z + N2/(z2)) / (8388608 - 2*D1/z - D2/(z2))"

    Text "* Filter Coefficients in format N0, N1, N2, D1, D2"

     

    Text "* 1O: H(z) = (N0 + N1/z) / (8388608 - D1/z)"

    Text "* Filter Coefficients in format N0, N1, D1"

     

    Text "* Filter 1 BQ "

    0x7E95FE

    0x816A02

    0x7E95FE

    0x7E93FF

    0x82D002

    Text "* Filter 2 1O "

    0x7DC0B8

    0x823F48

    0x7B8172

    Text "* Filter 3 BQ "

    0x791585

    0x791585

    0x791585

    0x871A55

    0x8D7541

    So for the Filter 2 which uses the first order biquad transfer function not the second order biquad transfer function so do I need to divide the values by 2 and then use signed two's complement of that?

    Thank you,

    Kishan

  • As you said coefficients from TIBQ would need to be multiplied by (8388608/32768) 256. I think that is for the 16 bit resolution but when we use 24 bit resolution we don't need to multiply with any value. Am I right?

    You are correct, It is simpler to just select the 24 bit resolution.

    So for the Filter 2 which uses the first order biquad transfer function not the second order biquad transfer function so do I need to divide the values by 2 and then use signed two's complement of that?

    No you dont need to do any math after the coefs' are generated (except when you are converting 16 bit ceofs into 24 bit as we discussed) these coefs are ready to program

    Where you able to disable biquad C as you wanted?

    Regards,
    Arthur

  • Hi Arthur,

    for my reply "So for the Filter 2 which uses the first order biquad transfer function not the second order biquad transfer function so do I need to divide the values by 2 and then use signed two's complement of that?" I am clarifying my question All the Biquad filter uses second order transfer function but I calculated the coefficient values for biquad filter 2 using first order transfer function using TIBQ calculator so do I need to divide N1 and D1 coefficient by 2 and then program N1 and D1. Would you please recheck the document slaa557.pdf and see the equation below. The N1 and D1 in second order equation are multiplied by 2 so if I directly use the N1 and D1 coef values directly that becomes double. Hence I am concern about dividing the N1 and D1 by 2. Also I recorded an audio with the value 0x823F48 for N1 and 0x7B8172 for D1. The whole audio was completely noisy.

    About disabling the filter whether I use 0x800000 = 8388608 for N0 coef or 0x7FFFFF = 8388607 rest all N1,N2,D1,D2 to zero. As D0 = 2^23 = 8388608 so now H(z) becomes N0/D0, so 8388608/8388608 gives H(z) = 1 and 8388607/8388608 give H(z) = 0.9999998807907104 which is much nearer to 1 so with both the value we can bypass the filter. Please correct me if I am wrong.

    Thank you,

    Kishan

  • Hi Kishan,

    I apologize I didn't get a chance to look at this today. I will take a look at this on Monday and see if I can clarify your question. In the mean time here is a PDF that I have that explains a bit about TIBQ.

    1273.TIBQ.pdf

    Regards,

    Arthur

  • Hi Arthur,

    Did you get a chance to look into my question?

    I have a question, look at the snap below

    both coefficients D1 in First order IIR and N0 in Biquad A refers to C39 but the registers are different. Should C39(Pg 9,Reg 40,41,42) be C38(Pg 9,Reg 40,41,42)  in First order IIR or Is that a typo in the document slaa557.pdf. If so, Can you please tell me which one is correct?

    For confirmation can you tell me What are the default coefficient values used for AGC low pass filter?

    Also can you please tell me which block includes AGC low pass filter in the ADC processing block PRB_R11?

    So there are two 1st order IIR filter used in the ADC processing block PRB_R11. So I want to know that which 1st order IIR filter belongs to what in the PRB_R11. See the snap below.  

    Thank you,

    Kishan

  • "So for the Filter 2 which uses the first order biquad transfer function not the second order biquad transfer function so do I need to divide the values by 2 and then use signed two's complement of that?"

    No, You do not need to divide by two or take the twos complement

    Should C39(Pg 9,Reg 40,41,42) be C38(Pg 9,Reg 40,41,42)  in First order IIR or Is that a typo in the document slaa557.pdf. If so, Can you please tell me which one is correct?

    Yes, This should be C38. this is a typo.

    these are the reset values for AGC coefficients 

    Regards,

    Arthur

  • Hi Arthur,

    Thank you for the information.

    As you said that I do not need to divide by two or take two's complement of it. Here is a thing that I used the TIBQ and PUREPATH for calculating coefficient values.

    The values I got from TIBQ which are

    • Text "* Sample Rate = 16000"
    • Text "* Filter 1 High Pass 2nd Order Butterworth, 40 Hz Fc 0.0 dB "
    • Text "* Filter 2 High Pass 1st Order Butterworth, 91 Hz Fc 0.0 dB "
    • Text "* Filter 3 Low Pass 2nd Order Butterworth, 7800 Hz Fc 0.0 dB "
    • Text "* Filter 1 BQ "
      • N0 = 0x7E95FE, N1 = 0x816A02, N2 = 0x7E95FE, D1 = 0x7E93FF, D2 = 0x82D002
    • Text "* Filter 2 1O "
      • N0 = 0x7DC0B8, N1 = 0x823F48, D1 = 0x7B8172
    • Text "* Filter 3 BQ "
      • N0 = 0x791585, N1 = 0x791585, N2 = 0x791585, D1 = 0x871A55, D2 = 0x8D7541

    So when I used TIBQ coefficient values I got noisy audio.

    The values I got from TI's PUREPATH studio which are

    • Text "* Sample Rate = 16000"
    • Text "* Filter 1 High Pass 2nd Order Butterworth, 40 Hz Fc 0.0 dB "
    • Text "* Filter 2 High Pass 1st Order Butterworth, 91 Hz Fc 0.0 dB "
    • Text "* Filter 3 Low Pass 2nd Order Butterworth, 7800 Hz Fc 0.0 dB "
    • Text "* Filter 1 BQ "
      • N0 = 0x7E95FE, N1 = 0x816A02, N2 = 0x7E95FE, D1 = 0x7E93FF, D2 = 0x82D002
    • Text "* Filter 2 1O "
      • N0 = 0x7DC0B8, N1 = 0xC11FA4, D1 = 0x3DC0B9
    • Text "* Filter 3 BQ "
      • N0 = 0x791585, N1 = 0x791585, N2 = 0x791585, D1 = 0x871A55, D2 = 0x8D7541

    So when I used TI's PUREPATH coefficient values the audio is coming properly. Please help me understanding this because for Filter 2 1O TIBQ and PUREPATH gives different values for N1 and D1. 

    Thank you,

    Kishan

  • Hi Kishan,

    I searched E2E for similar issues (TIBQ vs. PPS coefs). And I also talked with a colleague, and it seems that it is known that these two tools will sometimes give different coefs for the same filter parameters. I wont be able to answer why this is the case.

    It is likely best that you use the filter coefs that give the correct output. in this case use the PPS values.

    Regards,
    Arthur

  • Hi Arthur,

    Thank you for the help and finding the best solution for the Filter coefficients.

    Thank you,

    Kishan