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 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
- 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
wavelet-buffer-0.5.1.tar.gz
(48.6 kB
view hashes)
Built Distributions
Close
Hashes for wavelet_buffer-0.5.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da3b444ea283de39be0de968a0b716b3f8025b17a48e71a4c9121063fdfa0e2c |
|
MD5 | 75cb44f7fe4441e75e4f5a74045f9fa1 |
|
BLAKE2b-256 | c6b4c53c785713b7b6ef8ad0ed48ad69cd6961964105b8c870932f7909528e82 |
Close
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 |
Close
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 |
Close
Hashes for wavelet_buffer-0.5.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e33cdb961c7ac3990c8842bd7e9fc8a5175f4fe42680788bfe5bfc17f6271463 |
|
MD5 | bb9f75b5dd59444f4b57d5f1ec62ade0 |
|
BLAKE2b-256 | 6aa69b1c8dbee338d3bb91bea4844bd0efd83fd745ece2afaa178d21950cc6d4 |
Close
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 |
Close
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 |
Close
Hashes for wavelet_buffer-0.5.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 948be5500144491ff575033ecc40c6aef6726276453c713ddea35affc0050702 |
|
MD5 | 347276f35a7e0a934bebb227ba23c374 |
|
BLAKE2b-256 | 401c8b6f0f20f70ab4f6b7cb5fabfdd7b6cd98e2098015c60cfc442d7d3e141a |
Close
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 |
Close
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 |