Skip to main content

High-performance discrete and lifting wavelet transforms for 1-D and N-D signals, with SIMD acceleration, adjoint operations, and 8 boundary conditions.

Project description

ndwt

crates.io docs.rs CI

N-Dimensional Wavelet transforms for real and complex signals in Rust.

Provides two transform families:

  • DWT — the classic Discrete Wavelet Transform via convolution and subsampling.
  • LWT — the Lifting Wavelet Transform, an in-place factorisation of the DWT that is length-preserving and cache-friendly.

Both families support 1-D and N-D transforms on arbitrary axes, multi-level decomposition, SIMD acceleration via pulp, optional Rayon parallelism, and real or complex element types. Adjoint (transpose) operations are provided for every forward and inverse transform, respecting the chosen boundary extension, which makes the transforms suitable for use in optimization and inverse problems.

Installation

[dependencies]
ndwt = "0.1"

Default features enable rayon (multi-threading), ndarray integration, and x86-v3 (AVX2/FMA) SIMD paths. See Feature flags for details.

Quick start

DWT — 1-D signal

use ndwt::Wavelet;
use ndwt::boundarys::ZeroBoundary;
use ndwt::dwt::driver::{WaveletTransform, get_transform_shape};

let wvlt = Wavelet::Daubechies4;
let level = 3;
let shape = [128_usize];
let axes = [0_usize];

let trans = WaveletTransform::new(wvlt, ZeroBoundary);

let x: Vec<f64> = (0..128).map(|i| i as f64 / 127.0).collect();

// Output is larger than input because non-periodic DWT pads at each level.
let out_shape = get_transform_shape(&shape, &axes, level, wvlt.width(), false);
let mut coeffs = vec![0.0_f64; out_shape.iter().product()];
trans.forward_multilevel_nd(&x, &mut coeffs, &shape, &axes, level);

// Reconstruct.
let mut x2 = vec![0.0_f64; 128];
trans.inverse_multilevel_nd(&mut coeffs, &mut x2, &shape, &axes, level);

LWT — 2-D image (periodic boundary)

use ndwt::Wavelet;
use ndwt::boundarys::BoundaryCondition;
use ndwt::lwt::driver::WaveletTransform;

let wvlt = Wavelet::Daubechies4;
let level = 3;
let shape = [64_usize, 64];
let axes = [0_usize, 1]; // both axes

let trans = WaveletTransform::new(wvlt, BoundaryCondition::Periodic);

let x: Vec<f64> = (0..64 * 64).map(|i| ((i as f64) * 0.17).sin()).collect();

// LWT is length-preserving: output has the same shape as input.
let mut coeffs = vec![0.0_f64; 64 * 64];
trans.forward_multilevel_nd(&x, &mut coeffs, &shape, &axes, level);

let mut x2 = vec![0.0_f64; 64 * 64];
trans.inverse_multilevel_nd(&coeffs, &mut x2, &shape, &axes, level);

Supported wavelets

Family Types Module
Daubechies 1–10 ndwt::daubechies
Symlet 4–6 ndwt::symlet
Coiflet 1–3 ndwt::coiflet
Biorthogonal Bior1_3 … Bior6_8 ndwt::bior
CDF (JPEG 2000) CDF5_3, CDF9_7 ndwt::bior

Each wavelet type is a zero-size marker struct carrying filter coefficients as compile-time constants. The Wavelet enum lets you select a wavelet at runtime without generics.

Boundary conditions

Mode Behaviour
Zero Pads with zeros
Periodic Wraps the signal
Constant Extends the edge value
Symmetric Mirror reflection at the boundary (edge repeated)
Reflect Mirror reflection without repeating the edge sample
Antisymmetric Antisymmetric reflection
Smooth Linear extrapolation from the two edge samples
Antireflect Antisymmetric reflect

Compile-time boundary types (ZeroBoundary, PeriodicBoundary) are also available for zero-cost dispatch. The BoundaryCondition enum enables runtime selection.

Feature flags

Flag Default Effect
rayon enabled Multi-threaded N-D transforms via Rayon
ndarray enabled ndarray integration
x86-v3 enabled AVX2 / FMA SIMD paths (requires x86-64-v3 CPU)
x86-v4 AVX-512 SIMD paths (requires x86-64-v4 CPU)

Disable default features to get a minimal build with no SIMD or parallelism:

ndwt = { version = "0.1", default-features = false }

License

MIT — see LICENSE.md.

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

ndwt-0.1.1.tar.gz (129.6 kB view details)

Uploaded Source

Built Distributions

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

ndwt-0.1.1-cp314-cp314t-win_arm64.whl (4.4 MB view details)

Uploaded CPython 3.14tWindows ARM64

ndwt-0.1.1-cp314-cp314t-win_amd64.whl (6.2 MB view details)

Uploaded CPython 3.14tWindows x86-64

ndwt-0.1.1-cp314-cp314t-musllinux_1_2_x86_64.whl (6.5 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

ndwt-0.1.1-cp314-cp314t-musllinux_1_2_aarch64.whl (4.6 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ ARM64

ndwt-0.1.1-cp314-cp314t-manylinux_2_28_x86_64.whl (6.4 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ x86-64

ndwt-0.1.1-cp314-cp314t-manylinux_2_28_aarch64.whl (4.5 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ ARM64

ndwt-0.1.1-cp314-cp314t-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

ndwt-0.1.1-cp314-cp314t-macosx_10_15_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.14tmacOS 10.15+ x86-64

ndwt-0.1.1-cp311-abi3-win_arm64.whl (4.4 MB view details)

Uploaded CPython 3.11+Windows ARM64

ndwt-0.1.1-cp311-abi3-win_amd64.whl (6.2 MB view details)

Uploaded CPython 3.11+Windows x86-64

ndwt-0.1.1-cp311-abi3-musllinux_1_2_x86_64.whl (6.5 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ x86-64

ndwt-0.1.1-cp311-abi3-musllinux_1_2_aarch64.whl (4.6 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

ndwt-0.1.1-cp311-abi3-manylinux_2_28_x86_64.whl (6.4 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ x86-64

ndwt-0.1.1-cp311-abi3-manylinux_2_28_aarch64.whl (4.5 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ ARM64

ndwt-0.1.1-cp311-abi3-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

ndwt-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file ndwt-0.1.1.tar.gz.

File metadata

  • Download URL: ndwt-0.1.1.tar.gz
  • Upload date:
  • Size: 129.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ndwt-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2739afcdfb6d59628df20b2d864bd267c4d2ecade46bec6397ee107276edec81
MD5 ed0efa5a6473618a301b7448ab5f7549
BLAKE2b-256 193d0694fca886c0ea3a8020e328ac275e3e27336bca0fc44333a46def07d76b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndwt-0.1.1.tar.gz:

Publisher: deploy.yml on jcapriot/wavelets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ndwt-0.1.1-cp314-cp314t-win_arm64.whl.

File metadata

  • Download URL: ndwt-0.1.1-cp314-cp314t-win_arm64.whl
  • Upload date:
  • Size: 4.4 MB
  • Tags: CPython 3.14t, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ndwt-0.1.1-cp314-cp314t-win_arm64.whl
Algorithm Hash digest
SHA256 20114262f99127f2d246f68ceb2a407423f23c30c265cd3a2e76376f585627f2
MD5 d25afd683a50304542fac4b127d7b5a9
BLAKE2b-256 132dc3fa1d3dc91c9029750cb209778410d80199cb6e3eb866daf5853880735e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndwt-0.1.1-cp314-cp314t-win_arm64.whl:

Publisher: deploy.yml on jcapriot/wavelets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ndwt-0.1.1-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: ndwt-0.1.1-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 6.2 MB
  • Tags: CPython 3.14t, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ndwt-0.1.1-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 bf39f8b25744affd7ca6b8d485569a56a8a75edb8abf922d5831642bdfd4b70d
MD5 1115d031cecb210c79d5d5bfc8bbf90a
BLAKE2b-256 89880d72f195708f8474635511fc298331ef5677269722eeb0c2f37f5a238564

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndwt-0.1.1-cp314-cp314t-win_amd64.whl:

Publisher: deploy.yml on jcapriot/wavelets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ndwt-0.1.1-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for ndwt-0.1.1-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a4b17e7aa27e08e42c53b2859f3739476784277e89df5abe6ea0ec4c4aa30116
MD5 0607cdcc4ae72af53edac3b8c63c3bbf
BLAKE2b-256 73214e0880cab7450df9153574f7b4316189d3d9349891d66b7427c84bb9c256

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndwt-0.1.1-cp314-cp314t-musllinux_1_2_x86_64.whl:

Publisher: deploy.yml on jcapriot/wavelets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ndwt-0.1.1-cp314-cp314t-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for ndwt-0.1.1-cp314-cp314t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 35620c9ac4fd610aed283dcb72ffcf8f9efedbfb0700a91353d2386590ebd2ed
MD5 e49fcf1a63d4920489a47c93e92ef0bf
BLAKE2b-256 5674a452a18a13a3e5b8dd73f449cc8c76d0b5f0a34312f3678ed84238176b22

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndwt-0.1.1-cp314-cp314t-musllinux_1_2_aarch64.whl:

Publisher: deploy.yml on jcapriot/wavelets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ndwt-0.1.1-cp314-cp314t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ndwt-0.1.1-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4ace7f508000d30a0ad3d9032d89f47a396777112def2a9c7131ef37d52531a1
MD5 5a826dfa501b693d8c73ab93660bd824
BLAKE2b-256 c9c1e61a0e51e3a4cff8f95d5bb2b419a9d7825c5ace8dc63cf0f5ff33802097

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndwt-0.1.1-cp314-cp314t-manylinux_2_28_x86_64.whl:

Publisher: deploy.yml on jcapriot/wavelets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ndwt-0.1.1-cp314-cp314t-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for ndwt-0.1.1-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 14321e0d8e61e123cce6cecbf81060b3da9deedd67fa265d7b4dc023e5a4e4d0
MD5 9f6163f7a6028e299b5287a552d3d722
BLAKE2b-256 1e5f7b6e562059a95283973fd69b9bea36e692ae5a5217afae52bd6590c65f3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndwt-0.1.1-cp314-cp314t-manylinux_2_28_aarch64.whl:

Publisher: deploy.yml on jcapriot/wavelets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ndwt-0.1.1-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ndwt-0.1.1-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3b2ee470136760c91e3a9b2efc449c176ee944852eafb4d55d0f6d9c985db405
MD5 2dc6489147bfe343c8c9b5fa38882e1c
BLAKE2b-256 fac27b22f7da45c30c961e80d136104fa9c360f9b76d0ca7949870ee521ac9b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndwt-0.1.1-cp314-cp314t-macosx_11_0_arm64.whl:

Publisher: deploy.yml on jcapriot/wavelets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ndwt-0.1.1-cp314-cp314t-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for ndwt-0.1.1-cp314-cp314t-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6fac98790736b076870b32e4d2c22a22e0f639d14f39d249c86ed0cfbdec3dde
MD5 312a62bb069ca8cfc56af8fcdcdfaee7
BLAKE2b-256 2982df04f8a7a24398e469b72c9d1286dc59a0ebe05f36d6d1612ffac911fc7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndwt-0.1.1-cp314-cp314t-macosx_10_15_x86_64.whl:

Publisher: deploy.yml on jcapriot/wavelets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ndwt-0.1.1-cp311-abi3-win_arm64.whl.

File metadata

  • Download URL: ndwt-0.1.1-cp311-abi3-win_arm64.whl
  • Upload date:
  • Size: 4.4 MB
  • Tags: CPython 3.11+, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ndwt-0.1.1-cp311-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 e5a837725b423c3fc028f6048b0e91ea3598079e01361d769be394cf241724c3
MD5 4246018da2f417203d3d987b7770bf11
BLAKE2b-256 4303952827aa78fb250cf3a53483d9eda540383214348cdd80a204462160b97d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndwt-0.1.1-cp311-abi3-win_arm64.whl:

Publisher: deploy.yml on jcapriot/wavelets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ndwt-0.1.1-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: ndwt-0.1.1-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 6.2 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ndwt-0.1.1-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 bbe2fc843a71c6fcd2672f211f9bfea9dc214b638d36b5a54a43966335534a2f
MD5 313a35f6e2371643420f75703bae4f95
BLAKE2b-256 b89e16438290b5e06e0e88d124835a326dfe47d43b6e40428f236ec245c88447

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndwt-0.1.1-cp311-abi3-win_amd64.whl:

Publisher: deploy.yml on jcapriot/wavelets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ndwt-0.1.1-cp311-abi3-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: ndwt-0.1.1-cp311-abi3-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 6.5 MB
  • Tags: CPython 3.11+, musllinux: musl 1.2+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ndwt-0.1.1-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 96342ed2a423cd1dc516974b8a09487c6d2319b4a1b8e316bf1a1503f98bce2d
MD5 d76b943dd2adb613d293554780a0cb3d
BLAKE2b-256 1a5fc54f1d132173d46285514a357a8c1ee9a209d27866ea5cf487868e9d08a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndwt-0.1.1-cp311-abi3-musllinux_1_2_x86_64.whl:

Publisher: deploy.yml on jcapriot/wavelets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ndwt-0.1.1-cp311-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for ndwt-0.1.1-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 7d05b7d0a74493627f43302791f0519d50f1d4fd46cbbffa6007659fa5b88565
MD5 cc9f73a15b2507b872bfe1651292a6ac
BLAKE2b-256 e1825b1bc1fc96d4c94d760203a5f68f7f41c530d860185c74ac8a5c6739605d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndwt-0.1.1-cp311-abi3-musllinux_1_2_aarch64.whl:

Publisher: deploy.yml on jcapriot/wavelets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ndwt-0.1.1-cp311-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ndwt-0.1.1-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a0a311b5615d5b151ab01ed702e2331da70a1c4b222d48401ca1add13e8c1964
MD5 518c2f6199ced1c9ac9cf25fd12a6843
BLAKE2b-256 f0243d34842419e84417cd52e6e8c40ba7c3e1b846de6a4ac6b5c3b72657d268

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndwt-0.1.1-cp311-abi3-manylinux_2_28_x86_64.whl:

Publisher: deploy.yml on jcapriot/wavelets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ndwt-0.1.1-cp311-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for ndwt-0.1.1-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0ce33accac18c70b9ad5624e6d6c13ae10a86032bb6051f17bbecf95a45f8283
MD5 c7d518892f2eac09c7df67e6778de07b
BLAKE2b-256 15069c042edb14e157b4e1b73deeab57cf4435de4c7f42f26c7bd976d087d8eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndwt-0.1.1-cp311-abi3-manylinux_2_28_aarch64.whl:

Publisher: deploy.yml on jcapriot/wavelets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ndwt-0.1.1-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: ndwt-0.1.1-cp311-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.11+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ndwt-0.1.1-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c8e2da6c7a171bff8ea2ac81b43ac53ece8757d475f6531045787e7223264e20
MD5 2dc1d7d01176b3785d2ca8324cb05bb3
BLAKE2b-256 6b8aac173f986fc8974353a8f33090372f591337e2dc8eaa7dff5ee2dca7d697

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndwt-0.1.1-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: deploy.yml on jcapriot/wavelets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ndwt-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ndwt-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a965f7e6d750c9200b3774e7e95b1bc6620e04a094128b303d8b6329b5d25a49
MD5 9e2638e142e990b1772b2bdb0bfedee3
BLAKE2b-256 0722fd69838bcd328613d4a9c2342cdcb81ecfcabc4ea59760ac74ded0a5936a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndwt-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl:

Publisher: deploy.yml on jcapriot/wavelets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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