def cc_diff(x, a, b, period=None, _cache=_cache):
tmp = asarray(x)<EOL>if iscomplexobj(tmp):<EOL><INDENT>return cc_diff(tmp.real,a,b,period) +<NUM_LIT>*cc_diff(tmp.imag,a,b,period)<EOL><DEDENT>if period is not None:<EOL><INDENT>a = a*<NUM_LIT:2>*pi/period<EOL>b = b*<NUM_LIT:2>*pi/period<EOL><DEDENT>n = len(x)<EOL>omega = _cache.get((n,a,b))<EOL>if omega is None:<EOL><INDENT>if len(_cache) > <NUM_LIT:20>:<EOL><INDENT>while _cache:<EOL><INDENT>_cache.popitem()<EOL><DEDENT><DEDENT>def kernel(k,a=a,b=b):<EOL><INDENT>return cosh(a*k)/cosh(b*k)<EOL><DEDENT>omega = convolve.init_convolution_kernel(n,kernel)<EOL>_cache[(n,a,b)] = omega<EOL><DEDENT>overwrite_x = _datacopied(tmp, x)<EOL>return convolve.convolve(tmp,omega,overwrite_x=overwrite_x)<EOL>
Return (a,b)-cosh/cosh pseudo-derivative of a periodic sequence.

If x_j and y_j are Fourier coefficients of periodic functions x
and y, respectively, then::

  y_j = cosh(j*a*2*pi/period)/cosh(j*b*2*pi/period) * x_j

Parameters
----------
x : array_like
    The array to take the pseudo-derivative from.
a,b : float
    Defines the parameters of the sinh/sinh pseudo-differential
    operator.
period : float, optional
    The period of the sequence x. Default is ``2*pi``.

Returns
-------
cc_diff : ndarray
    Pseudo-derivative of periodic sequence `x`.

Notes
-----
``cc_diff(cc_diff(x,a,b),b,a) == x``