Other functions

Single-level n-dimensional Discrete Wavelet Transform.

pywt.dwtn(data, wavelet[, mode='sym'])

Performs single-level n-dimensional Discrete Wavelet Transform.

Parameters:
  • data – n-dimensional array
  • wavelet – Wavelet to use in the transform. This can be a name of the wavelet from the wavelist() list or a Wavelet object instance.
  • mode – Signal extension mode to deal with the border distortion problem. See MODES for details.

Results are arranged in a dictionary, where key specifies the transform type on each dimension and value is a n-dimensional coefficients array.

For example, for a 2D case the result will look something like this:

{
    'aa': <coeffs>  # A(LL) - approx. on 1st dim, approx. on 2nd dim
    'ad': <coeffs>  # H(LH) - approx. on 1st dim, det. on 2nd dim
    'da': <coeffs>  # V(HL) - det. on 1st dim, approx. on 2nd dim
    'dd': <coeffs>  # D(HH) - det. on 1st dim, det. on 2nd dim
}

Integrating wavelet functions - intwave()

pywt.intwave(wavelet[, precision=8])

Integration of wavelet function approximations as well as any other signals can be performed using the pywt.intwave() function.

The result of the call depends on the wavelet argument:

  • for orthogonal wavelets - an integral of the wavelet function specified on an x-grid:

    [int_psi, x] = intwave(wavelet, precision)
    
  • for other wavelets - integrals of decomposition and reconstruction wavelet functions and a corresponding x-grid:

    [int_psi_d, int_psi_r, x] = intwave(wavelet, precision)
    
  • for a tuple of coefficients data and a x-grid - an integral of function and the given x-grid is returned (the x-grid is used for computations).:

    [int_function, x] = intwave((data, x), precision)
    

Example:

>>> import pywt
>>> wavelet1 = pywt.Wavelet('db2')
>>> [int_psi, x] = pywt.intwave(wavelet1, precision=5)
>>> wavelet2 = pywt.Wavelet('bior1.3')
>>> [int_psi_d, int_psi_r, x] = pywt.intwave(wavelet2, precision=5)

Central frequency of psi wavelet function

pywt.centfrq(wavelet[, precision=8])
pywt.centfrq((function_approx, x))
Parameters:
  • waveletWavelet, wavelet name string or (wavelet function approx., x grid) pair
  • precision – Precision that will be used for wavelet function approximation computed with the Wavelet.wavefun() method.

Table Of Contents

Previous topic

Thresholding functions

Next topic

Usage examples

Python Development

Django web development for startups and businesses.

Quality Python development and scientific applications.

Quick links

Edit this document

The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.