https://github.com/ap-atul/wavelets
A simple and easy implementation of Wavelet Transform
https://github.com/ap-atul/wavelets
compression denoising discrete-wavelet-transform wavelet-transform wavelets
Last synced: 10 months ago
JSON representation
A simple and easy implementation of Wavelet Transform
- Host: GitHub
- URL: https://github.com/ap-atul/wavelets
- Owner: AP-Atul
- License: mit
- Created: 2020-10-23T12:01:53.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-14T17:00:51.000Z (about 5 years ago)
- Last Synced: 2024-05-21T07:19:44.252Z (over 1 year ago)
- Topics: compression, denoising, discrete-wavelet-transform, wavelet-transform, wavelets
- Language: Python
- Homepage: https://ap-atul.github.io/wavelet
- Size: 213 KB
- Stars: 22
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Wavelets
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.
## Introduction
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.
## API
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/```
## Installation
1. Install using pip
```console
pip install git+https://github.com/AP-Atul/wavelets
```
2. Clone the repo and run setup
```console
git clone https://github.com/AP-Atul/wavelets.git
python setup.py install
```
## Examples
1. Wavelet decomposition and reconstruction
```python
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)
```
2. Simple discrete transforms
```python
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))
```
## Applications
(I'll try to provide some examples for this)
1. Audio de-noising by cleaning the noise signal from the coefficients
2. Data cleaning in the sense of Data Mining
3. Data compression
4. Digital Communications
5. Image Processing
6. etc.
## Limitations
The performance can be improved. Help to make it even better by contributing