Skip to main content

A universal C++ compression library based on wavelet transformation

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

example workflow codecov

WaveletBuffer

A universal C++ compression library based on wavelet transformation

Features

  • Written in Modern C++
  • One-side wavelet decomposition for vectors and matrixes
  • 5 Daubechies Wavelets DB1-DB5
  • Different denoising algorithms
  • Fast and efficient compression with SFCompressor
  • Cross-platform

Requirements

  • CMake >= 3.16
  • C++20 compiler
  • conan >= 1.53

Bindings

Usage Example

#include <wavelet_buffer/wavelet_buffer.h>

using drift::Signal1D;
using drift::WaveletBuffer;
using drift::WaveletParameters;
using drift::WaveletTypes;
using DenoiseAlgo = drift::ThresholdAbsDenoiseAlgorithm<float>;

int main() {
  Signal1D original = blaze::generate(
      1000, [](auto index) { return static_cast<float>(index % 100); });

  std::cout << "Original size: " << original.size() * 4 << std::endl;
  WaveletBuffer buffer(WaveletParameters{
      .signal_shape = {original.size()},
      .signal_number = 1,
      .decomposition_steps = 3,
      .wavelet_type = WaveletTypes::kDB1,
  });

  // Wavelet decomposition of the signal and denoising
  buffer.Decompose(original, DenoiseAlgo(0, 0.3));

  // Compress the buffer
  std::string arch;
  buffer.Serialize(&arch, 16);
  std::cout << "Compressed size: " << arch.size() << std::endl;

  // Decompress the buffer
  auto restored_buffer = WaveletBuffer::Parse(arch);
  Signal1D output_signal;

  // Restore the signal from wavelet decomposition
  restored_buffer->Compose(&output_signal);

  std::cout << "Distance between original and restored signal: "
            << blaze::norm(original - output_signal) / original.size()
            << std::endl;
  std::cout << "Compression rate: " << original.size() * 4. / arch.size() * 100
            << "%" << std::endl;
}

Build and Installing

On Ubuntu:

git clone https://github.com/panda-official/WaveletBuffer.git

mkdir build && cd build
cmake -DWB_BUILD_TESTS=ON -DWB_BUILD_BENCHMARKS=ON -DWB_BUILD_EXAMPLES=ON -DCODE_COVERAGE=ON ..
cmake --build . --target install

On MacOS:

git clone https://github.com/panda-official/WaveletBuffer.git
mkdir build && cd build
cmake -DWB_BUILD_TESTS=ON -DWB_BUILD_BENCHMARKS=ON -DWB_BUILD_EXAMPLES=ON -DCODE_COVERAGE=ON ..
cmake --build . --target install

On Windows:

git clone https://github.com/panda-official/WaveletBuffer.git
mkdir build && cd build
cmake -DWB_BUILD_TESTS=ON -DWB_BUILD_BENCHMARKS=ON -DWB_BUILD_EXAMPLES=ON -DCODE_COVERAGE=ON ..
cmake --build . --config Release --target install

Integration

Using cmake target

find_package(wavelet_buffer REQUIRED)

add_executable(program program.cpp)
target_link_libraries(program wavelet_buffer::wavelet_buffer)

# WaveletBuffer use blaze as linear algebra library which expects you to have a LAPACK library installed
# (it will still work without LAPACK and will not be reduced in functionality, but performance may be limited)
find_package(LAPACK REQUIRED)
target_link_libraries(program ${LAPACK_LIBRARIES})

References

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.5.1.tar.gz (48.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

wavelet_buffer-0.5.1-cp310-cp310-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.10Windows x86-64

wavelet_buffer-0.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (705.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

wavelet_buffer-0.5.1-cp310-cp310-macosx_10_9_x86_64.whl (637.1 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

wavelet_buffer-0.5.1-cp39-cp39-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.9Windows x86-64

wavelet_buffer-0.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (705.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

wavelet_buffer-0.5.1-cp39-cp39-macosx_10_9_x86_64.whl (637.2 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

wavelet_buffer-0.5.1-cp38-cp38-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.8Windows x86-64

wavelet_buffer-0.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (705.4 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

wavelet_buffer-0.5.1-cp38-cp38-macosx_10_9_x86_64.whl (637.1 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

File details

Details for the file wavelet-buffer-0.5.1.tar.gz.

File metadata

  • Download URL: wavelet-buffer-0.5.1.tar.gz
  • Upload date:
  • Size: 48.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for wavelet-buffer-0.5.1.tar.gz
Algorithm Hash digest
SHA256 9ee6ef1714fdd5a2aee3763a29f2e3f4c015c07ab662d956dd979b78adc6f1dd
MD5 c8c0c5d0f59b795c1c77ac3cbc4d1679
BLAKE2b-256 c0e25756845bfae6d4ce19e4303b725c152211b4b60c3081a9b794dffa0e65c6

See more details on using hashes here.

File details

Details for the file wavelet_buffer-0.5.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for wavelet_buffer-0.5.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 da3b444ea283de39be0de968a0b716b3f8025b17a48e71a4c9121063fdfa0e2c
MD5 75cb44f7fe4441e75e4f5a74045f9fa1
BLAKE2b-256 c6b4c53c785713b7b6ef8ad0ed48ad69cd6961964105b8c870932f7909528e82

See more details on using hashes here.

File details

Details for the file wavelet_buffer-0.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for wavelet_buffer-0.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 96f40e2449f68a2d1225d005a2bf46e541327955f2789ce667d5c951f281b576
MD5 bee2d99482c677284dd24d1476b2c9f8
BLAKE2b-256 c7c772b3e28732013448ba4e7e45642f36336ad17c1565c63b19898ea32a495c

See more details on using hashes here.

File details

Details for the file wavelet_buffer-0.5.1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for wavelet_buffer-0.5.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c65cc8224fd99ac50081ebc9a5fde0bb1b0a5bf10121a2a7f8eeb2dc49eb54c1
MD5 5c17fcc4df8b633c74689e9608749240
BLAKE2b-256 33fb3128d80cd82fffff8bc12fb701f684b385251adabbab44284640cbcdee98

See more details on using hashes here.

File details

Details for the file wavelet_buffer-0.5.1-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for wavelet_buffer-0.5.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e33cdb961c7ac3990c8842bd7e9fc8a5175f4fe42680788bfe5bfc17f6271463
MD5 bb9f75b5dd59444f4b57d5f1ec62ade0
BLAKE2b-256 6aa69b1c8dbee338d3bb91bea4844bd0efd83fd745ece2afaa178d21950cc6d4

See more details on using hashes here.

File details

Details for the file wavelet_buffer-0.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for wavelet_buffer-0.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cb612fcf91a8191813218685bff151b9af0d6215704229e215ed3dc2d3f5aa33
MD5 006560991590ddff625890552ae08152
BLAKE2b-256 8a80b38a79e92a6fb54ad137d34bc9e7cb32565e91d008e863ee094a05b76e26

See more details on using hashes here.

File details

Details for the file wavelet_buffer-0.5.1-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for wavelet_buffer-0.5.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b55cbf2a342e6a88c171b655afde7272935b70a1d8b6e23a8b5e71b36cd906cd
MD5 3b1967ad14ea12862a725ca874e33e23
BLAKE2b-256 2c08d47a791001ff0c6a1470f9fdb9e3b8905d013402d3ef626b28f5eb91acee

See more details on using hashes here.

File details

Details for the file wavelet_buffer-0.5.1-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for wavelet_buffer-0.5.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 948be5500144491ff575033ecc40c6aef6726276453c713ddea35affc0050702
MD5 347276f35a7e0a934bebb227ba23c374
BLAKE2b-256 401c8b6f0f20f70ab4f6b7cb5fabfdd7b6cd98e2098015c60cfc442d7d3e141a

See more details on using hashes here.

File details

Details for the file wavelet_buffer-0.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for wavelet_buffer-0.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c073aa35bdefcb115b1c8bf6cd6ac922250ff688b2399ec353716b3be237d7e3
MD5 8c3dd36d214747e5bc79a70a613467f2
BLAKE2b-256 3b8dde13b0608ee6209c7e46d007a2afed00a275e546079ab4b95121397249e8

See more details on using hashes here.

File details

Details for the file wavelet_buffer-0.5.1-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for wavelet_buffer-0.5.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ce3be66c3ade7dda06c23c93ec33eccd1477d48f0a04482a43396807f27fef1a
MD5 4b19e6eb582291bf2ab538385c69f6fc
BLAKE2b-256 e024dfa305524525fa79bc01ab9e366782bc9cfe3a814a81d20be12933da8a0d

See more details on using hashes here.

Supported by

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