Stupid me. I translated the lite-c line
Code:
var a = (0.707*2*PI)/CutoffPeriod;


as
Code:
f = 0.707106781 * 3.141592654 / period



The highpass2 and roof functions are fine.