Skip to content

AP-Atul/wavelets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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
pip install git+https://github.com/AP-Atul/wavelets
  1. Clone the repo and run setup
git clone https://github.com/AP-Atul/wavelets.git
python setup.py install

Examples

  1. 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)
  1. 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))

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