You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the Savitzky-Golay to smooth the data and calculate the first derivative. It wses scipy.signal.savgol_filter. The Savitzky-Golay is very similar to the sliding polynomial fit, but slightly noisier, and much faster
102
-
103
-
:param x: array of time series to differentiate
104
-
:type x: np.array (float)
105
-
106
-
:param dt: time step size
107
-
:type dt: float
108
-
109
-
:param params: a list of three elements:
110
-
111
-
- N: order of the polynomial
112
-
- window_size: size of the sliding window, must be odd (if not, 1 is added)
113
-
- smoothing_win: size of the window used for gaussian smoothing, a good default is window_size, but smaller for high frequnecy data
"""Use the Savitzky-Golay to smooth the data and calculate the first derivative. It wses scipy.signal.savgol_filter. The Savitzky-Golay is very similar to the sliding polynomial fit, but slightly noisier, and much faster
121
101
102
+
:param np.array[float] x: array of time series to differentiate
103
+
:param float dt: time step size
104
+
:param list params: (**deprecated**, prefer :code:`polynomial_order`, :code:`window_size`, and :code:`smoothing_win`)
105
+
:param dict options: (**deprecated**)
106
+
:param int polynomial_order: order of the polynomial
107
+
:param int window_size: size of the sliding window, must be odd (if not, 1 is added)
108
+
:param int smoothing_win: size of the window used for gaussian smoothing, a good default is window_size, but smaller for high frequnecy data
122
109
123
-
:rtype: tuple -> (np.array, np.array)
110
+
:return: tuple[np.array, np.array] of\n
111
+
- **x_hat** -- estimated (smoothed) x
112
+
- **dxdt_hat** -- estimated derivative of x
124
113
"""
125
-
n, window_size, smoothing_win=params
114
+
ifparams!=None: # Warning to support old interface for a while. Remove these lines along with params in a future release.
115
+
warn("""`params` and `options` parameters will be removed in a future version. Use `polynomial_order`,
116
+
`window_size`, and `smoothing_win` instead.""", DeprecationWarning)
0 commit comments