resonant-analysis 0.4.0

High-level audio analysis: onset detection, beat tracking, pitch estimation, MFCCs
Documentation
#![warn(missing_docs)]

//! `resonant-analysis` — high-level audio analysis features.
//!
//! Provides onset detection, beat tracking, pitch estimation, MFCCs,
//! chroma features, and spectral descriptors. All algorithms build on
//! the primitives in [`resonant-fft`] and [`resonant-core`].
//!
//! # Quick start
//!
//! ```
//! use resonant_analysis::spectral;
//!
//! let magnitudes = [0.1, 0.5, 1.0, 0.3];
//! let frequencies = [0.0, 500.0, 1000.0, 1500.0];
//!
//! let centroid = spectral::spectral_centroid(&magnitudes, &frequencies).unwrap();
//! let flatness = spectral::spectral_flatness(&magnitudes).unwrap();
//! ```

/// Chroma features — 12-bin pitch class profiles.
pub mod chroma;
pub mod error;
/// Key detection via Krumhansl-Schmuckler profiles.
pub mod key;
/// Loudness analysis: RMS, peak, and crest factor.
pub mod loudness;
/// LUFS measurement per ITU-R BS.1770-4.
pub mod lufs;
pub(crate) mod mel;
/// Mel-frequency cepstral coefficients (MFCCs).
pub mod mfcc;
/// Onset detection via spectral flux and adaptive thresholding.
pub mod onset;
/// Pitch estimation using the YIN algorithm.
pub mod pitch;
/// Spectral feature extraction: centroid, spread, flatness, rolloff.
pub mod spectral;
/// Tempo estimation via autocorrelation of onset strength envelope.
pub mod tempo;
/// Time-stretching and pitch-shifting via STFT phase vocoder.
pub mod time_stretch;

pub use error::AnalysisError;
pub use key::{KeyDetector, KeyEstimate, Mode, PitchClass};
pub use loudness::LoudnessAnalyser;
pub use lufs::{ChannelConfig, LufsAnalyser};