Commit 4069eb00 authored by Philipp Frank's avatar Philipp Frank

repair smooth_linear_amplitude and docs

parent 53d42bea
...@@ -29,7 +29,10 @@ from ..sugar import makeOp ...@@ -29,7 +29,10 @@ from ..sugar import makeOp
def _ceps_kernel(dof_space, k, a, k0): def _ceps_kernel(dof_space, k, a, k0):
return a**2/(1 + (k/k0)**2)**2 res = 1.
for i in range(len(k0)):
res += (k[i]/k0[i])**2
return a**2/(res)**2
def CepstrumOperator(target, a, k0): def CepstrumOperator(target, a, k0):
...@@ -56,24 +59,35 @@ def CepstrumOperator(target, a, k0): ...@@ -56,24 +59,35 @@ def CepstrumOperator(target, a, k0):
amplitude whenever :class:`CepstrumOperator` is used as in amplitude whenever :class:`CepstrumOperator` is used as in
:class:`SLAmplitude`. :class:`SLAmplitude`.
FIXME The prior on the zero mode is ... The prior on the zero mode, or zero subspaces in the case of dim > 1,
is the integral of the prior of all other modes along the corresponding
axis.
Parameters Parameters
---------- ----------
target : LogRGSpace target : LogRGSpace
Target domain of the operator, needs to be non-harmonic and Target domain of the operator, needs to be non-harmonic.
one-dimensional.
a : float a : float
Strength of smoothness prior (positive only). FIXME Cutoff of smoothness prior (positive only). Controls the
k0 : float regularization of the inverse laplace operator to be finite at zero.
Cutoff of smothness prior in quefrency space (positive only). FIXME Larger values for the cutoff results in a weaker constraining prior.
k0 : float, list of float
Strength of smothness prior in quefrency space (positive only) along
each axis. If float then the strength is the same along each axis.
Larger values result in a weaker constraining prior.
''' '''
a, k0 = float(a), float(k0) a = float(a)
target = DomainTuple.make(target) target = DomainTuple.make(target)
if a <= 0 or k0 <= 0: if a <= 0:
raise ValueError raise ValueError
if len(target) > 1 or target[0].harmonic or len(target[0].shape) > 1: if len(target) > 1 or target[0].harmonic:
raise TypeError raise TypeError
if isinstance(k0, float):
k0 = (k0, )*len(target.shape)
elif len(k0) != len(target.shape):
raise ValueError
if np.any(np.array(k0) <= 0):
raise ValueError
qht = QHTOperator(target) qht = QHTOperator(target)
dom = qht.domain[0] dom = qht.domain[0]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment