Function fmt

Source
pub fn fmt(
    y: &[f32],
    t_min: Option<f32>,
    n_fmt: Option<usize>,
    kind: Option<&str>,
    beta: Option<f32>,
) -> Result<Array2<f32>, AudioError>
Expand description

Computes the Fourier Modulation Transform (FMT) of a signal.

§Arguments

  • y - Input signal as a slice of f32
  • t_min - Optional minimum time period in seconds (defaults to 0.005)
  • n_fmt - Optional number of modulation frequencies (defaults to 5)
  • kind - Optional transform kind (“cos” or others, defaults to “cos”)
  • beta - Optional power for magnitude scaling (defaults to 2.0)

§Returns

Returns a Result containing an Array2<f32> representing the FMT spectrogram, or an AudioError if computation fails.

§Errors

  • AudioError::InsufficientData - If signal length is less than hop_length.
  • AudioError::InvalidInput - If t_min is not positive.

§Examples

let signal = vec![1.0; 1024];
let fmt_result = fmt(&signal, None, None, None, None).unwrap();