pub fn reassigned_spectrogram(
y: &[f32],
sr: Option<u32>,
n_fft: Option<usize>,
) -> Result<Array2<f32>, AudioError>Expand description
Computes a reassigned spectrogram for improved time-frequency resolution.
§Arguments
y- Input signal as a slice off32sr- Optional sample rate in Hz (defaults to 44100)n_fft- Optional FFT window size (defaults to 2048)
§Returns
Returns a Result containing an Array2<f32> representing the reassigned spectrogram,
or an AudioError if computation fails.
§Errors
AudioError::InsufficientData- If signal length is less thann_fft.AudioError::ComputationFailed- If STFT computation fails.
§Examples
let signal = vec![1.0; 4096];
let reassigned = reassigned_spectrogram(&signal, None, None).unwrap();