Updated cos_coeffs, sin_coeffs and spline_depths function