Post Go back to editing

Sigma studio coeff calculation filter broken

Category: Software
Product Number: ADAU1462
Software Version: SigmaStudio+ 2.3.0 update 3

When I try to use a coefficient calculation filter, it turns my sine tone test signal into a square wave (output of DAC). When I replace it with a general 2nd order block with the same parameters, it works as expected. Also, the address for all the parameters for them in the '_PARAM.h' file always show 0. Unless I'm missing something about how to use them, it seems like it's broken.

Also, I noticed a problem in the '_PARAM.h' file for the lines like this:

'#define MOD_GENSECONDORDER_TONE_TEST_STAGE0_B0_VALUE          SIGMASTUDIOTYPE_8_24_CONVERT(1.12201845430196)'

On the general 2nd order filter it's putting out coefficients on those lines for the low shelf filter that are correct for the high shelf filter (compared with separately calculated coefficients). Swapping between low shelf and high shelf, the values don't change.

I'm using SigmaStudio+ 2.3.0 update 3. I'll probably just use the general filters and calculate the coefficients on the MCU for now.

  • Hello Gestalt,

    I suspect your Q factor is set for higher value, so it started clipping. when you drag and drop the coeff calculation filter block (any 2nd order filter), the Q value is set for 1.41 as default. I drag and drop the filter you said and set to LPF of 1KHz and let Q value be 1.41 'as is'.

    Below is what I got for Q=1.41

    Since it's clipped, it seems like a square wave.

    Set the Q value to be something like Q = 0.7, below is the result

    It seems fine for me now. I have attached my program too above.

    You can see this in the frequency response using stimulus and probe. I used SS just for this functionality currently; this will give you an idea about the frequency graph. (I used SS+ for simulating your query)

    for Q = 1.41                                                                                          

      

     for Q = 0.7                                                                                

    Could you please try this and get back? 

    I will reply soon about the param.h file related question.

    Regards,

    Harish

  • Thanks! Yep, your definitely right about the Q. I had selected butterworth HPF and there's no Q on that one, but I can see in the parameters that it doesn't change it to 0.71 and leaves it as 1.41. You can fix it by selecting another filter and changing the Q there, then changing it back. The output was fixed after that. Hopefully there's an easy fix for the parameter file too.

  • I figured out the shelf thing. It was because I was using a version of the equations that only had one gain. The version used in sigma studio uses a linear gain too. The gain in the other equations is the same as what's being called boost in sigma studio. The parameters didn't change between highshelf and lowshelf because I was putting the gain into the the linear one instead of boost. With 0 boost the coefficients are the same. How I got some of the coefficients to line up doing that, I'm not sure.

    The equations used in sigma studio are here except I think there is an error: https://wiki.analog.com/resources/tools-software/sigmastudio/toolbox/filters/general2ndorder?rev=1592943758

    The high-shelf a0 middle term should be negative I think. Like this: "a0=(A+1)-(A-1)*cos(w0)+2*sqrt(A)*alpha"

    Anyways, I still don't understand how to get the addresses to interact with the on DSP coefficient calculation filters from the header files. If you know how to do that, I would prefer to offload the calculation to the DSP. I see the line:

    #define MOD_GSOCOEFFCALCULATION_0_ADDRESS_DSP_CALC0___FIXPT          0x00000076

    But, it seems like this just points to the actual coefficients b2, b1, etc. All the other address lines are 0 like this:

    #define MOD_GSOCOEFFCALCULATION_0_FREQ_DSP_CALC0___ADDR              0

  • Hello Gestalt,

    I'm glad that you figured that shelf coefficients thing out yourself.

    Regarding that param,h file, 

    Yeah, I can simulate the bug. it indeed shows 0 as address for all the parameters in the file.

    But you can get these addresses from the parameter window. Below is how to do this.

    Go to view>> parameter window

    and you can see the parameters and its addresses there.

    Sorry for the trouble caused.

    Hope this helps!

    Regards,

    Harish

  • Thanks. I was thinking there was some checkbox I missed or something. It seems it has to be hardcoded for now.