Sounds Logical
Send Page To a Friend

Table Of Contents Previous Page Next Page

[M-Pack 1 overview]

M-Pack 1: WAV file processing: MATLAB function reference

simplegain
Version 1.2 Requires MATLAB 6.0 (R12) or later

Applies a simple gain to the input data. This function is intended for demonstration
purposes, and can be used as a template for building custom effects for use with
the waveffect function.

(This function is located in the AudioEffects subdirectory below the root directory containing waveffect)

File format: m-file
Editable source code:
yes
Utilises non-editable functions: no
Platform:
PC/Windows
Required MATLAB Toolboxes: none (except core MATLAB)
Demo version limitations: none
Syntax:
 

OutputData=simplegain(InputData,Gain);

Arguments:
Inputs:
InputData

matrix of input data. For example, if data is read from a WAV file using wavin (e.g. as employed within the waveffect function), then the dimensions will be [Number of samples * Number of Channels]

Gain

matrix of gain values.

If scalar, the single gain is applied to all data points.

If a row- or column vector, where the number of elements equals the number of channels (i.e. the column dimension of the InputData), then each channel (column) is multiplied by its respective gain value.

If a matrix with same dimensions as InputData, each individual data point is multiplied by its individual gain value.

If a structure, then this indicates that the function has been called from the waveffect function via a feval call. The Gain data is then assumed to be stored in the Gain field i.e. Gain.Gain under the same rules about dimensionality described above. This mechanism can be used to provide parameters of arbitrary complexity to the effect.

Output:
OutputData

matrix of output data

Inspect the source code of this function for a demonstration of how to build a function to be called by waveffect for chunk-by-chunk (disk-based) WAV file processing.

 

  waveffect WAV file effect processor (uses simplegain as example effect)
Examples:

See the Examples section of the Help page for waveffect

Top Of Page Table Of Contents Previous Page Next Page

Send Page To a Friend

home - news - products - store - support - site map - company info
© 2007 Sounds Logical. All rights reserved.
Sounds Logical
legal notice - privacy statement