Skip to main content

Crate math_audio_dsp

Crate math_audio_dsp 

Source
Expand description

DSP utilities for audio signal processing

This crate provides:

  • Signal generation: Test signals (tones, sweeps, noise)
  • Signal analysis: FFT-based frequency analysis, microphone compensation
  • Acoustic metrics: RT60, clarity (C50/C80), THD, spectrogram

§Example

use math_audio_dsp::{signals, analysis};

// Generate a 1 kHz tone
let signal = signals::gen_tone(1000.0, 0.5, 48000, 1.0);

// Analyze a WAV file
let config = analysis::WavAnalysisConfig::default();
// let result = analysis::analyze_wav_buffer(&signal, 48000, &config);

Re-exports§

pub use analysis::AnalysisResult;
pub use analysis::CrossCorrelationEnvelopeResult;
pub use analysis::MicrophoneCompensation;
pub use analysis::WavAnalysisConfig;
pub use analysis::WavAnalysisOutput;
pub use analysis::WindowedFrequencyResponse;
pub use analysis::analyze_recording;
pub use analysis::analyze_wav_buffer;
pub use analysis::analyze_wav_file;
pub use analysis::compute_average_response;
pub use analysis::compute_clarity_broadband;
pub use analysis::compute_clarity_spectrum;
pub use analysis::compute_group_delay;
pub use analysis::compute_impulse_response_from_fr;
pub use analysis::compute_rt60_broadband;
pub use analysis::compute_rt60_spectrum;
pub use analysis::compute_spectrogram;
pub use analysis::compute_windowed_fr;
pub use analysis::cross_correlate_envelope;
pub use analysis::find_db_point;
pub use analysis::read_analysis_csv;
pub use analysis::smooth_response_f32;
pub use analysis::smooth_response_f64;
pub use analysis::write_analysis_csv;
pub use analysis::write_wav_analysis_csv;
pub use fdw::FdwAnalysis;
pub use fdw::FdwConfig;
pub use fdw::analyze_impulse_response_fdw;
pub use binaural_loudness::BinauralChannel;
pub use binaural_loudness::BinauralDownmix;
pub use binaural_loudness::BinauralLoudness;
pub use binaural_loudness::BinauralLoudnessResult;
pub use binaural_loudness::SurroundLayout;
pub use binaural_loudness::measure_binaural;
pub use binaural_loudness::measure_binaural_from_surround;
pub use binaural_matrix::MatrixInverseBin;
pub use binaural_matrix::TransferMatrixBin;
pub use binaural_matrix::align_ir_to_reference_peak;
pub use binaural_matrix::condition_number;
pub use binaural_matrix::deconvolve_sweep_to_ir;
pub use binaural_matrix::direct_peak_sample;
pub use binaural_matrix::direct_peak_windowed_half_spectrum;
pub use binaural_matrix::direct_windowed_half_spectrum;
pub use binaural_matrix::fdw_complex_half_spectrum;
pub use binaural_matrix::half_spectrum_to_fir;
pub use binaural_matrix::position_errors;
pub use binaural_matrix::solve_minimax_regularized_inverse_bin;
pub use binaural_matrix::solve_regularized_inverse_bin;
pub use binaural_matrix::solve_weighted_regularized_inverse_bin;
pub use binaural_matrix::suppress_log_sweep_harmonic_residues;
pub use signals::add_silence_padding;
pub use signals::apply_fade_in;
pub use signals::apply_fade_out;
pub use signals::clip;
pub use signals::frames_for;
pub use signals::gen_allpass_probe;
pub use signals::gen_dirac;
pub use signals::gen_log_sweep;
pub use signals::gen_m_noise;
pub use signals::gen_mls;
pub use signals::gen_narrowband_probe;
pub use signals::gen_pink_noise;
pub use signals::gen_tone;
pub use signals::gen_two_tone;
pub use signals::gen_white_noise;
pub use signals::interleave_per_channel;
pub use signals::mono_to_stereo;
pub use signals::prepare_signal_for_playback;
pub use signals::prepare_signal_for_playback_channels;
pub use signals::replicate_mono;
pub use replaygain::ReplayGainAnalyzer;
pub use replaygain::ReplayGainInfo;
pub use replaygain::ReplayGainTrackData;
pub use replaygain::compute_album_gain;
pub use response::biquad_complex_response;
pub use response::fir_complex_response;
pub use response::lr4_crossover_response;
pub use waveform::WAVEFORM_SAMPLES;
pub use waveform::compute_waveform;

Modules§

adaa
analysis
FFT-based frequency analysis for recorded signals
audio_features
Audio feature extraction for music similarity analysis.
auto_makeup
binaural_loudness
Binaural loudness measurement per ITU-R BS.1770-4.
binaural_matrix
Binaural transfer-matrix utilities.
channel_linking
dc_blocker
delta_monitor
detector
dynamics_core
ebur128
Pure Rust implementation of ITU-R BS.1770-4 / EBU R128 loudness measurement.
envelope
envelope_follower
esprit
fast_math
Fast mathematical approximations for audio processing
fdn
Feedback Delay Network (FDN) for Late Reverb Synthesis
fdw
Frequency-dependent windowing for room impulse responses.
instantaneous_frequency
lookahead
psychoacoustics
Psychoacoustic and expensive-objective DSP helpers.
replaygain
response
Frequency-response helpers for linear DSP models.
rtpghi
signals
Audio signal generation utilities
simd
smoothing
stft
tonal_transient
Tonal/Transient Separator using Spectral Median Filtering
true_peak
waveform