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.

PCM1865: How to set the biquad coefficients of secondary ADC HPF and make it work

Part Number: PCM1865
Other Parts Discussed in Thread: TLV320ADC5140

Hi all,

We used TI Biquad Coefficients Calculator, got the biquad coefficients and wrote registers of PCM1865, as the images attached, but it did not work as expected.

Could you please show the steps to set biquad coefficients of secondary ADC HPF?

Please let me know if any other info needed.

Thanks.

  • Hi Li,

    Can you clarify what you mean by the filter not working as expected? How are you verifying the filter response?

    Best,

    Zak

  • Hi Zak,

    Please see the attached files. There's no difference in the spectrum of captured audio data no matter biquad coefficients set or not.

  • Hi Li,

    It is difficult for me to interpret the spectrums you have presented. Are you measuring the data from the secondary ADC path? Note that the biquad filter settings do not impact the primary audio path ADCs and only apply to the secondary ADC for filtering energysense signals. There are no programmable biquads for the primary audio paths in this device. If you need this feature then I would recommend you look at the TLV320ADC5140.

    Best,

    Zak

  • Hi Zak,

    Yes, the data was measured from the secondary ADC path. Actually, there're 4 mics connected to VINL1, VINR1, VINL2, VINR2 on other board. We set GPIO3 as DOUT2 cooperated with DOUT to capture 4 mics signals by I2S and it works fine. But, about the data measured from the secondary ADC path, the spectrum below 600Hz are not cut off after applying the biquad coefficients I presented before. According to your explanation, the biquad coefficients should take effect, right?

  • Hi Li,

    The procedure for updating DSP coefficients is outline in section 9.5.5 of the datasheet. Please review this and let me know if you have any questions! The example given in the DS is for updating the signal resume and loss thresholds for energysense functionality, but you would follow the same procedure to update the LPF and HPF coefficients. You would just change the memory address used to the corresponding coefficient. As mentioned in the DS, you should mute the device until you're done writing the coefficients and you have to have clocks applied for the writes to work.

    You can also use the PCM186x GUI for reference as there is a biquad generation tool in the GUI:

    In order to measure the secondary ADC frequency response, you have to operate in 6 channel TDM mode and then the HPF data will be present on channel 5 and LPF+HPF on channel 6. Here is an example measurement with this configuration:

    It's also necessary yo make sure you have selected an active channel for the secondary ADC to see anything, otherwise you will just measure the noise of the ADC.

    I hope this helps!

    Best,

    Zak

  • :

    Hi Zak,

    We followed the procedure in section 9.5.5 to update the HPF coefficients. We'll present you the registers we write and read back later. But first, I want to known that, is 6 channel TDM mode the only mode to make HPF work? Does I2S mode with DOUT2 cooperated with DOUT to capture 4 mics signals can make HPF work? We already verified that the 4 mics signals could be captured by I2S(DOUT andDOUT2). HFP works or not should not depend on the digital interface mode, right? Second, could please help to check the biquad coefficients we posted before? Is it correct for FC600? As we have not got PCM186x GUI yet.

    Thanks a lot.

  • Hi Zak,

    I also attached the log of reading and writing the biquad coefficient registers. Please also help to check.

    3060.PCM1865_Biquad_Coefficent_RW.log
    
    [   15.116166] pcm186x 3-004b: write reg 0x0, val 0xfe
    [   15.127315] pcm186x 3-004b: write reg 0x0, val 0x0
    [   15.127492] pcm186x 3-004b: write reg 0x71, val 0x1f  // Mute CH1L, CH1R, CH2L, CH2R
    [   15.127500] pcm186x 3-004b: before enable hpf
    [   15.127677] pcm186x 3-004b: write reg 0x0, val 0x0
    [   15.127948] pcm186x 3-004b: read reg 0x71, val 0x1f  // CH1L, CH1R, CH2L, CH2R muted
    [   15.128262] pcm186x 3-004b: read reg 0x72, val 0xf  // Device Current Status: Run
    [   15.128448] pcm186x 3-004b: write reg 0x0, val 0x1  // Start to read biquad coefficent from page1
    [   15.128625] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.128802] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.129073] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.129274] pcm186x 3-004b: write reg 0x2, val 0x25
    [   15.129451] pcm186x 3-004b: write reg 0x1, val 0x2
    [   15.129721] pcm186x 3-004b: read reg 0x1, val 0x6
    [   15.129901] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.130174] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.130446] pcm186x 3-004b: read reg 0x8, val 0x7c
    [   15.130716] pcm186x 3-004b: read reg 0x9, val 0xbb
    [   15.130987] pcm186x 3-004b: read reg 0xa, val 0xd5
    [   15.130995] pcm186x 3-004b: biquad coefficent reg 0x25, val 0x7cbbd5  // default biquad coefficent read
    [   15.131175] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.131355] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.131533] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.131802] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.131979] pcm186x 3-004b: write reg 0x2, val 0x26
    [   15.132158] pcm186x 3-004b: write reg 0x1, val 0x2
    [   15.132429] pcm186x 3-004b: read reg 0x1, val 0x6
    [   15.132609] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.132879] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.133152] pcm186x 3-004b: read reg 0x8, val 0xc1
    [   15.133425] pcm186x 3-004b: read reg 0x9, val 0xa2
    [   15.133695] pcm186x 3-004b: read reg 0xa, val 0x16
    [   15.133704] pcm186x 3-004b: biquad coefficent reg 0x26, val 0xc1a216  // default biquad coefficent read
    [   15.133881] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.134057] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.134261] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.134532] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.134709] pcm186x 3-004b: write reg 0x2, val 0x27
    [   15.134885] pcm186x 3-004b: write reg 0x1, val 0x2
    [   15.135158] pcm186x 3-004b: read reg 0x1, val 0x6
    [   15.135338] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.135611] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.135881] pcm186x 3-004b: read reg 0x8, val 0x0
    [   15.136154] pcm186x 3-004b: read reg 0x9, val 0x0
    [   15.136424] pcm186x 3-004b: read reg 0xa, val 0x0
    [   15.136433] pcm186x 3-004b: biquad coefficent reg 0x27, val 0x0  // default biquad coefficent read
    [   15.136609] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.136786] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.136963] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.137236] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.137413] pcm186x 3-004b: write reg 0x2, val 0x28
    [   15.137593] pcm186x 3-004b: write reg 0x1, val 0x2
    [   15.137864] pcm186x 3-004b: read reg 0x1, val 0x6
    [   15.138044] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.138317] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.138588] pcm186x 3-004b: read reg 0x8, val 0x3c
    [   15.138860] pcm186x 3-004b: read reg 0x9, val 0xbb
    [   15.139134] pcm186x 3-004b: read reg 0xa, val 0xd5
    [   15.139144] pcm186x 3-004b: biquad coefficent reg 0x28, val 0x3cbbd5  // default biquad coefficent read
    [   15.139321] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.139499] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.139679] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.139949] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.140130] pcm186x 3-004b: write reg 0x2, val 0x29
    [   15.140307] pcm186x 3-004b: write reg 0x1, val 0x2
    [   15.140578] pcm186x 3-004b: read reg 0x1, val 0x6
    [   15.140758] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.141028] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.141302] pcm186x 3-004b: read reg 0x8, val 0x0
    [   15.141572] pcm186x 3-004b: read reg 0x9, val 0x0
    [   15.141845] pcm186x 3-004b: read reg 0xa, val 0x0
    [   15.141854] pcm186x 3-004b: biquad coefficent reg 0x29, val 0x0  // default biquad coefficent read
    [   15.142031] pcm186x 3-004b: write reg 0x0, val 0x1  // Start to write biquad coefficent
    [   15.142211] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.142388] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.142660] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.142837] pcm186x 3-004b: write reg 0x2, val 0x25
    [   15.143014] pcm186x 3-004b: write reg 0x4, val 0x79
    [   15.143194] pcm186x 3-004b: write reg 0x5, val 0x15
    [   15.143371] pcm186x 3-004b: write reg 0x6, val 0x85
    [   15.143548] pcm186x 3-004b: write reg 0x1, val 0x1
    [   15.143728] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.143904] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.144105] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.144379] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.144556] pcm186x 3-004b: write reg 0x2, val 0x26
    [   15.144733] pcm186x 3-004b: write reg 0x4, val 0x86
    [   15.144909] pcm186x 3-004b: write reg 0x5, val 0xea
    [   15.145110] pcm186x 3-004b: write reg 0x6, val 0x7b
    [   15.145290] pcm186x 3-004b: write reg 0x1, val 0x1
    [   15.145467] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.145644] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.145823] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.146118] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.146298] pcm186x 3-004b: write reg 0x2, val 0x27
    [   15.146475] pcm186x 3-004b: write reg 0x4, val 0x79
    [   15.146652] pcm186x 3-004b: write reg 0x5, val 0x15
    [   15.146829] pcm186x 3-004b: write reg 0x6, val 0x85
    [   15.147005] pcm186x 3-004b: write reg 0x1, val 0x1
    [   15.147184] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.147361] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.147538] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.147808] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.147987] pcm186x 3-004b: write reg 0x2, val 0x28
    [   15.148195] pcm186x 3-004b: write reg 0x4, val 0x78
    [   15.148372] pcm186x 3-004b: write reg 0x5, val 0xe5
    [   15.148549] pcm186x 3-004b: write reg 0x6, val 0xab
    [   15.148725] pcm186x 3-004b: write reg 0x1, val 0x1
    [   15.148902] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.149079] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.149283] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.149556] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.149732] pcm186x 3-004b: write reg 0x2, val 0x29
    [   15.149909] pcm186x 3-004b: write reg 0x4, val 0x8d
    [   15.150108] pcm186x 3-004b: write reg 0x5, val 0x75
    [   15.150289] pcm186x 3-004b: write reg 0x6, val 0x41
    [   15.150466] pcm186x 3-004b: write reg 0x1, val 0x1
    [   15.150474] pcm186x 3-004b: after enable hpf  // After writing biquad coefficent, read back to confirm
    [   15.150651] pcm186x 3-004b: write reg 0x0, val 0x0
    [   15.150921] pcm186x 3-004b: read reg 0x71, val 0x1f  // Still muted
    [   15.151227] pcm186x 3-004b: read reg 0x72, val 0xf  // Still running
    [   15.151413] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.151590] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.151766] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.152037] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.152220] pcm186x 3-004b: write reg 0x2, val 0x25
    [   15.152397] pcm186x 3-004b: write reg 0x1, val 0x2
    [   15.152669] pcm186x 3-004b: read reg 0x1, val 0x6
    [   15.152849] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.153122] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.153392] pcm186x 3-004b: read reg 0x8, val 0x79
    [   15.153663] pcm186x 3-004b: read reg 0x9, val 0x15
    [   15.153933] pcm186x 3-004b: read reg 0xa, val 0x85
    [   15.153942] pcm186x 3-004b: biquad coefficent reg 0x25, val 0x791585  // The same as what we wrote
    [   15.154122] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.154302] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.154479] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.154750] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.154927] pcm186x 3-004b: write reg 0x2, val 0x26
    [   15.155107] pcm186x 3-004b: write reg 0x1, val 0x2
    [   15.155379] pcm186x 3-004b: read reg 0x1, val 0x6
    [   15.155560] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.155832] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.156107] pcm186x 3-004b: read reg 0x8, val 0x86
    [   15.156381] pcm186x 3-004b: read reg 0x9, val 0xea
    [   15.156652] pcm186x 3-004b: read reg 0xa, val 0x7b
    [   15.156661] pcm186x 3-004b: biquad coefficent reg 0x26, val 0x86ea7b  // The same as what we wrote
    [   15.156838] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.157014] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.157194] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.157465] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.157642] pcm186x 3-004b: write reg 0x2, val 0x27
    [   15.157819] pcm186x 3-004b: write reg 0x1, val 0x2
    [   15.158110] pcm186x 3-004b: read reg 0x1, val 0x6
    [   15.158293] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.158566] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.158836] pcm186x 3-004b: read reg 0x8, val 0x79
    [   15.159110] pcm186x 3-004b: read reg 0x9, val 0x15
    [   15.159378] pcm186x 3-004b: read reg 0xa, val 0x85
    [   15.159386] pcm186x 3-004b: biquad coefficent reg 0x27, val 0x791585  // The same as what we wrote
    [   15.159561] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.159735] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.159909] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.160176] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.160351] pcm186x 3-004b: write reg 0x2, val 0x28
    [   15.160528] pcm186x 3-004b: write reg 0x1, val 0x2
    [   15.160793] pcm186x 3-004b: read reg 0x1, val 0x6
    [   15.160971] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.161251] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.161517] pcm186x 3-004b: read reg 0x8, val 0x78
    [   15.161782] pcm186x 3-004b: read reg 0x9, val 0xe5
    [   15.162048] pcm186x 3-004b: read reg 0xa, val 0xab
    [   15.162056] pcm186x 3-004b: biquad coefficent reg 0x28, val 0x78e5ab  // The same as what we wrote
    [   15.162249] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.162423] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.162599] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.162864] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.163039] pcm186x 3-004b: write reg 0x2, val 0x29
    [   15.163214] pcm186x 3-004b: write reg 0x1, val 0x2
    [   15.163480] pcm186x 3-004b: read reg 0x1, val 0x6
    [   15.163657] pcm186x 3-004b: write reg 0x0, val 0x1
    [   15.163923] pcm186x 3-004b: read reg 0x1, val 0x0
    [   15.164222] pcm186x 3-004b: read reg 0x8, val 0x8d
    [   15.164494] pcm186x 3-004b: read reg 0x9, val 0x75
    [   15.164767] pcm186x 3-004b: read reg 0xa, val 0x41
    [   15.164775] pcm186x 3-004b: biquad coefficent reg 0x29, val 0x8d7541  // The same as what we wrote
    [   15.164952] pcm186x 3-004b: write reg 0x0, val 0x0
    [   15.165131] pcm186x 3-004b: write reg 0x71, val 0x10  // Unmute CH1L, CH1R, CH2L, CH2R
    
    

    Thanks.

  • Hi Li,

    Since the programmable high pass filter only applies to the secondary ADC and not the 4 primary ADC channels you have your microphones connected to, the only way to observe the HPF and LPF responses you have programmed is to operate in 6 channel TDM mode. Otherwise data from the secondary ADC is not included in the TDM data output.

    It sounds to me like you are wanting to program the high pass filter for your audio channels. Unfortunately the primary audio path ADC high pass filter can be turned off, but it is not programmable. It is fixed at 1Hz if it is enabled.

    Best,

    Zak

  • Hi Zak,

    Appreciate for your explanation. 

    Thanks a lot.