Crate loqa_voice_dsp

Crate loqa_voice_dsp 

Source
Expand description

Loqa Voice DSP - Shared DSP Library for Voice Analysis

This crate provides core DSP functionality for voice analysis including:

  • Pitch detection (YIN algorithm)
  • Formant extraction (LPC)
  • FFT utilities
  • Spectral analysis
  • HNR (Harmonics-to-Noise Ratio) for breathiness analysis
  • H1-H2 amplitude difference for vocal weight analysis

The crate is designed to be used by:

  • Loqa backend (native Rust)
  • VoiceFind mobile app (via FFI)

Re-exports§

pub use analyzer::VoiceAnalyzer;
pub use config::AnalysisConfig;
pub use config::PitchAlgorithm;
pub use fft::compute_fft;
pub use fft::FFTResult;
pub use formants::extract_formants;
pub use formants::FormantResult;
pub use h1h2::calculate_h1h2;
pub use h1h2::H1H2Result;
pub use hnr::calculate_hnr;
pub use hnr::HNRResult;
pub use pitch::detect_pitch;
pub use pitch::PitchResult;
pub use pitch::PitchTrack;
pub use spectral::analyze_spectrum;
pub use spectral::SpectralFeatures;

Modules§

analyzer
Stateful voice analyzer for frame-based and streaming analysis
autocorrelation
Normalized autocorrelation for pitch detection and voice analysis
config
Configuration for voice analysis
ffi
FFI (Foreign Function Interface) bindings for mobile platforms
fft
This module provides Fast Fourier Transform (FFT) computation for audio analysis. It wraps rustfft and realfft for efficient frequency domain transformations.
formants
Formant extraction using Linear Predictive Coding (LPC)
h1h2
H1-H2 amplitude difference calculation for vocal weight analysis
hnr
Harmonics-to-Noise Ratio (HNR) calculation for voice analysis
pitch
Pitch detection using YIN and autocorrelation algorithms
pyin
pYIN (Probabilistic YIN) pitch detection algorithm
spectral
This module provides spectral features for analyzing voice characteristics: