| 1 | --- |
| 2 | title: 'PyWavelets: A Python package for wavelet analysis' |
| 3 | tags: |
| 4 | - Python |
| 5 | - wavelets |
| 6 | - wavelet packets |
| 7 | - discrete wavelet transform |
| 8 | - continuous wavelet transform |
| 9 | - computational harmonic analysis |
| 10 | authors: |
| 11 | - name: Gregory R. Lee |
| 12 | orcid: 0000-0001-8895-2740 |
| 13 | affiliation: "1, 2" # (Multiple affiliations must be quoted) |
| 14 | - name: Ralf Gommers |
| 15 | orcid: 0000-0002-0300-3333 |
| 16 | affiliation: "3, 4" |
| 17 | - name: Filip Waselewski |
| 18 | orcid: 0000-0003-0729-5879 |
| 19 | affiliation: 6 |
| 20 | - name: Kai Wohlfahrt |
| 21 | orcid: 0000-0002-0970-5539 |
| 22 | affiliation: 5 |
| 23 | - name: Aaron O’Leary |
| 24 | orcid: 0000-0003-1984-2323 |
| 25 | affiliation: 6 |
| 26 | affiliations: |
| 27 | - name: Department of Radiology, Cincinnati Children's Hospital Medical Center, Cincinnati, OH, USA |
| 28 | index: 1 |
| 29 | - name: Department of Radiology, University of Cincinnati School of Medicine, Cincinnati, OH, USA |
| 30 | index: 2 |
| 31 | - name: Scion, 49 Sala Street, Private Bag 3020, Rotorua 3046, New Zealand |
| 32 | index: 3 |
| 33 | - name: FPInnovations, 2665 East Mall, Vancouver, BC V6T 1Z4, Canada |
| 34 | index: 4 |
| 35 | - name: Department of Biochemistry, University of Cambridge, Old Addenbrookes Site, 80 Tennis Court Road, Cambridge, CB2 1GA, United Kingdom |
| 36 | index: 5 |
| 37 | - name: None |
| 38 | index: 6 |
| 39 | |
| 40 | date: 24 August 2018 |
| 41 | bibliography: paper.bib |
| 42 | --- |
| 43 | |
| 44 | # Summary |
| 45 | |
| 46 | Wavelets are a popular tool for computational harmonic analysis. They provide |
| 47 | localization in both the temporal (or spatial) domain as well as in the |
| 48 | frequency domain [@Daubechies1992]. A prominent feature is the ability to |
| 49 | perform a multiresolution analysis [@mallat2008wavelet]. The wavelet transform |
| 50 | of natural signals and images tends to have most of its energy concentrated in |
| 51 | a small fraction of the coefficients. This sparse representation property is |
| 52 | key to the good performance of wavelets in applications such as data |
| 53 | compression and denoising. For example, the wavelet transform is a key |
| 54 | component of the JPEG 2000 image compression standard. |
| 55 | |
| 56 | ``PyWavelets`` is a Python package implementing a number of n-dimensional |
| 57 | discrete wavelet transforms as well as the 1D continuous wavelet transform. A |
| 58 | wide variety of predefined wavelets are provided and it is possible for users |
| 59 | to specify custom wavelet filter banks. All discrete wavelet transforms are |
| 60 | implemented by convolution with finite impulse response filters. The required |
| 61 | up/downsampling convolutions are implemented in C for good performance. |
| 62 | Cython [@cython] is used to wrap the C code and implement axis-specific 1D |
| 63 | transformations based on the low-level C routines. All multi-dimensional |
| 64 | transforms are implemented in Python via separable application of the 1D |
| 65 | transforms. The API for ``PyWavelets`` was designed to be similar to Matlab's |
| 66 | wavelet toolbox and functions such as the 1D, 2D and 3D discrete wavelet |
| 67 | transforms are tested for accuracy vs. their Matlab counterparts. PyWavelets |
| 68 | has additional functionality not common in other wavelet toolboxes such as |
| 69 | support for dimension $n > 3$ and support for both real and complex-valued |
| 70 | data in either single or double precision. It is also possible to transform |
| 71 | only a subset of axes and to vary the wavelet and signal boundary extension |
| 72 | mode on a per-axis basis. |
| 73 | |
| 74 | ``PyWavelets`` was designed for use by scientists working within a range of |
| 75 | applications including time-series analysis, signal processing, image |
| 76 | processing and medical imaging. It has already been adopted as a required |
| 77 | or optional dependency by a number of other software projects. For example, |
| 78 | it has enabled wavelet-based image denoising in scikit-image [@scikit-image]. |
| 79 | The Operator Discretization Library (ODL) [@odl] uses PyWavelets to enable |
| 80 | wavelet-based regularization in iterative inverse problems such as computed |
| 81 | tomography image reconstruction. Another related package which is independent |
| 82 | of ``PyWavelets`` is Kymatio, which implements the wavelet scattering |
| 83 | transform in 1D-3D [@kymatio]. The current implementation in Kymatio uses |
| 84 | non-separable 2D and 3D wavelets defined in the frequency domain and is well |
| 85 | suited to signal classification tasks, but does not have a simple inverse |
| 86 | transform like the standard discrete wavelet transform. |
| 87 | |
| 88 | A number of common 1D demo signals used in the literature and in the manuscript |
| 89 | by Stephan Mallat [-@mallat2008wavelet] are provided for use in teaching and for |
| 90 | purposes of reproducible research. |
| 91 | |
| 92 | # Acknowledgements |
| 93 | |
| 94 | We would to acknowledge the various PyWavelets contributors for their |
| 95 | contributions to the library, and specifically Holger Nahrstaedt for |
| 96 | contributing a continuous wavelet transform. |
| 97 | |
| 98 | # References |