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.0.tar.gz
(48.6 kB
view hashes)
Built Distributions
Close
Hashes for wavelet_buffer-0.5.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e472e43c9c33deb64b168666bc3304d501ab54d155593dfca25534d3acf37227 |
|
MD5 | bfbe0a47915b01eb78a5b80f197098eb |
|
BLAKE2b-256 | 1bb9b2699e3e86461e6dd48551e91b8c8a008a0370f575355308eee0ce020432 |
Close
Hashes for wavelet_buffer-0.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6424994805f03e97e1824fec469944e47f4d933d3f5b77c4099ceeac455846f4 |
|
MD5 | 176b01c7fef117e295d1da079b065b9e |
|
BLAKE2b-256 | 1c841dec50c2ad136319d30202d52f20dd08c1115e3f0aef3ba2210ec8136cb9 |
Close
Hashes for wavelet_buffer-0.5.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a1a60ba128ea6cdf856f62b2c376bd9aaa4bdbbbf7534a61770121dd7881c07 |
|
MD5 | a890b588ab468e37e89420748f9ef82a |
|
BLAKE2b-256 | 6daf73bffd932330da0f1f7f1be11a7b69bd48ab0e856b3b630b58cf79c4fbaf |
Close
Hashes for wavelet_buffer-0.5.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a44417bba1dda1fe18d6ec550f5901f91881490b08122103a7c7cf4944acd804 |
|
MD5 | 259894f61c96b07f5d1edc06af9a3fcb |
|
BLAKE2b-256 | 1280df3b03425f7d43bfd7755c370008e152828948e681f2e673fc10c9158efc |
Close
Hashes for wavelet_buffer-0.5.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f7cafe54af4fe0ec0f599fdc1ca6faf2f3c6c74f7bef9eb82877248f8b692bf |
|
MD5 | 74d02e011be8c7d70cf3302cb1f6ad7f |
|
BLAKE2b-256 | ccb80dbfcfaa40dab39df79806221c464c49fc5b57d5f74712911c484fcb870e |
Close
Hashes for wavelet_buffer-0.5.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e331c76243ae00aebf547001493b1ddd5b8ce491c70eef96d230d644e79c633a |
|
MD5 | a2400727137f777cc8c53e2b1b5985b8 |
|
BLAKE2b-256 | 8778dab6fd1c7599bc06bc37ccaa9c59dc8308172466068a5d13a1e807064b81 |
Close
Hashes for wavelet_buffer-0.5.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f66b659c91c5ed91a7feca751f5b24335f9389acb4978a067888db4d62101e7 |
|
MD5 | fb98f04967c1d02a9e9d5287cb88de6d |
|
BLAKE2b-256 | 03e8f94a1a7b15e0d7df2014c16c13096ad0274cde94fb54e8c4f8536e96d195 |
Close
Hashes for wavelet_buffer-0.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8aa4c881006334f57754b826bb3b050ca12651467380eaee866ba94928838110 |
|
MD5 | 7f32cb730cbb7c2d63097f0acd6b3091 |
|
BLAKE2b-256 | 7467909ab3ea7654fd97d0cdad5d2947c52835ef4c8ea033e6e3f54edadb481f |
Close
Hashes for wavelet_buffer-0.5.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b31924c78c223328b928bd3416b9629869b4b59350adeda500023179751c122 |
|
MD5 | 001a674bdb838636fbc3cff37adb20a0 |
|
BLAKE2b-256 | 331b896eedf72f6318dc83e4e309aa6f5eb021d4f2b39e65c110607bb35125ec |