🔢

Understanding DSP Number Formats

Mar 22, 2025

DSP Number Formats and Their Considerations

Key Questions in DSP Number Formats

  • Dynamic Range: Range of distinct numbers that can be represented in an n-bit number format.
  • Accuracy: Degree of error resulting from calculations.

Dynamic Range

  • Fixed Point Representation:

    • Dynamic range is 2^n.
    • Headroom is defined as the ability to handle signal excess without clipping.
    • Example with 16-bit fixed point: Ranges between 2^15 - 1 to -2^15 for integers or rounded 1 to -1 for fractions.
    • Overflow occurs when the signal exceeds the range, causing undefined behavior.
    • Clipping is used to manage overflow by holding signal values at extreme range limits.
  • Challenges:

    • Intermediate signal processing stages may require headroom to prevent clipping.
    • To accommodate, fixed point DSP processors use larger registers (e.g., Motorola 56k family has 56-bit accumulators for 24-bit audio).

Accuracy in Fixed Point Numbers

  • Addition/Subtraction:

    • Perfectly accurate with no accumulated error.
    • Overflow still a concern but assumed handled.
  • Division:

    • Error-prone due to discarded fractional components.
    • Relative error is higher with smaller numbers, significant in low-level audio signals.
    • Error quantification: up to 0.5 LSB for rounding, 1 LSB for truncation.
    • Example: Dividing 3 by 2 results in 1.5, truncated to 1.
  • Error Accumulation:

    • Single calculation errors are insignificant, but recursive processes can accumulate errors.
    • Multiply accumulate operations use larger registers, but recursive filter paths can create unacceptable errors in pro-quality audio.

Use of Fixed Point vs. Floating Point

  • Fixed Point:

    • Preferred for storing digital audio and playback in low-powered devices.
    • Efficient for non-complex signal processing.
  • Floating Point:

    • Preferred in modern computer audio for signal processing.
    • Used in single or double precision form.
    • Advantages and complexities will be explored in the next discussion.