De-duplicate some DSP code...