dewitt
Discrete Wavelet Transform (DWT - here 'dewitt') for Audio Analysis
Summary
| Latest Version | 0.1.0 |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-07-21 05:27 |
Tags
Authors
- Janni Adamski
Installation
nimble install dewitt
choosenim install dewitt
git clone https://github.com/Luteva-ssh/dewitt
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| dewitt | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Dependencies
| Package | Version | Optional |
|---|---|---|
| nim >= | 1.6.0 | No |
Source
| Repository | https://github.com/Luteva-ssh/dewitt |
|---|---|
| Homepage | https://github.com/Luteva-ssh/dewitt |
| Registry Source | nimble_official |
README
Wavelet Audio Analysis
A comprehensive Nim implementation of Discrete Wavelet Transform (DWT) for audio signal processing and analysis.
Features
- Complete DWT Implementation: Forward and inverse transforms with multiple wavelet families
- Audio Processing: WAV file reading/writing, windowing, and preprocessing
- Multiple Wavelets: Haar, Daubechies (db4, db8), Biorthogonal wavelets
- Analysis Tools: Energy analysis, frequency decomposition, denoising
- High Performance: Optimized algorithms with efficient memory usage
- Comprehensive Tests: Unit tests and benchmarks included
Wavelet Families Supported
- Haar: Simplest wavelet, good for signals with sharp transitions
- Daubechies: Orthogonal wavelets with various orders (db4, db8)
- Biorthogonal: Symmetric wavelets good for image/audio processing
Installation
nimble install
Usage
Basic DWT Example
import wavelet_audio
# Create a test signal
let signal = @[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]
# Perform DWT
let dwt = newDWT(WaveletType.Haar)
let (coeffs, lengths) = dwt.forward(signal)
# Reconstruct signal
let reconstructed = dwt.inverse(coeffs, lengths)
Audio Analysis Example
import wavelet_audio/audio
# Load audio file
let audio = loadWAV("input.wav")
# Analyze with DWT
let analyzer = newAudioAnalyzer(WaveletType.Daubechies4)
let analysis = analyzer.analyze(audio.samples, levels = 5)
# Get frequency band energies
echo "Energy distribution: ", analysis.energyDistribution
API Reference
Core DWT Classes
DWT: Main wavelet transform classWaveletType: Enumeration of supported waveletsAudioAnalyzer: High-level audio analysis interface
Key Methods
forward(signal): Perform forward DWTinverse(coeffs, lengths): Perform inverse DWTanalyze(samples, levels): Analyze audio with multi-level DWTdenoise(signal, threshold): Remove noise using wavelet thresholding
Building and Testing
# Run tests
nimble test
# Build release version
nim c -d:release src/wavelet_audio.nim
# Generate documentation
nimble docs
Performance
The implementation is optimized for performance with: - In-place operations where possible - Efficient memory management - SIMD-friendly algorithms - Benchmark suite included
Applications
- Audio denoising
- Feature extraction for music analysis
- Signal compression
- Time-frequency analysis
- Audio classification preprocessing
License
MIT License - see LICENSE file for details.
Contributing
Contributions welcome!