Generates a sparse spectrum containing only x values where at least one peak
contributes above the threshold. Unlike generateSpectrum, no dense array
is allocated: intervals are computed per peak first, then y is evaluated only
for the merged set of required x values.
Generates a sparse spectrum containing only x values where at least one peak contributes above the threshold. Unlike
generateSpectrum, no dense array is allocated: intervals are computed per peak first, then y is evaluated only for the merged set of required x values.