Skip to main content

Module analysis

Module analysis 

Source
Expand description

FFT-based frequency analysis for recorded signals

This module provides functions to analyze recorded audio signals and extract:

  • Frequency spectrum (magnitude in dBFS)
  • Phase spectrum (compensated for latency)
  • Latency estimation via cross-correlation
  • Microphone compensation for calibrated measurements
  • Standalone WAV buffer analysis (wav2csv functionality)

Structs§

AnalysisResult
Result of FFT analysis
CrossCorrelationEnvelopeResult
Result of cross-correlation with analytic envelope detection.
MicrophoneCompensation
Microphone compensation data (frequency response correction)
WavAnalysisConfig
Configuration for standalone WAV buffer analysis
WavAnalysisOutput
Result of standalone WAV buffer analysis
WindowedFrequencyResponse
Frequency responses computed from different time windows of an impulse response.

Functions§

analyze_recording
Analyze a recorded WAV file against a reference signal
analyze_wav_buffer
Analyze a buffer of audio samples and return frequency response
analyze_wav_file
Analyze a WAV file and return frequency response
compute_average_response
Compute a log-frequency weighted reference response level in dB.
compute_clarity_broadband
Compute Clarity (C50, C80) from Impulse Response (Broadband) Returns (C50_dB, C80_dB)
compute_clarity_spectrum
Compute Clarity spectrum (C50, C80) using octave band filtering Returns (C50_vec, C80_vec)
compute_coherence_from_realizations
Magnitude-squared coherence γ²(f) across N complex spectra that should be measurements of the same deterministic transfer function. Per docs/gd_opt_v2_plan.md §2.2:
compute_group_delay
Compute group delay from phase data Group delay = -d(phase)/d(frequency) / (2*pi)
compute_impulse_response_from_fr
Compute impulse response from frequency response via inverse FFT.
compute_rt60_broadband
Compute RT60 from Impulse Response (Broadband) Uses T20 (-5dB to -25dB) extrapolation
compute_rt60_spectrum
Compute RT60 spectrum using octave band filtering
compute_spectrogram
Compute Spectrogram from Impulse Response Returns (spectrogram_matrix_db, frequency_bins, time_bins) window_size samples (e.g. 512), hop_size samples (e.g. 128).
compute_windowed_fr
Compute frequency responses for different time windows of the impulse response.
cross_correlate_envelope
Cross-correlate a probe with a recording and compute the analytic envelope.
deconvolve_sweep
Deconvolve a single recorded log sweep by dividing the recording’s spectrum by the emitted sweep’s spectrum, producing a complex frequency response on the FFT grid [0, Nyquist].
estimate_noise_floor_db_from_silence
Estimate per-bin noise floor in dB from a silence window.
find_db_point
Find a frequency point where the magnitude reaches a specific dB level
plan_fft_forward
Get a cached forward FFT plan for the given size (f32).
plan_fft_inverse
Get a cached inverse FFT plan for the given size (f32).
read_analysis_csv
Read analysis results from CSV file
smooth_response_f32
Apply octave smoothing to frequency response data (f32 version)
smooth_response_f64
Apply octave smoothing to frequency response data (f64 version)
write_analysis_csv
Write analysis results to CSV file with optional microphone compensation
write_wav_analysis_csv
Write WAV analysis result to CSV file