pub fn denoise<'b>(
mz_array: &[f64],
intensity_array: &'b mut [f32],
scale: f32
) -> Result<&'b [f32], DenoisingError>
Expand description
Remove background noise from a spectrum in-place, returning the same slice of memory.
§Arguments
mz_array
- The m/z array for the spectrum. This should be relatively evenly spaced for the assumptions of this algorithm to work, so a profile spectrum is recommended.intensity_array
- The intensity for each m/z in the spectrum. This buffer will be modified in place, removing background noise using theMasSpike
algorithm and is carried forward as the return value.scale
- The multiplicity of the noise to remove. Whenscale
is small, local noise levels may be exhausted in one window before the noise is appreciably depleted in the region, leading to still-noisy spectra.