Implementation of different “Mother Shearlets”

The classes, functions and objects in this module make it (comparatively) easy to define custom generating functions which act as “Mother shearlets”.

Warning

Implementing custom “Mother shearlets” is a complex task and thus should only be done if really needed. Proceed with caution.

To implement a custom set of generating functions, all one needs to do is to create a suitable object of the class MotherShearlet and pass it to the constructor of the AlphaTransform.AlphaShearletTransform, via the mother_shearlet parameter.

In a nutshell, in our implementation, a shearlet system is determined by

  • A low-pass filter which is given by \phi \otimes \phi, where \phi is given by the low_pass_function attribute of class MotherShearlet.

  • A mother shearlet \psi, which in our case is (in Fourier domain) given by

    \widehat{\psi}(\xi) = \psi_1 (\xi_1) \cdot \psi_2 (\xi_2 / \xi_1).

    Here,

    • we call \psi_1 the scale-sensitive generating function. It is given by the scale_function` attribute of class MotherShearlet.
    • we call \psi_2 the direction sensitive generating function. It is given by the direction_function attribute of class MotherShearlet.

See the documentation of MotherShearlet below for more details.

The class BumpFunction

class MotherShearlets.BumpFunction

Each instance of this class encapsulates a specific (one-dimensional) bump function f.

Attributes:

support

A tuple (a,b) such that the bump function f modeled by this object satisfies \mathrm{supp} f \subset (a,b).

large_support

A tuple (a,b) such that the bump function f modeled by this object is “large” on (a,b), i.e., |f| \geq c > 0 on (a,b) for a (reasonably large) constant c>0, e.g. c = \frac{1}{2}.

call

A callable object calculating f(x) given x. This should be vectorized, i.e., call() should accept numpy arrays (numpy.ndarray) and apply f componentwise.

theano_call

This should be a callable object doing the same as call, but working on theano.tensor.dmatrix objects.

Note

Currently, this attribute is not used anywhere and can thus be set arbitrarily (e.g. to None).

The class MotherShearlet

class MotherShearlets.MotherShearlet

Each instance of this class acts as a container for the three (main) components determining an alpha-shearlet system.

The actual mother shearlet \psi is given by

\psi(\xi) = \psi_1 (\xi_1) \cdot \psi_2 (\xi_2 / \xi_1),

where:
  • \psi_1 is given by the scale_function attribute,
  • \psi_2 is given by the direction_function attribute.

Finally, the low frequency component of the shearlet system is given by \phi \otimes \phi (tensor product), where \phi is given by the low_pass_function attribute.

Note

All attributes are expected to be of type BumpFunction.

Finally,

  1. if (a,b) = scale_function.large_support, then it is expected that:
    1. a,b > 0
    2. b/a >= 2.
  2. if (a,b) = direction_function.large_support, it is expected that:
    1. b >= 1/2,
    2. a <= -1/2.

Meyer mother shearlet implementation

The object MotherShearlets.MeyerMotherShearlet is an instance of MotherShearlet.

It uses

MotherShearlets.meyer(A)

This function implements the function v from the paper Fast Finite Shearlet Transform.

It rises smoothly between 0 and 1. In particular, v(x) = 0 for x \leq 0 and v(x) = 1 for x \geq 1.

Parameters:

Parameters:A (numpy.ndarray) – The input (matrix with real entries).

Return value:

Returns:v(A), i.e. the function v applied to each entry of A.
MotherShearlets.meyer_scale_function(R)

This is an implementation of the function \tilde{W} from the paper Cartoon approximation with α-Curvelets.

The main properties of this function are the following:
  1. \mathrm{supp} \tilde{W} \subset [1/2, 2].
  2. \tilde{W} \equiv 1 on [3/4, 3/2].

Note

The quotient of the bounds of the interval where \tilde{W} is 1 is precisely 3/2 * 4/3 = 2, so that the function is suitable as a scale_function for the MotherShearlet class.

Parameters:

Parameters:R (numpy.ndarray) – The input (matrix with real entries).

Return value:

Returns:\tilde{W}(R), i.e., \tilde{W} applied componentwise.
MotherShearlets.meyer_low_pass(A)

This function uses the meyer() function to construct a bump function \phi with the following properties:

  1. \mathrm{supp} \phi \subset [-2,2],
  2. \phi(x) = 1 for x \in (-3/2, 3/2).

Parameters:

Parameters:A (numpy.ndarray) – The input (matrix with real entries).

Return value:

Returns:\phi(A), i.e. the function \phi applied to each entry of A. Precisely, \phi(x) = 4 - 2 * v(|x|), where v is the function meyer().
MotherShearlets.meyer_direction_function(A)

This is an implementation of a direction function f, i.e., it can be used for the attribute direction_function of the class MotherShearlet.

The main properties of this function are the following:
  1. \mathrm{supp} f \subset (-1,1),
  2. f \equiv 1 on (-1/2, 1/2),
  3. f is symmetric.

The implementation uses the meyer() function.

Parameters:

Parameters:A (numpy.ndarray) – The input (matrix with real entries).

Return value:

Returns:f(A), i.e. f is applied componentwise.

Haeuser mother shearlet implementation

The Häuser mother shearlet is the one which is used in the paper Fast Finite Shearlet Transform by S. Häuser and G. Steidl. In our implementation, it is represented by the object MotherShearlets.HaeuserMotherShearlet, which is an instance of MotherShearlet.

It uses

MotherShearlets.haeuser_scale_function(A)

This is an implementation of the function b from the paper Fast Finite Shearlet Transform, but with support restricted to positive numbers, whereas in the paper, the function is symmetric.

This function is supported in [1,4], is “large” on [2,3] and satisfies \sum_{j=-\infty}^\infty b(2^j x) = 1 for all x > 0.

Furthermore, b(x) \geq \frac{1}{\sqrt{2}} \geq \frac{1}{2} for x \in [1.5, 3]. Thus, b is a good candidate for a scale_function, cf. MotherShearlet.

Parameters:

Parameters:A (numpy.ndarray) – The input (a matrix with real entries).

Return value:

Returns:b(A), i.e., b is applied componentwise.
MotherShearlets.haeuser_direction_function(A)

This is an implementation of the function \widehat{\psi_2} from the paper Fast Finite Shearlet Transform (cf. eq. (6) in that paper).

This function has support in [-1,1], is “large” on [-1/2,1/2] and satisfies \sum_{j=-\infty}^\infty |\widehat{\psi_2}(x + j)|^2 = 1 for all x.

Thus, \widehat{\psi_2} is a good candidate for a direction_function, cf. MotherShearlet.

Parameters:

Parameters:A (numpy.ndarray) – The input (a matrix with real entries).

Return value

Returns:\widehat{\psi_2}(A), i.e., \widehat{\psi_2} is applied componentwise.

Indicator mother shearlet implementation

The “indicator” mother shearlet is a mother shearlet which is used purely for testing purposes. The low-pass part and the mother shearlet determined by its generating functions are indicator functions in the Fourier domain. Hence, a shearlet system using this mother shearlet will have very bad time localization.

The “indicator” mother shearlet is represented by the object MotherShearlets.IndicatorMotherShearlet, which is an instance of MotherShearlet. It uses

  • \chi_{[-1,1]} as the low-pass part of the set of generating functions,
  • \chi_{[1,2]} as the scale-sensitive generating function, and
  • \chi_{[-1/2, 1/2]} as the direction sensitive generating function.
MotherShearlets.indicator_scale_function(A)

Vectorized implementation of the indicator function \chi_{[1,2]}, which can be used as a scale_function, mainly for testing purposes (since the space localization is horrible).

Parameters:

Parameters:A (numpy.ndarray) – The input (matrix with real entries).

Return value:

Returns:\chi_{[1,2]}(A), applied componentwise.
MotherShearlets.indicator_low_pass_function(A)

Vectorized implementation of the indicator function \chi_{[-1,1]}, which can be used as a low_pass_function, mainly for testing purposes (since the space localization is horrible).

Parameters:

Parameters:A (numpy.ndarray) – The input (matrix with real entries).

Return value:

Returns:\chi_{[-1,1]}(A), applied componentwise.