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

ADAU144x rounding problem

SigmaDSP & SigmaStudio Svilen Jan 26, 2014 00:00 2 replies Original on forum ↗
Subscribe
Svilen Question
Jan 26, 2014 00:00

It seems that the DSP is operating in "round to lower" mode when store result from multiplication for future processing. In my setup I have a 2nd order IIR hi-pass filter, setup as f = 130 Hz, q = 1. With a mute before it. Its often happen when mute is active, on filter output exist a DC level. It output stuck on 0xFFFFFC6 (-0.00000691) or 0xFFFF29F (-0.00040829). Second value is quite high, giving me a -68dB level at output.

Quick investigation show that problem is in rounding algorithm of multiplication. A simple setup that multiply 2 numbers: 0xFFFF29F (-0.00040829) and 0x07FF66F (+0.99970806) produce the input value 0xFFFF29F (-0.00040829).

Multiplication:

FFFF29F * 7FF66F = 7FF603FFFFCF1

-

7FF66F * 10000000 = 7FF66F0000000 (sign correction)

=

FFFFFFF94FFFFCF1

in binary v this is lost after rounding

FFFFFFF94FFFFCF1 = 11111111111111111111111111111001010011111 11111111111110011110001

FFFF29F = 1111111111111111001010011111

Result number is very close to FFFF2A0, but because the rounding to lower, it stay the same as input.

Is it possible co change the rounding mode to "round to 0" or "round to near"?

KJBob Reply
Feb 1, 2014 00:00

Hi Svilen,

Unfortunately the rounding behavior is fixed, but sometimes we can work around it. For example, the first filter shown below has an output of 0xFFFF29 (Note I'm running this on a ADAU1701, whose readback loses four bits of resolution -- that's why I multiplied the filter output by 16, then divided the result by 16. In contrast, the 144x processors read back at full resolution.).

The second filter reads much better -- 0xFFFFFF -- because it's double-precision.. ADI recommends using double-precision IIR filters whenever the corner frequency is less than fs/10, as is the case here. Operations built from discrete blocks are always single-precision, as if the "wires" connecting the blocks can only handle "5.23" format numbers (or "8.24" in the new ADAU145x). If your signals don't demand much headroom, you could scale them up some before a critical operation, to gain some more resolution.

Best regards,

Bob

532ec6a8bc2206c2164bba70eca90337.jpg
532ec6a8bc2206c2164bba70eca90337.jpg
532ec6a8bc2206c2164bba70eca90337.jpg-550x289.jpg
532ec6a8bc2206c2164bba70eca90337.jpg-550x289.jpg
EZAdministrator Reply
Aug 2, 2018 00:00

This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

Thank you,
EZ Admin