AudioTools - Maple Programming Help

Home : Support : Online Help : Programming : Audio Processing : AudioTools/Normalize

AudioTools

 Normalize
 normalizes audio sample values to a specified maximum amplitude

 Calling Sequence Normalize(audArray, amplitude=value)

Parameters

 audArray - Array, Vector, or Matrix containing the audio data to normalize amplitude=value - (optional) the peak amplitude of the result

Description

 • The Normalize command adjusts the amplitude of samples in a recording so the maximum amplitude of any one sample is as specified.
 • The audArray parameter specifies the audio data to normalize, and must be a dense, rectangular, one or two dimensional Array, Vector, or Matrix with datatype=float[8].
 • The amplitude=value option specifies the maximum amplitude that any sample may have. If omitted, this defaults to 1.0.
 • The Normalize command is often useful after performing other audio processing operations that may have produced out-of-bound values, or very low amplitudes.

Examples

 > $\mathrm{audiofile}≔\mathrm{cat}\left(\mathrm{kernelopts}\left(\mathrm{datadir}\right),"/audio/stereo.wav"\right):$
 > $\mathrm{with}\left(\mathrm{AudioTools}\right):$
 > $\mathrm{aud}≔\mathrm{Read}\left(\mathrm{audiofile}\right)$
 ${\mathrm{aud}}{≔}\left[\begin{array}{c}{\mathrm{1..19962 x 1..2}}{\mathrm{Array}}\\ {\mathrm{Data Type:}}{\mathrm{float}}{[}{8}{]}\\ {\mathrm{Storage:}}{\mathrm{rectangular}}\\ {\mathrm{Order:}}{\mathrm{C_order}}\end{array}\right]$ (1)
 > $\mathrm{printf}\left("%6.3f",{\mathrm{aud}}_{1000..1015}\right)$
 0.378 -0.547  0.465  0.921  0.535  0.898  0.598  0.992  0.638  0.898  0.669 -0.625  0.685 -0.734  0.685 -0.945  0.669  0.669  0.646 -0.281  0.606 -0.828  0.559 -0.891  0.504 -0.586  0.449  0.976  0.378 -0.477  0.315 -0.602
 > $\mathrm{normed}≔\mathrm{Normalize}\left({\mathrm{aud}}_{1000..1015}\right):$
 > $\mathrm{printf}\left("%6.3f",\mathrm{normed}\right)$
 0.186 -1.041  0.300  0.906  0.394  0.875  0.478  1.000  0.530  0.875  0.572 -1.145  0.593 -1.290  0.593 -1.569  0.572  0.572  0.541 -0.689  0.488 -1.414  0.426 -1.497  0.353 -1.093  0.279  0.979  0.186 -0.948  0.102 -1.113