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.

Purepath PPS PCM5142 and Runtime Eq parameters... driver

Other Parts Discussed in Thread: PCM5142

Hi, I haven't head back from previous post so have issued this as a new discussion: 

 

1. We have setup a design in PPS for 192Khz support. The 5band EQ does not seem to output audio at 96 and 192Khz. The problem seems to be that the MiniDsp cannot run the 5band Eq at 192kz even when the support is enabled... we have tried this on our 5412EVM - can you confirm on Eval that 5band works at 96kHz or 192khz?

 

2. Considering a new design using Biquad instead of 5band Eq (because of observed issue above) we note that the Bass Shelf Biquad does not normalise with gain above 0db but the Treble Shelf does… why is this? Is there a was to turn off this normalising feature?

Assuming there is no way to turn this auto normalising gain feature off please can you assist below:

So with scale of 0.1 the base gain of the filter will be reduced. To make up the gain is there a component in PPS that adds gain (above 6 or 12dB) other than the Volume Component? 

Our design link here - 

  /cfs-file/__key/communityserver-discussions-components-files/6/1727.pps_5F00_drvr.zip

3. We need to change Biquad coefficients after the initial setup. These are to be set while operating/runtime like any Eq of a HiFi system. We have used in the past the .h file for sending coefficients to the PCM5142 however these is quite involved... instead of this we would like to use the pps_driver.c pps_driver.h file and call the internal routines... we hope you will have an application example using pps_driver that shows how to call the functions in a real-time system? I have attached the pps generated pps_driver files from our project as an example... perhaps linux driver examples??

  • Hi,

    1. I will need to look into the configuration of the 192/96 kHz mode and test this myself. The part should be able to perform at these sampling rates. The number of cycles available for the DSP to perform functions will be reduced at higher sampling rates.

    2. The normalizing feature cannot be turned off. By setting the scale to 0.1 you allow the auto scaling to normalize the filters without hitting the limit. You can then change the filters individually or together to your desired levels.

    3. I will have to look more into this.

    I will get back to you when I have some information.

    Justin
  • Hi,

    1. Yes the PCM5142 can support the 5 band EQ for 96 kHz and 192 kHz, you can use the 8x or the 4x Interpolation for 96 kHz sampling and the 2x interpolation for 192 kHz sampling. This means that you will have to put the DSP into standby and reprogram the instruction memory to switch between 48k/96k and 192k sampling rates.

    I was able to place an 8x Interpolation component in a process flow with one 5 band Biquad for each channel and enable both 48k sampling and 96k sampling. I verified with both 96k and 48k I2S signals. To use 192k sampling, a 2x Interpolation component must be used. When switching between these, biquad coefficients must also be changed, otherwise resulting frequency response will be off by sampling frequency change factor.

    2. In short there is no way to turn off normalization. You can work around it by using a scale component to keep the Biquad from clipping (the biquad gain should be kept below 12 dB), then pass the signal through the desired biquad, then a shift scale at the end to normalize the attenuated frequencies back to 0 dB. Calculating this can be done with this excel spread sheet attached.

    Enter in the worst case gain (highest) to get the scale factor for all biquad settings you will use. This is to keep the ratio between filter settings the same.

    3. We do not have a linux driver or example code besides the files output from PPS. We do have documents explaining the behavior of the C-RAM which is what holds the coefficients for the process flow. This document was created for the AIC3254, but the same structure of C-RAM buffers were used for the PCM5142. Please refer to the PCM5142 datasheet for actual addresses, and specific registers. The idea is that you will load the unused buffer with the next Biquad setting, then switch the DSP from the current buffer to the one you just updated with the new biquad settings. This lets you change biquad settings on the fly.  

    When you have two sample rates or more enabled in PPS the biquad will calculate the coefficients for each sampling rate, and when you generate the code a "patch" file will be generated for each sampling rate. This file contains the necessary coefficients for the biquad settings change only. This allows you to use a patch file to go from one set of 48 k sampling biquads to another set of 48k biquad settings, or from 48k biquads to 96k biquads. To do this you would write the patch file to the unused DSP CRAM buffer, then swap buffers and the changes will take place in the DSP. You must then write to the DSP buffer again as to have the same coefficients in both buffers in case a switch happens again. This allows on the fly swapping of biquad settings. 

    You can try this yourself in PPS by going to the I2C Memory Tool.. in the Tool menu.

    Then go to the I2C tab. And select your base program for the desired sampling rate for the I2C Command File. Hit Execute for the program to be downloaded and run on the PCM5142 EVM.

    After confirming it is running correctly, you can then select a patch file with different biquad settings at the same sampling frequency. Hit Execute and the code will be programmed to the unused C-RAM buffer for the DSP. Then go to the Peek/Poke tab and hit Swap in the adaptive mode. This will swap the C-RAM buffers, and therefore the Biquad coefficients running on the DSP. You should see an immediate change in the output to reflect the new biquad settings.

    You will now be able to quickly swap buffers to see the effect the different biquad settings have on the output. This will continue until you write the patch coefficients to the other C-RAM buffer.

    Justin

  • Thanks Justin I will work through this, however your link to xls document seem to be broken above.

    Regarding question 1 - I was referring to 5Band Graphic Eq rather than 5Band Biquad... this I cannot seem to get to function at aove 48Khz.... did you test the  5Band Graphic Eq ?

  • You can right click on components in PPS and select Help. This will bring you to a page that gives you a description about the component. In the help for the graphical EQ it states that it works for 32 kHz, 44.1 kHz, and 48 kHz.

    I have attached the excel spreadsheet again, hopefully it works this time.


    Justin

    Copy of BiquadGainRollover_AIC3254.xlsx

  • Thanks Again most of this is clear now.
    One thing I am still not 100% on is managing the multitude of co-effs of run-time filter gains changes in code -
    For our application each gain for each filter in the 5Band EQ can be controlled by the user at 1dB steps (from -12dB to +12dB) , and samples rates supported can be 32,44.1,48,96 and 192khz... Does this mean I need to MANUALLY build 120 sets of coefficients for all bands/gains? - creating a total of 600 coefficients for all sample rates?

  • No you will not have to build 120 sets, Each filter (bass shelf for example) has its own set of coefficients. This means that you can do you 24 steps of bass shelf, and have 24 sets of bass shelf coefficients that can be used with any of the 24 different treble shelf coefficients. You will just have to manually grab the coefficients out of the patch file. An easy way to do this might be to 0 out all but the filter you are working on (bass shelf for example). The resulting Patch file will only be the writes for the enabled filter (disable others by clearing them out and selecting all pass). The you can combine any of the 24 bass shelf patch file code with any of the 24 treble shelf patch code to create a full filter. Then swap the CRAM as if it was one patch file write.

    Be careful to use different filter slots in the biquad as this determines where the coefficients will be written to in the CRAM. If they are both compiled using the the first filter slot in the biquad window, they will overwrite each other. 

    With this method you will only need to calculate 48 coefficient sets.

    Justin