| Crates.io | dasp-rs |
| lib.rs | dasp-rs |
| version | 0.1.1 |
| created_at | 2025-03-13 08:31:42.523109+00 |
| updated_at | 2025-03-18 21:57:29.839969+00 |
| description | A crate for digital signal processing, speech processing, music analysis, and phonetics. |
| homepage | |
| repository | https://github.com/amirhosseinghanipour/dasp-rs |
| max_upload_size | |
| id | 1590592 |
| size | 363,685 |
dasp-rs is a crate for digital audio signal processing for developers, researchers, phoneticians, and students.
rayon for efficiency.thiserror.Add dasp-rs to your Cargo.toml:
[dependencies]
dasp-rs = "0.1.1"
| Module | Description |
|---|---|
core::io |
WAV I/O with streaming and preprocessing (resampling, mono conversion). |
core::ops |
Sample-wise operations (mix, subtract, multiply, etc.). |
features::harmonics |
Harmonic analysis and phase vocoding. |
features::inverse |
MFCC and mel spectrogram inversion to audio. |
features::manipulation |
Temporal context stacking and statistical features (e.g., kurtosis). |
features::rhythm |
Tempo estimation and tempogram computation. |
features::spectral |
Spectral features (chroma, MFCC, centroid, etc.). |
pitch::tuning |
Pitch detection (YIN, pYIN) and tuning estimation. |
magnitude::scaling |
Amplitude/power to dB conversion and perceptual weighting. |
signal_generation::generators |
Signal generators (tones, chirps, clicks). |
signal_processing::time_frequency |
STFT, CQT, VQT, and other time-frequency transforms. |
signal_processing::mixing |
Stereo, multi-channel, and dry/wet mixing. |
signal_processing::mono |
Mono signal utility to stereo. |
signal_processing::time_domain |
Time-domain processing (e.g., autocorrelation). |
signal_processing::resampling |
Sample rate conversion utilities. |
utils::frequency |
Frequency-related utilities (e.g., FFT bin frequencies). |
utils::notation |
Music notation conversions (e.g., Hz to MIDI). |
utils::time |
Time-related utilities (e.g., frame-to-time mapping). |
Discover more on crates https://crates.io/crates/dasp-rs/ and docs https://docs.rs/dasp-rs/0.1.1.
use dasp_rs::core::io::load;
use dasp_rs::time_frequency::stft;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Load audio file
let audio = load("input.wav", Some(44100), Some(true), None, None)?;
// Compute Short-Time Fourier Transform with a 2048-sample window
let spectrogram = stft(&audio.samples, Some(2048), None, None)?;
// Print the shape of the resulting spectrogram
println!("Spectrogram shape: {} time frames, {} frequency bins",
spectrogram.nrows(), spectrogram.ncols());
Ok(())
}
rayon for multi-core efficiency.ndarray.Submit pull requests or issues to the GitHub repository. Follow Rust conventions and include tests.
Contributing steps:
git checkout -b feature-name.git commit -m "Add feature".git push origin feature-name.dasp-rs is licensed under the CC-BY-NC-4.0 License. See LICENSE for details.