implemented cubic interpolation (Catmull-Rom spline) for better spike alignment.