Matlab's spline equivalent in Python, three inputs.

前端 未结 2 720
野的像风
野的像风 2021-01-23 23:29

I\'m converting a matlab script to python and I have it a roadblock. In order to use cubic spline interpolation on a signal. The script uses the command spline with three input

2条回答
  •  滥情空心
    2021-01-23 23:49

    Basically you will first need to generate something like an interpolant function, then give it your points. Using your variable names like this:

    from scipy import interpolate
    tck = interpolate.splrep(f_o, c_signal, s=0)
    

    and then apply this tck to your points:

    c_interp = interpolate.splev(freq, tck, der=0)
    

    For more on this your can read this post.

提交回复
热议问题