clipdata

From DavinciWiki
Jump to: navigation, search

Description

A utility/shorthand function for clipping data to the specified range

Arguments and Return Values

Arguments: the input data, min/max values, and optionally a "quiet" flag

Return Value: A float array of the same size as the input

Usage

Syntax: clipdata(inputdata [, min = VAL] [, max = VAL] [, quiet = 0/1])

This is a utility/shorthand function for clipping data to a particular range. If only the upper or lower bound (but not both) is specified, then the bound which is not specified remains unclipped.

The optional quiet flag, when set to 1, causes most output messages to be suppressed.


Examples

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

dv> min(dxn)
-1.000000000

dv> max(dxn)
1.000000000

dv> dxnc=clipdata(dxn, min=-0.5, max=0.5)
Current minimum value: -1.000000.
Current maximum value: 1.000000.
Clipping input values to a range of (-0.500000) to (0.500000).
1501x1x1 array of float, bsq format [6,004 bytes]

dv> min(dxnc)
-0.5000000000

dv> max(dxnc)
0.5000000000

Images

An audio waveform before (blue) and after (red) clipping using the example syntax, above:

Clipdata-Waveform.PNG

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