This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
resources:tools-software:sigmastudio:usingsigmastudio:numericformats [29 Nov 2018 18:55] – [8.24 (Decimal) Format] KenM | resources: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, | + | 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, |
Line 60: | Line 60: | ||
- | Audio, unlike control signals, | + | Audio is commonly |
- | A full scale 24-bit | + | 0111 1111 1111 1111 1111 1111 = 1 - 1 LSB = largest positive |
- | 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 ' |
- | + | ||
- | 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 ' | + | |
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 |
- | | + | 0111 1111 1111 1111 1111 1111 1111 1111 = (128.0 - 1 LSB) = max value |
Similarly, for negative numbers: | Similarly, for negative numbers: | ||
- | | + | 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 | |
- | When outputting to the serial ports or DACs, signals will saturate | + | |
- | + | ||
- | + | ||
===== 28 bit architectures ====== | ===== 28 bit architectures ====== | ||