pub fn binary_mask_from_ratio(
target_ref: &[f32],
other_ref: &[f32],
out_mask: &mut [f32],
) -> Result<(), AudioError>Expand description
Derive a binary mask from two reference magnitude spectra (the “ideal binary mask” when
the references are the true stems): bin k is assigned to the target (1.0) when the target
reference has at least as much magnitude there as the other reference, else 0.0.
Equivalent to thresholding the ratio target / (target + other) at 0.5, but computed by
direct comparison to avoid a divide (and the 0/0 case). Zero-heap.
target_ref,other_ref: reference magnitudes, equal lengthN.out_mask: at leastNfloats; each written as0.0or1.0.
§Errors
AudioError::InvalidParameterif the two references differ in length.AudioError::OutputBufferTooSmallifout_maskis shorter than the references.