ΣSigmaStudio Ask AI Русский Log in

Calculating ADAU1701 coefficients in uP for long double vs float (64bit vs 32bit.)

SigmaDSP & SigmaStudio CoolJavelin Oct 24, 2019 00:00 2 replies Original on forum ↗
Subscribe
CoolJavelin Question
Oct 24, 2019 00:00

The question first:

Given that the actual coefficients in the ADAU1701 are only really 28 bits (the first nibble of the first byte is always a zero) how important is it that I calculate coefficients using 64 bit math?

I am using a uP to calculate coefficients using C (not C++). This is needed because I will need to have peaking filters with a dynamic range of +- 15 db on each of 15 bands.

The frequency range is from 18 to 100 Hz on each of the 15 bands.

I have been trying to carry double precision (long double) 64 bit calculations throughout my "CalcCoeff" routine, then convert to 32 bit float number just at the last step. Of course, the To523 further converts that to a 28 bit, zero padded, integer array to send to the DSP.

I was given to understand the precision of the coefficients are more important at lower frequencies, and I also understand intermediate results of previous calculations are also important.

Is there anything to be gained (practically speaking) by using 64 bits math.

Thanks, Mark.

Audio Signal Processors

coefficients

SigmaDSP Audio Processors

64bit

adau1701

DaveThib Reply
Nov 5, 2019 00:00

Hello Mark,

The filter coefficients are always 28 bits for both single and double precision filters. You can see this in the "Params" window of SigmaStudio if you drag both types of filters into a project. The double precision calculation takes place in the DSP with the actual audio data. The 56 bit number is multiplied by the 28 bit coefficients. So this should help you a little.

I don't think you will gain anything by using 64 bit math. You are already using 32 bits so that should work out fine.

Dave T

CoolJavelin Reply
Dec 3, 2019 00:00

Thank you Dave, That is my thought as well.

Since I am working on such low frequencies, close steps, and narrow bandwidth, I was just wondering if the long double might help with rounding the LSB of the integer better.

Once I have the C routines working, I will try both float (32 bit) and long double (64 bit) math and compare.

I will also post the calculations for peer review.

Mark.