A universal C++ compression library based on wavelet transformation
Project description
WaveletBuffer
A universal C++ compression library based on wavelet transformation
Features
- Written in Modern C++
- One-side wavelet decomposition for vectors and matrices
- 5 Daubechies Wavelets DB1-DB5
- Different denoising algorithms
- Fast and efficient compression with MatrixCompressor
- Cross-platform
Requirements
- CMake >= 3.16
- C++20 compiler
- conan >= 1.56, < 2.0
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
- Documentation
- Drift Protocol - Protobuf Libraries to encode message in Drift infrastructure
- Drift Python Client - Python Client to access data of PANDA|Drift
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file wavelet-buffer-0.7.1.tar.gz
.
File metadata
- Download URL: wavelet-buffer-0.7.1.tar.gz
- Upload date:
- Size: 60.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd549008e3616780b1c2613d12b4f1aeac29ee35b4bec78a2f556f740a70d035 |
|
MD5 | 78af0fb2dc91a2975cb06fb374c878f5 |
|
BLAKE2b-256 | cf88ee8565591caeb219d94d19ac12ef2276a2f7adf9762b019f1acb13c982e2 |
File details
Details for the file wavelet_buffer-0.7.1-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: wavelet_buffer-0.7.1-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7c9ed8388bcbcebee9645e871663ffa3c9271f6e143edbd0350db400f17e8f3 |
|
MD5 | 88853f5116d84d377ad02221634e98cd |
|
BLAKE2b-256 | 50a4c0b98013098701b0dcfb5e319bae4bd74d30176fbb0c689c637bfb760dfa |
File details
Details for the file wavelet_buffer-0.7.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: wavelet_buffer-0.7.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 831.8 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d407244009445a26ca18001f12fac6b44a2430fc73f21fca766b26c8a4f28003 |
|
MD5 | 528bace517365339671c258c25c9481b |
|
BLAKE2b-256 | f0b3b2c1fe5aa39d5e9aff3665f131cfe64f0c881abf88f144c1dbd8902b8695 |
File details
Details for the file wavelet_buffer-0.7.1-cp311-cp311-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: wavelet_buffer-0.7.1-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 748.5 kB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 621b73a9065dd3ce379c0516a99df651063cb32fb2158d93e3a6d0a2d777570f |
|
MD5 | 712b3ffe8d873c8542b732c58ed58362 |
|
BLAKE2b-256 | 63cd0a744c9431262baaaa53b6c72cc5b5eb5b84980fd2867fc9e7b0665eb3c7 |
File details
Details for the file wavelet_buffer-0.7.1-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: wavelet_buffer-0.7.1-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f4ed85e7c6438ce9215e31f79c94054d9cc0fe9a89e52dc242d7bd2d058b59c |
|
MD5 | 398ee7bfcee7c179e336cf73ffe5a2b2 |
|
BLAKE2b-256 | 5ac7049d3b9c35a0ec673f019241ba320c6eedc4223d3e25a62e342dbbf3231c |
File details
Details for the file wavelet_buffer-0.7.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: wavelet_buffer-0.7.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 831.8 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1424c7e9a51589be1cae3e38821327a3e63a683d7bbe62c2289274378c97e73 |
|
MD5 | 7b8d71aa34009e5c3ddb3ec46b246a1e |
|
BLAKE2b-256 | a93ec8d12db099c20a5cbd201400d4cd61fcc4088119151cb9a67301f0533584 |
File details
Details for the file wavelet_buffer-0.7.1-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: wavelet_buffer-0.7.1-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 748.5 kB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a02bd1e4701b67280c6bab1b8f3409c2229596226a973c454f758db39d5cbd3 |
|
MD5 | f303fd7ac1100f4b79e4d1ece3e12d8b |
|
BLAKE2b-256 | 38f51a1c53725fdeb078ebdb63a956b8bb0b035dc2d35148058b1cec872b29df |
File details
Details for the file wavelet_buffer-0.7.1-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: wavelet_buffer-0.7.1-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 995363dbef11d8964da501108b09f6c069c730cdf6252cf46e1dbdbf98646357 |
|
MD5 | 18fa1ab3659df3476fd453c83e413322 |
|
BLAKE2b-256 | 11a2e4b57ac6e4a67a688268f5b17c293a0824be36f8fb019eee09fb08f2592d |
File details
Details for the file wavelet_buffer-0.7.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: wavelet_buffer-0.7.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 832.1 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ebdb717952e5d16e597fb496422b4ed64b644c40ce1480f8ae27c219675ef20 |
|
MD5 | 08fe0f52a69e2b11399d9c75ed405fa4 |
|
BLAKE2b-256 | 8e5f68b78fae5f791c4e9fd66c5aa0653c1c8c0dfe6a44eb9a5031fe70b743a2 |
File details
Details for the file wavelet_buffer-0.7.1-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: wavelet_buffer-0.7.1-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 748.6 kB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75382c0e5fee4cfa98c086ef5b9c1c6959384955997af64bfa2bab7a778903e5 |
|
MD5 | b9e9e36018a275185209f6ad19444bbc |
|
BLAKE2b-256 | 71555dd141dc3c2abfa3edabbc36f81bbfba3ba0922fc8d7eb52d4c3647eaa0a |
File details
Details for the file wavelet_buffer-0.7.1-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: wavelet_buffer-0.7.1-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2966085769323e37f0c0109d548b7c0fa35128cf9c8c247d558d289a9d2c722e |
|
MD5 | e7f616630d5e9a54691878a73c44b06f |
|
BLAKE2b-256 | f69f2f1322c0d613933ab4b58c309c67f13666d779ac4d03020be9027b839dda |
File details
Details for the file wavelet_buffer-0.7.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: wavelet_buffer-0.7.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 831.7 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86c2c2d35a5859e13a2c00a2e6544063424a594d71f2363241f1ec63e5491bac |
|
MD5 | 5f28deed043d0584dfeb80c0872a4a5e |
|
BLAKE2b-256 | 537abb47af629ec667f866b3869c478621abba230b0d34ddd495e2272b1ef0af |
File details
Details for the file wavelet_buffer-0.7.1-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: wavelet_buffer-0.7.1-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 748.5 kB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8beb996e1f862eedd9e38a9a1a5fc9fb82b65bb31bab706968a1ecb9de58bc1d |
|
MD5 | b4d7c0116efe4bd906358d1aefe55cef |
|
BLAKE2b-256 | 3830ad4c4127d67109f14d907e348b03026617b840ec0a03434b084f833b708e |