采纳的回答

dmin = min(data(:));
dmax = max(data(:));
scaled_data = (data - dmin)./(dmax - dmin) * 2 - 1;
or more simply,
scaled_data = mat2gray(data) * 2 - 1;
Multiply by 2 and subtract 1 is a very convenient mapping from [0 1] to [-1 1]

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Acoustics, Noise and Vibration 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by