Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:tools-software:sigmastudio:usingsigmastudio:numericformats [29 Nov 2018 18:55] – [8.24 (Decimal) Format] KenMresources:tools-software:sigmastudio:usingsigmastudio:numericformats [27 Jan 2021 22:35] (current) – use wp> interwiki links Robin Getz
Line 9: Line 9:
 To represent non-integer values, all of the SigmaDSP architectures use fixed-point numeric formats (rather than the more common floating point) to maximize the precision needed for audio signal processing. Fixed-point numbers are simply formatted as **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).  To represent non-integer values, all of the SigmaDSP architectures use fixed-point numeric formats (rather than the more common floating point) to maximize the precision needed for audio signal processing. Fixed-point numbers are simply formatted as **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). 
  
-The combined value A.B is in 2's complement format enabling both positive and negative values. For more information on two's complement representations, please read the comprehensive article on Wikipedia here: [[http://en.wikipedia.org/wiki/Two%27s_complement|Two's complement]]+The combined value A.B is in 2's complement format enabling both positive and negative values. For more information on two's complement representations, please read the comprehensive article on Wikipedia here: [[wp>Two%27s_complement|Two's complement]]
  
  
Line 60: Line 60:
    
  
-Audio, unlike control signals, is formatted intuitively as a decimal value in the range of 1 to -1. If a full-scale audio signal with a peak amplitude of 1 has -3 dB of gain appliedit should have an amplitude of approximately 0.707. If -6 dB of gain is applied, the signal has an amplitude of 0.5.+Audio is commonly formatted as a decimal value in the range of (- 1 LSB) to -1. full scale 24-bit input signal has positive peak value in 24 bit2's complement representation of:
  
-A full scale 24-bit input signal has a positive peak value in common 24 bit, 2's complement representation of:+  0111 1111 1111 1111 1111 1111 = 1 - 1 LSB = largest positive 24-bit value
  
-  1000 0000 0000 0000 0000 0000 = 2^23 - 1 = 0dBFS+Adding an LSB to represent a true value of one requires a larger word. If we add 8 bits of headroom (MSB zero padding) and move the sign bit left, the 8.24 representation becomes:
  
-If we add 8 bits of headroom (MSB zero padding), the 32-bit representation becomes:+  0000 0000 1111 1111 1111 1111 1111 1111 = 1 1 LSB
  
-  0000 0000 1000 0000 0000 0000 0000 0000 = 2^23 - 1 LSB = 0dBFS (A=0, B=2^23 - 1) +Note that moving a leading '1' to the left or right will double or halve the value, respectively.
-   +
-The negative peak of a full-scale signal becomes: +
- +
-  1111 1111 1000 0000 0000 0000 0000 0000 = -2^23 + 1 LSB (A=-1, B=2^23 - 1) +
- +
-Notes that moving a leading '1' to the left or right will double or halve the value, respectively.+
  
   0000 0000 0000 0000 0000 0000 0000 0000 =  0.0   0000 0000 0000 0000 0000 0000 0000 0000 =  0.0
-  0000 0000 0010 0000 0000 0000 0000 0000 =  0.25 +  0000 0000 0100 0000 0000 0000 0000 0000 =  0.25 
-  0000 0000 0100 0000 0000 0000 0000 0000 =  0.5 +  0000 0000 1000 0000 0000 0000 0000 0000 =  0.5 
-  0000 0000 1000 0000 0000 0000 0000 0000 =  1.0 (0 dBFS) +  0000 0001 0000 0000 0000 0000 0000 0000 =  1.0 
-  0000 0001 0000 0000 0000 0000 0000 0000 =  2.0 +  0000 0010 0000 0000 0000 0000 0000 0000 =  2.0 
-  0000 0010 0000 0000 0000 0000 0000 0000 =  4.0 +  0000 0100 0000 0000 0000 0000 0000 0000 =  4.0 
-  0000 0111 1111 1111 1111 1111 1111 1111 =  (16.0 - 1 LSB) = max value+  0111 1111 1111 1111 1111 1111 1111 1111 =  (128.0 - 1 LSB) = max value
  
 Similarly, for negative numbers: Similarly, for negative numbers:
  
-  1111 1000 0000 0000 0000 0000 0000 0000 =  -16.0 = min value +  1000 0000 0000 0000 0000 0000 0000 0000 =  -128.0 = min value 
-  1111 1110 0000 0000 0000 0000 0000 0000 =  -4.0+  1111 1100 0000 0000 0000 0000 0000 0000 =  -4.0 
 +  1111 1110 0000 0000 0000 0000 0000 0000 =  -2.0
   1111 1111 0000 0000 0000 0000 0000 0000 =  -1.0   1111 1111 0000 0000 0000 0000 0000 0000 =  -1.0
-  1111 1111 1000 0000 0000 0000 0000 0000 =  -1.0 +  1111 1111 1000 0000 0000 0000 0000 0000 =  -0.5 
-  1111 1111 1100 0000 0000 0000 0000 0000 =  -0.5 +  1111 1111 1100 0000 0000 0000 0000 0000 =  -0.25
-  1111 1111 1110 0000 0000 0000 0000 0000 =  -0.25+
   1111 1111 1111 1111 1111 1111 1111 1111 =  (1 LSB below 0.0)   1111 1111 1111 1111 1111 1111 1111 1111 =  (1 LSB below 0.0)
  
- +When outputting to the serial ports or DACs, signals will saturate to 24 bits by right shifting by one and ignoring the upper 8 bits. This means any signal with a peak outside the range (1.0 - LSB) to -1 in 8.24 format will be clipped to full-scale on the outputs.
-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 8.24 format will be clipped to full-scale on the outputs. +
- +
- +
 ===== 28 bit architectures ====== ===== 28 bit architectures ======
  
resources/tools-software/sigmastudio/usingsigmastudio/numericformats.1543514102.txt.gz · Last modified: 29 Nov 2018 18:55 by KenM