naav

From DavinciWiki
Jump to: navigation, search

Description

"Normalize About Arbitrary Value" - normalizes values above and below a reference value

Arguments and Return Values

Arguments: An array of values, the center/reference value, the upper and lower bounds, a flag which controls whether the two sets are normalized independently or to the same scale, and optionally parameters for performing an aggressive normalization using anormalize

Return Value: An array of the same size as the input

Usage

Syntax: naav(inputdata [, center = VAL] [, lbound = VAL] [, ubound = VAL] [, independent = 0/1] [, anormalize = 0/1] [, steps = INT] [, backlash = INT] [, threshold = FLOAT] [, threshrepeat = INT] [, searchwidth = INT])

This function is intended for normalizing data in which it is important to maintain a "center" or other reference point. For example, audio or other waveforms in which a conventional normalization will introduce a "DC bias".

The center parameter controls the value which separates the lower and upper portions of the data. If it is not specified, it defaults to 0.0 (in other words, it defaults to operating as a "normalize about zero" function).

The lbound and ubound parameters control the lower and upper bounds which the normalized data should occupy. If these are not specified, they default to -1.0 and 1.0, respectively.

The independent flag controls whether or not the two sets of data (above and below the center value) are normalized to the same scale (0) or scaled independently (1).

The optional anormalize flag controls whether or not an aggressive normalization should be performed. If it is not specified, it defaults to 0.

The optional steps', backlash, threshold, threshrepeat, and searchwidth parameters are described in the anormalize documentation, and are only used if anormalize is set to 1.

Examples

dv> dx
1501x1x1 array of float, bsq format [6,004 bytes]

dv> dxn=naav(dx, independent=1)
Normalizing the input value about 0.000000, with an upper bound of 1.000000 and a lower bound of -1.000000.
Positive and negative values will be normalized independently.
Current minimum value: -0.301369.
Current maximum value: 0.335556.
The input data already has a maximum value of 0.335556, so its upper bound will not be clipped.
Clipping input values to a range of (0.000000) to (0.335556).
Current minimum value: -0.301369.
Current maximum value: 0.335556.
The input data already has a minimum value of -0.301369, so its lower bound will not be clipped.
Clipping input values to a range of (-0.301369) to (0.000000).
1501x1x1 array of float, bsq format [6,004 bytes]

Images

An illustration of the difference between independent and non-independent normalization, using an audio waveform:

NAAV.PNG

The positive values are identical, because the greatest absolute value in the waveform is positive. The most-negative value in the waveform is lower (in absolute value) than the greatest positive value, so without independent scaling, it is not stretched all the way to -1.0. Whether or not it is advantageous or even advisable to stretch positive and negative values independently depends on the application, of course.

For both variations, the waveform remains centered on 0.0 due to the use of naav().

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left


Recent Library Changes

Created On: 07-16-2012
Modified On: 05-02-2013

Personal tools