%0 Journal Article %J C Users Journal %D 1993 %T Guidelines for signal processing applications in C %A Freed, Adrian %P 85(9) %U http://collaboration.cmc.ec.gc.ca/science/rpn/biblio/ddj/Website/articles/CUJ/1993/9309/freed/freed.htm %X Signal processing algorithms programmed in C must be as efficient and clear as possible because of their importance to time-critical applications. Careful programming and use of an optimizing compiler for a modern processor make it possible to make the algorithms efficient without sacrificing clarity. The first audio signal processing library function listed uses C's ability to express low-level operations to optimize code performance for a specific compiler or machine, while the second listing is clearer and uses no register variables, pointers, or temporary variables; it also makes no special case for vectors of contiguous elements. The simpler version was found to run slightly faster than the hand-optimized version by eliminating the test for the special case of increments by one. Guidelines for choosing the right algorithm, choosing and controlling data types, and memory layout are described. %8 1993