implementing cal_* from SPTK