loqa_voice_dsp/
lib.rs

1//! Loqa Voice DSP - Shared DSP Library for Voice Analysis
2//!
3//! This crate provides core DSP functionality for voice analysis including:
4//! - Pitch detection (YIN algorithm)
5//! - Formant extraction (LPC)
6//! - FFT utilities
7//! - Spectral analysis
8//! - HNR (Harmonics-to-Noise Ratio) for breathiness analysis
9//! - H1-H2 amplitude difference for vocal weight analysis
10//!
11//! The crate is designed to be used by:
12//! - Loqa backend (native Rust)
13//! - VoiceFind mobile app (via FFI)
14
15pub mod analyzer;
16pub mod autocorrelation;
17pub mod config;
18pub mod fft;
19pub mod formants;
20pub mod h1h2;
21pub mod hnr;
22pub mod pitch;
23pub mod pyin;
24pub mod spectral;
25
26// FFI layer is always available (iOS uses C exports without feature flag)
27pub mod ffi;
28
29// Re-export main types
30pub use analyzer::VoiceAnalyzer;
31pub use config::{AnalysisConfig, PitchAlgorithm};
32pub use fft::{compute_fft, FFTResult};
33pub use formants::{extract_formants, FormantResult};
34pub use h1h2::{calculate_h1h2, H1H2Result};
35pub use hnr::{calculate_hnr, HNRResult};
36pub use pitch::{detect_pitch, PitchResult, PitchTrack};
37pub use spectral::{analyze_spectrum, SpectralFeatures};