bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / fftpack / _pseudo_diffs / diff
function
scipy.fftpack._pseudo_diffs:diff
source: build-install/usr/lib/python3.14/site-packages/scipy/fftpack/_pseudo_diffs.py:22
Signature
def diff(x, order = 1, period = None, _cache = <_thread._local object at 0x0000>)Summary
Return kth derivative (or integral) of a periodic sequence x.
Extended Summary
If x_j and y_j are Fourier coefficients of periodic functions x and y, respectively, then
y_j = pow(sqrt(-1)*j*2*pi/period, order) * x_j y_0 = 0 if order is not 0.
Parameters
x: array_likeInput array.
order: int, optionalThe order of differentiation. Default order is 1. If order is negative, then integration is carried out under the assumption that
x_0 == 0.period: float, optionalThe assumed period of the sequence. Default is
2*pi.
Notes
If sum(x, axis=0) = 0 then diff(diff(x, k), -k) == x (within numerical accuracy).
For odd order and even len(x), the Nyquist mode is taken zero.
Aliases
scipy.fftpack.diff