MCPcopy Create free account
hub / github.com/PyWavelets/pywt / waverecn

Function waverecn

pywt/_multilevel.py:461–578  ·  view source on GitHub ↗

Multilevel nD Inverse Discrete Wavelet Transform. coeffs : array_like Coefficients list [cAn, {details_level_n}, ... {details_level_1}] wavelet : Wavelet object or name string, or tuple of wavelets Wavelet to use. This can also be a tuple containing a wavelet to

(coeffs, wavelet, mode='symmetric', axes=None)

Source from the content-addressed store, hash-verified

459
460
461def waverecn(coeffs, wavelet, mode='symmetric', axes=None):
462 """
463 Multilevel nD Inverse Discrete Wavelet Transform.
464
465 coeffs : array_like
466 Coefficients list [cAn, {details_level_n}, ... {details_level_1}]
467 wavelet : Wavelet object or name string, or tuple of wavelets
468 Wavelet to use. This can also be a tuple containing a wavelet to
469 apply along each axis in ``axes``.
470 mode : str or tuple of str, optional
471 Signal extension mode, see :ref:`Modes <ref-modes>`. This can
472 also be a tuple containing a mode to apply along each axis in ``axes``.
473 axes : sequence of ints, optional
474 Axes over which to compute the IDWT. Axes may not be repeated.
475
476 Returns
477 -------
478 nD array of reconstructed data.
479
480 Notes
481 -----
482 It may sometimes be desired to run ``waverecn`` with some sets of
483 coefficients omitted. This can best be done by setting the corresponding
484 arrays to zero arrays of matching shape and dtype. Explicitly removing
485 list or dictionary entries or setting them to None is not supported.
486
487 Specifically, to ignore all detail coefficients at level 2, one could do::
488
489 coeffs[-2] = {k: np.zeros_like(v) for k, v in coeffs[-2].items()}
490
491 Examples
492 --------
493 >>> import numpy as np
494 >>> from pywt import wavedecn, waverecn
495 >>> coeffs = wavedecn(np.ones((4, 4, 4)), 'db1')
496 >>> # Levels:
497 >>> len(coeffs)-1
498 2
499 >>> waverecn(coeffs, 'db1')
500 array([[[ 1., 1., 1., 1.],
501 [ 1., 1., 1., 1.],
502 [ 1., 1., 1., 1.],
503 [ 1., 1., 1., 1.]],
504 [[ 1., 1., 1., 1.],
505 [ 1., 1., 1., 1.],
506 [ 1., 1., 1., 1.],
507 [ 1., 1., 1., 1.]],
508 [[ 1., 1., 1., 1.],
509 [ 1., 1., 1., 1.],
510 [ 1., 1., 1., 1.],
511 [ 1., 1., 1., 1.]],
512 [[ 1., 1., 1., 1.],
513 [ 1., 1., 1., 1.],
514 [ 1., 1., 1., 1.],
515 [ 1., 1., 1., 1.]]])
516
517 """
518 if len(coeffs) < 1:

Callers

nothing calls this directly

Calls 2

_match_coeff_dimsFunction · 0.85
idwtnFunction · 0.85

Tested by

no test coverage detected