Skip to main content

A universal C++ compression library based on wavelet transformation

Project description

wavelet-buffer

A python wrapper for WaveletBuffer Framework

Install from PyPI

pip install wavelet-buffer

Install from repo

pip install git+https://github.com/panda-official/WaveletBuffer.git#subdirectory=python

Examples

import numpy as np
from wavelet_buffer import WaveletBuffer, WaveletType, denoise

signal = np.sin(np.linspace(0, np.pi, 100) * 10)
print(f"Original signal: {signal[0:10]}")

buffer = WaveletBuffer(signal_shape=signal.shape, signal_number=1,
                       decomposition_steps=2, wavelet_type=WaveletType.DB3)

# Denoise and serialize data
buffer.decompose(signal, denoise.Threshold(0, 0.05))
arch = buffer.serialize(compression_level=16)

print(f"Size of archive: {len(arch)} bytes")

# Restore data from archive
buffer: WaveletBuffer = WaveletBuffer.parse(arch)
restored_signal = buffer.compose()
print(f"Restored signal: {restored_signal[0:10]}")

for more examples please check examples/ folder

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wavelet-buffer-0.1.0.tar.gz (12.4 kB view hashes)

Uploaded Source

Built Distributions

wavelet_buffer-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (412.2 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

wavelet_buffer-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (412.4 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

wavelet_buffer-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (412.1 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page