Normalizes an array of non-negative amplitudes to 0..1 by dividing by the maximum. Returns a copy. When the maximum is 0 (silence) or non-finite, returns the values clamped to [0, 1] without scaling (so an all-zero input stays all-zero).
0..1
0
[0, 1]
Normalizes an array of non-negative amplitudes to
0..1by dividing by the maximum. Returns a copy. When the maximum is0(silence) or non-finite, returns the values clamped to[0, 1]without scaling (so an all-zero input stays all-zero).