Crate rconvolve

Crate rconvolve 

Source
Expand description

§rconvolve

Crates.io Docs.rs

Fast convolution and impulse response extraction for audio applications in Rust.

§Overview

rconvolve provides FFT-based convolution and deconvolution for audio processing. It supports:

  • Batch and real-time convolution for applying impulse responses to audio
  • Exponential sine sweep generation for acoustic measurement
  • Impulse response extraction from recorded sweeps via deconvolution
  • Mono, stereo, and true stereo (4-channel matrix) processing
  • WebAssembly support for browser-based applications
  • no_std compatibility (requires alloc) for embedded systems

Live Demo: Try the WebAssembly demo at rconvolve.pages.dev

§Installation

Add to your Cargo.toml:

[dependencies]
rconvolve = "*"

§Feature Flags

FeatureDefaultDescription
stdYesEnables standard library. Disable for no_std environments.
wasmNoEnables WebAssembly bindings via wasm-bindgen.

§Quick Start

§Batch Convolution

See the example in the rconvolve::convolve module documentation.

§Real-Time Convolution

See the example in the rconvolve::convolve::PartitionedConvolution documentation.

§Impulse Response Extraction

See the example in the rconvolve::deconvolve module documentation.

§Examples

The crate includes some examples:

§apply_reverb

Apply convolution reverb to a WAV file:

cargo run --example apply_reverb -- input.wav impulse_response.wav output.wav

§realtime_reverb

Real-time convolution reverb using system audio input/output:

cargo run --example realtime_reverb -- impulse_response.wav
cargo run --example realtime_reverb -- --test-ir  # Use generated test IR

§simple_wav_to_ir

Convert a recorded sweep to an impulse response:

cargo run --example simple_wav_to_ir -- recorded_sweep.wav output_ir.wav

§WebAssembly

cargo install wasm-pack
wasm-pack build --target web --release

See the full documentation for the WASM API reference, or try the live demo.

§License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Re-exports§

pub use convolve::*;
pub use deconvolve::*;
pub use sweep::*;
pub use utils::*;

Modules§

convolve
Fast FFT-based convolution for real-time audio processing
deconvolve
Deconvolution for impulse response extraction
sweep
Exponential sine sweep generation for hall measurement
utils
Utility DSP functions for audio processing

Enums§

AudioError
Audio processing errors.

Type Aliases§

AudioBuffer
Buffer of audio samples.
AudioResult
Result type for audio processing operations
Sample
Audio sample type (32-bit float).