Post Go back to editing

Biquad function in CCES create noise in the output

Category: Software
Software Version: 2.10.0

Hi,

I find there maybe a bug in the biquad function and I don't know how to fix it.

I use the SigmaStudio to generate biquad coefficients. I choose Param EQ model and set the filter as below.

Param EQ

Then I can get the biquad coefficients from the capture window.

capture

This is a peaking filter, the frequency is 20Hz, Q is 15, Boost is -10dB. 

I checked the coefficients in Matlab and in ADAU1452, there's no problem in the output wave.

In CCES, I use the same coefficients in the biquad function, and the SAMPLES defined in my code is 12.

biquad

The biquad input is 20Hz sine wave and the result after biquad filter is that there will be some noise mixed in the output wave.

The noise is easy to be created when the Q is set big and and the frequency is set low.

20Hz sine wave input

20Hz sine input

biquad output

Output

Parents
  • Hi,

    Please find the attached Simple project contains Biquad function which is tested in ADSP 21569 Ezkit with CCES2.10.0. It is working fine for us. Also for more information please check with the below path for scalar and vector versions of Biquad function. We are suspecting the problem is associated with the order you are assigning coefficients in an array. For more information, you can refer the below help path.

    CrossCore® Embedded Studio 2.10.0 > SHARC® Development Tools Documentation > C/C++ Library Manual for SHARC® Processors > DSP Run-Time Library > DSP Run-Time Library Reference > biquad

    If you still facing issue, please share us your example code to simulate the issue in our eval kit.

    Best Regards,
    Santhakumari.K

    Test_Biquad 1.zip

  • Hi santha,

    I think you misunderstand what I want to show.

    I don't mean the biquad is wrong. Instead,the function output the right datas at most time.

    It will only create noise when I use peaking filter and set the frequency low and set the Qval high. For example, frequency 20Hz and Qval 15.

    If using other values without low frequency and high Qval, there's no noise at all.

    Now I modify a simple project using SC573 adc_dac_playback example. You can observe the output from DAC if there is noise mixed in the wave.

    In the project, I create a 20Hz sine wave in CH1 and CH2 input, and a 200Hz sine wave in CH3 and CH4 input.

    Also you can comment the sine wave and input from the ADC, and the result is the same.

    CH1 input is 20Hz, and biquad coeffs is from the SigmaStudio.

    CH2 input is 20Hz, and biquad coeffs is calculated using EQ algorithm copy from the SigmaStudio WIKI which set frequency 20 and Qval 15.

    CH3 input is 200Hz, and biquad coeffs is calculated using EQ algorithm copy from the SigmaStudio WIKI which set frequency 200 and Qval 15.

    CH4 input is 200Hz, and output directly.

    You can modify the frequency and Qval, then you can find the output will mixed with noise when both frequency is set low and Qval is set high.

    SC573_biquad_test.rar

  • Hi Foster,

    Thank you for sharing the test project to us. We are also observed the same behaviour. 

    We will update to you by early next week.

    Best Regards,

    Santhakumari.K

  • Hi Foster,
     
    Please find the attached project. When using the biquad() function with low frequencies, some noise is mixed into the output.

    In this project, we have used the biquad_trans() function, which works correctly without any noise at low frequencies. The #define trans need to be uncomment to use the biquad_trans() function in this project. Please note that the coefficient order of the biquad_trans() function should be as follows: B0, B1, B2, A1, A2.
     
    For more information about the biquad_trans() function, please refer to the following CCES help path:
    CrossCore® Embedded Studio 2.10.0 > SHARC® Development Tools Documentation > C/C++ Library Manual for SHARC® Processors > DSP Run-Time Library > DSP Run-Time Library Reference > biquad_trans
     
    Hope this helps.

    SC573_biquad_trans_test.zip


    Best Regards,
    Santhakumari.K

Reply
  • Hi Foster,
     
    Please find the attached project. When using the biquad() function with low frequencies, some noise is mixed into the output.

    In this project, we have used the biquad_trans() function, which works correctly without any noise at low frequencies. The #define trans need to be uncomment to use the biquad_trans() function in this project. Please note that the coefficient order of the biquad_trans() function should be as follows: B0, B1, B2, A1, A2.
     
    For more information about the biquad_trans() function, please refer to the following CCES help path:
    CrossCore® Embedded Studio 2.10.0 > SHARC® Development Tools Documentation > C/C++ Library Manual for SHARC® Processors > DSP Run-Time Library > DSP Run-Time Library Reference > biquad_trans
     
    Hope this helps.

    SC573_biquad_trans_test.zip


    Best Regards,
    Santhakumari.K

Children
  • Hi santha,

    Thanks for your reply.

    I did a simple test and confirm the biquad_trans function can solve my problem.

    The inconvenient thing is the coefficients in the biquad_trans are stored interleaved for each pair.

    Later on, I will make sure if the biquad_trans cost the same or more cycles compared with the biquad function.