What are the number formats for SigmaDSP?

In the SigmaStudio help file, some of the algorithms have input and outputs specified as integer or decimal. Also, in the SigmaDSP datasheets, there are references to 28.0 and 5.23. Also, in SigmaStudio, sometimes cells will have other formats like 5.19. What does this mean?

  • DSP systems use a standardized numeric format. Fixed-point numbers are formatted A.B, where A is the number of bits to the left of the decimal point (the integer part) and B is the number of bits to the right of the decimal point (the fractional part).

    Inputs to the SigmaDSP cores are 24 bits. In the core, the DSP adds 4 additional zeros for additional headroom. The result is a 28 bit number representation.

    So, in the case of most SigmaDSPs, audio representation is represented with A = 5 and B = 23. In other words, the number format is 5.23. Control signals and index table values generally require integer representation, and are therefore represented with A = 28 and B = 0. In other words, the format is 28.0.

    28.0 (Integer) Format

    Signals that are in integer format follow standard binary rules for representation.
    0 = 0, 1 = 1, 10 = 2, 11 = 3, 100 = 4, et cetera.
    Including zero padding, positive integers in the DSP are represented as follows:

    0000 0000 0000 0000 0000 0000 0000 = 0
    0000 0000 0000 0000 0000 0000 0001 = 1
    0000 0000 0000 0000 0000 0000 0010 = 2
    0000 0000 0000 0000 0000 0000 0011 = 3
    0000 0000 0000 0000 0000 0000 0100 = 4
    ...
    0000 1000 0000 0000 0000 0000 0000 = 8388608 (0 dB full scale represented in 28.0 format)
    ...
    0111 1111 1111 1111 1111 1111 1111 = 134217727 (2^27 - 1)

    Negative numbers are represented in two's complement. For more information on two's complement, please read the very comprehensive article on Wikipedia here: http://en.wikipedia.org/wiki/Two%27s_complement

    The corresponding 28-bit two's complement integers are represented as follows:

    1000 0000 0000 0000 0000 0000 0000 = -134217728 (2^27)
    ...
    1111 1111 1111 1111 1111 1111 1100 = -4
    1111 1111 1111 1111 1111 1111 1101 = -3
    1111 1111 1111 1111 1111 1111 1110 = -2
    1111 1111 1111 1111 1111 1111 1111 = -1

    In general, negative integers are not used in SigmaStudio or SigmaDSP algorithms.

    When outputting to the serial ports or DACs, signals will saturate at 0 dBFS. This means any signal exceeding 8388608 in 28.0 format will be limited to full-scale on the outputs.

    5.23 (Decimal) Format

    Audio, unlike control signals, is not represented as an integer, but rather as a decimal value. A full-scale audio signal has an amplitude of 1. If -3 dB of gain is applied, it should have an amplitude of approximately 0.707. If -6 dB of gain is applied, the signal has an amplitude of 0.5. So, it is easy to see that audio signals need to be represented as decimal numbers.

    A full scale 24-bit input signal would have a positive peak of 1000 0000 0000 0000 0000 0000 in unsigned, 24-bit representation. If we add 4 bits of headroom, the 28-bit representation becomes 0000 1000 0000 0000 0000 0000 0000. If two's-complement representation is used, then the negative peak of a full-scale signal becomes 1111 1000 0000 0000 0000 0000 0000.

    Moving the leading '1' to the left or right will double or halve the value, respectively.

    0000 0000 0000 0000 0000 0000 0000 =  0.0
    0000 0010 0000 0000 0000 0000 0000 =  0.25
    0000 0100 0000 0000 0000 0000 0000 =  0.5
    0000 1000 0000 0000 0000 0000 0000 =  1.0 (0 dB full scale)
    0001 0000 0000 0000 0000 0000 0000 =  2.0
    0010 0000 0000 0000 0000 0000 0000 =  4.0
    0111 1111 1111 1111 1111 1111 1111 =  (16.0 - 1 LSB)

    For negative numbers, signed two's-complement is used.

    1000 0000 0000 0000 0000 0000 0000 =  -16.0
    1110 0000 0000 0000 0000 0000 0000 =  -4.0
    1111 0000 0000 0000 0000 0000 0000 =  -1.0
    1111 1000 0000 0000 0000 0000 0000 =  -1.0
    1111 1100 0000 0000 0000 0000 0000 =  -0.5
    1111 1110 0000 0000 0000 0000 0000 =  -0.25
    1111 1111 1111 1111 1111 1111 1111 =  (1 LSB below 0.0)

    When outputting to the serial ports or DACs, signals will saturate at 0 dBFS. This means any signal with a peak exceeding 1.0 in 5.23 format will be limited to full-scale on the outputs.

    5.19 (Hardware readback) Format

    Some cells in SigmaStudio may use slightly different number formats. For example, since the hardware-based DSP readback registers in the ADAU1701 only have 24 bits, the lower 4 bits from the 5.23 signal are truncated and the number is represented in 5.19 format.

    So, a full-scale signal that was represented in 5.23 format as
    0000 1000 0000 0000 0000 0000 0000
    would have its lower 4 bits truncated for 5.19 representation:
    0000 1000 0000 0000 0000 0000

    The result is that very small amplitude signals will be truncated and therefore cannot be read back from the DSP on the older generation of SigmaDSP cores.

    Newer cores, such as the ADAU1761 and ADAU144x, have full 5.23 readback capabilities implemented in software.

    Message was edited by: Brett Gildersleeve - fixed typo

  • From the datasheet:

    The parameter RAM is 32 bits wide and occupies Address 0 to Address 1023. Each parameter is padded with four 0s before the MSB to extend the 28-bit word to a full 4-byte width.

    If writing these values from a microcontroller, do we have to ensure that these padding bits are always 0, or is their value ignored?

  • Hi J3627,

    The value of the top 4 bits will be ignored. Only the 28 LSBs matter. So, you can write 0x0FFFFFFF or 0xFFFFFFFF to the control port, and the DSP will regard them as the same number.

  • I have used the dc input entry cell to set the threshold between two audio sources as shown below.

    106 is chosen to pass down to -98 dBFS. The value of "106" should be adjustable by the user in dBFS land. how can I map this integer value to dBFS? any equation to help?? basically the user should be able to change the threshold to higher in dBFS through our GUI but micro controller needs to know what integer should write to the DC cell.

    Thanks.

    Semi

  • This question has been closed by the EZ team and is assumed answered.