

def ss_diff(x, a, b, period=None, _cache=_cache):
    '\n    Return (a,b)-sinh/sinh pseudo-derivative of a periodic sequence x.\n\n    If x_j and y_j are Fourier coefficients of periodic functions x\n    and y, respectively, then::\n\n      y_j = sinh(j*a*2*pi/period)/sinh(j*b*2*pi/period) * x_j\n      y_0 = a/b * x_0\n\n    Parameters\n    ----------\n    x : array_like\n        The array to take the pseudo-derivative from.\n    a,b\n        Defines the parameters of the sinh/sinh pseudo-differential\n        operator.\n    period : float, optional\n        The period of the sequence x. Default is ``2*pi``.\n\n    Notes\n    -----\n    ``ss_diff(ss_diff(x,a,b),b,a) == x``\n\n    '
    tmp = asarray(x)
    if iscomplexobj(tmp):
        return (ss_diff(tmp.real, a, b, period) + (1j * ss_diff(tmp.imag, a, b, period)))
    if (period is not None):
        a = (((a * 2) * pi) / period)
        b = (((b * 2) * pi) / period)
    n = len(x)
    omega = _cache.get((n, a, b))
    if (omega is None):
        if (len(_cache) > 20):
            while _cache:
                _cache.popitem()

        def kernel(k, a=a, b=b):
            if k:
                return (sinh((a * k)) / sinh((b * k)))
            return (float(a) / b)
        omega = convolve.init_convolution_kernel(n, kernel)
        _cache[(n, a, b)] = omega
    overwrite_x = _datacopied(tmp, x)
    return convolve.convolve(tmp, omega, overwrite_x=overwrite_x)

dataset/ETHPy150Open scipy/scipy/scipy/fftpack/pseudo_diffs.py ss_diff/original