stationary-wavelet-packet-transform icon indicating copy to clipboard operation
stationary-wavelet-packet-transform copied to clipboard

An implementation of the stationary wavelet packet transform on top of PyWavelets

instalation

pip install git+https://github.com/kesmarag/stationary-wavelet-packet-transform.git

example

import numpy as np
import matplotlib.pyplot as plt
from kesmarag.swpt import SWPT

signal = np.random.randn(1024,)
model = SWPT(max_level=3)
model.decompose(signal)
res = model.get_level(3)
'''
  level 1 => (0.A, 1.D)
  level 2 => (0.AA, 1.AD), (3.DA, 2.DD)
  level 3 => (0.AAA, 1.AAD), (3.ADA, 2.ADD), (7.DAA, 6.DAD), (4.DDA, 5.DDD)
'''
plt.pcolor(res)
plt.show()