Week 8: Lecture - Changing Algorithm and Project Discussion

Hello everyone and welcome to my blog!

During this week we have started to work on the projects and also we have talked about Changing an Algorithm to Improve Performance.

Regarding projects we talked about different stages our project will take. In particular, we talked about stage 1, which consists of building and benchmarking. Our professor, Chris Tyler, shared some tips in his video lecture regarding, how should we pick up the projects, how can we build it, what tools can be used for measuring performance, and how should we do the benchmarking.

For Changing an Algorithm to Improve Performance we talked about Audio volume scaling problem. For example:
  • PCM Audio is represented as 16-bit signed integer samples
  • To reduce the volume of the audio, it can be scaled by a factor from 0.000 (silence) to 1.000 (original volume).
  • This is a common operation on mobile and multimedia devices.
  • What is the best way to do this?
Approaches to take:
  • Approach 1: Naive Implementation - Multiply each sample by the scaling factor (this involves multiplying each integer sample by a floating-point number, then converting the result back to an integer)
  • Approach 2: Lookup Table - Pre-calculate all possible values multiplied by the scaling factor, then look up the new value for each original sample value
  • Approach 3: Fixed-point math - Use fixed-point math rather than floating-point math
  • Approach 4: Vector fixed-point math - Use SIMD instructions to do multiple fixed-point operations in parallel

Comments