TitleGuidelines for signal processing applications in C
Publication TypeJournal Article
Year of Publication1993
AuthorsFreed, A
JournalC Users Journal

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.