Multilevel nD Discrete Wavelet Transform. Parameters ---------- data : ndarray nD input data wavelet : Wavelet object or name string, or tuple of wavelets Wavelet to use. This can also be a tuple containing a wavelet to apply along each axis in ``axes``
(data, wavelet, mode='symmetric', level=None, axes=None)
| 358 | |
| 359 | |
| 360 | def wavedecn(data, wavelet, mode='symmetric', level=None, axes=None): |
| 361 | """ |
| 362 | Multilevel nD Discrete Wavelet Transform. |
| 363 | |
| 364 | Parameters |
| 365 | ---------- |
| 366 | data : ndarray |
| 367 | nD input data |
| 368 | wavelet : Wavelet object or name string, or tuple of wavelets |
| 369 | Wavelet to use. This can also be a tuple containing a wavelet to |
| 370 | apply along each axis in ``axes``. |
| 371 | mode : str or tuple of str, optional |
| 372 | Signal extension mode, see :ref:`Modes <ref-modes>`. This can |
| 373 | also be a tuple containing a mode to apply along each axis in ``axes``. |
| 374 | level : int, optional |
| 375 | Decomposition level (must be >= 0). If level is None (default) then it |
| 376 | will be calculated using the ``dwt_max_level`` function. |
| 377 | axes : sequence of ints, optional |
| 378 | Axes over which to compute the DWT. Axes may not be repeated. The |
| 379 | default is None, which means transform all axes |
| 380 | (``axes = range(data.ndim)``). |
| 381 | |
| 382 | Returns |
| 383 | ------- |
| 384 | [cAn, {details_level_n}, ... {details_level_1}] : list |
| 385 | Coefficients list. Coefficients are listed in descending order of |
| 386 | decomposition level. ``cAn`` are the approximation coefficients at |
| 387 | level ``n``. Each ``details_level_i`` element is a dictionary |
| 388 | containing detail coefficients at level ``i`` of the decomposition. As |
| 389 | a concrete example, a 3D decomposition would have the following set of |
| 390 | keys in each ``details_level_i`` dictionary:: |
| 391 | |
| 392 | {'aad', 'ada', 'daa', 'add', 'dad', 'dda', 'ddd'} |
| 393 | |
| 394 | where the order of the characters in each key map to the specified |
| 395 | ``axes``. |
| 396 | |
| 397 | Examples |
| 398 | -------- |
| 399 | >>> import numpy as np |
| 400 | >>> from pywt import wavedecn, waverecn |
| 401 | >>> coeffs = wavedecn(np.ones((4, 4, 4)), 'db1') |
| 402 | >>> # Levels: |
| 403 | >>> len(coeffs)-1 |
| 404 | 2 |
| 405 | >>> waverecn(coeffs, 'db1') |
| 406 | array([[[ 1., 1., 1., 1.], |
| 407 | [ 1., 1., 1., 1.], |
| 408 | [ 1., 1., 1., 1.], |
| 409 | [ 1., 1., 1., 1.]], |
| 410 | [[ 1., 1., 1., 1.], |
| 411 | [ 1., 1., 1., 1.], |
| 412 | [ 1., 1., 1., 1.], |
| 413 | [ 1., 1., 1., 1.]], |
| 414 | [[ 1., 1., 1., 1.], |
| 415 | [ 1., 1., 1., 1.], |
| 416 | [ 1., 1., 1., 1.], |
| 417 | [ 1., 1., 1., 1.]], |
nothing calls this directly
no test coverage detected