Skip to main content

apply_soft_mask

Function apply_soft_mask 

Source
pub fn apply_soft_mask(
    mixture_mag: &[f32],
    mask: &[f32],
    out: &mut [f32],
) -> Result<(), AudioError>
Expand description

Apply a per-bin soft mask to a mixture magnitude spectrum: out[k] = mixture_mag[k] * mask[k].

  • mixture_mag: mixture magnitudes (any length N).
  • mask: N weights, each expected in [0, 1] (all-ones passes the mixture through, all-zeros yields silence). Values outside [0, 1] are applied as-is (caller’s choice).
  • out: at least N floats; bins 0..N are written.

§Errors