Python implementation of the Fast Wavelet Transform (FWT) on 1D, 2D, and 3D(soon) input signals/data. The common wavelets like Haar, and Daubechies is available, along with 60+ wavelets.
The code is according to the software development process, so hopefully its user-friendly or dev-friendly.
The simple Wavelet Transform is given by the formula
The fundamental idea of wavelet transforms is that the transformation should allow only changes in time extension, but not shape. This is affected by choosing suitable basis functions that allow for this. Changes in the time extension are expected to conform to the corresponding analysis frequency of the basis function.
Dimension implemented (1D, 2D)
Just call waveDec
for wavelet decomposition for any dim, length array
And waveRec
for wavelet reconstruction for any dim, length array
Update: Use it with any length of data. (1D & 2D)
Check the examples/
for some examples on the usage. Refer the html docs/
- Install using pip
pip install git+https://github.com/AP-Atul/wavelets
- Clone the repo and run setup
git clone https://github.com/AP-Atul/wavelets.git
python setup.py install
- Wavelet decomposition and reconstruction
from wavelet import FastWaveletTransform
WAVELET_NAME = "db4"
t = FastWaveletTransform(WAVELET_NAME)
# original data
data = [1, 1, 1, 1, 1, 1, 1, 1]
# decomposition --> reconstruction
coefficients = t.waveDec(data)
data = t.waveRec(coefficients)
- Simple discrete transforms
from wavelet import WaveletTransform, getExponent
transform = WaveletTransform(waveletName="db2")
data = [1, 2, 3, 4, 5, 6, 7, 9]
# dwt with max level
coefficients = transform.dwt(data, level=getExponent(len(data)))
# inverse dwt with max level
data = transform.idwt(coefficients, level=len(coefficients))
(I'll try to provide some examples for this)
- Audio de-noising by cleaning the noise signal from the coefficients
- Data cleaning in the sense of Data Mining
- Data compression
- Digital Communications
- Image Processing
- etc.
The performance can be improved. Help to make it even better by contributing