Skip to main content

Crate cathar

Crate cathar 

Source
Expand description

Audio restoration toolbox — denoise, de-hum, de-click, de-clip, normalise.

Default denoising uses spectral subtraction (pure Rust, zero weights). Enable the ml feature for candle-based neural denoising (Demucs, DNS Challenge).

§Quick start

use cathar::{Denoiser, SpectralDenoiser, generate_wave};

let audio = generate_wave(44100, 440.0, 1.0, 0.2);
let denoiser = SpectralDenoiser::default();
let clean = denoiser.denoise(&audio)?;
assert_eq!(clean.channels[0].len(), audio.channels[0].len());

Structs§

AudioData
NoisePrint
Pre-computed noise profile from a silence segment. Feed into SpectralDenoiser::with_noise_print instead of auto-detection.
SpectralDenoiser

Enums§

Error

Traits§

Denoiser

Functions§

bandwidth_extend
Restore high-frequency content lost to compression or low sample rates.
breath_remove
Detect and attenuate breath sounds between speech segments.
declick
Detect and interpolate impulse clicks.
declip
Detect and reconstruct clipped samples.
deesser
Reduce sibilance (harsh “s”, “sh”, “ch” sounds) using HF compression.
dehum
Remove mains hum (50/60 Hz + harmonics) using cascaded notch filters.
dereverb
Remove room reverb using spectral envelope decay gating.
generate_wave
learn_noise_print
Learn a noise profile from an audio segment (should be silence/noise-only).
normalize_loudness
Scale to target integrated loudness (EBU R128 approximation via RMS). Target in LUFS: -23 = broadcast, -16 = podcast, -14 = streaming.
normalize_peak
Scale to target peak level in dBFS (0 dBFS = ±1.0, -3 dBFS = ~±0.707).
variance
voice_isolate
Isolate speech from background using energy-based VAD + spectral gating.
wiener_denoise
Wiener-filter denoiser — statistically optimal, better transients.