Lab 6 - Algorithm Selection Lab
Introduction This post is the contents of experiments I found during the lab 6. Lab 6 is the Algorithm Selection Lab. I observed different types of algorithms, compiled them, and checked what are the differences. The detailed contents will be described below. Lab 6 There are three source files name 'vol1.c', 'vol2.c', and 'vol3.c' that contains different types of algorithm. The algorithms are to change the volume of the digital sound. The basic or Naive algorithm ( vol1.c ). This approach multiplies each sound sample by 0.75, casting from signed 16-bit integer to floating point and back again. Casting between integer and floating-point can be expensive operations. A lookup-based algorithm ( vol2.c ). 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 ( vol3.c ). This approach uses fixed-point math and bit shifting to perform the multiplication w...