Changes

Jump to: navigation, search

SPO600 Algorithm Selection Lab

37 bytes added, 11:26, 9 March 2020
Three Approaches
Three approaches to this problem are provided:
# The basic or Naive algorithm (<code>vol1.c</code>). This approach multiplies each sound sample by 0.75, casting from signed 16-bit integer to floating point and back again, which . Casting between integer and floating point can be [[Expensive|expensive]] operations.
# A lookup-based algorithm (<code>vol2.c</code>). This approach uses a pre-calculated table of all 65536 possible results, and looks up each sample in that table instead of multiplying.
# A fixed-point algorithm (<code>vol3.c</code>). This approach uses fixed-point math and bit shifting to perform the multiplication without using floating-point math.

Navigation menu