DSP routine (C language)