Skip to main content
Skip table of contents

ScalerFract32

Overview

Linear multichannel scaler

Discussion

The Scaler module scales multichannel signals by a single gain value. By default, the module has a 1 input and 1 output pin.

The module can also be configured for an arbitrary number of input and output pins. In this case, the ith input pin is scaled and copied to the ith output pin. The same scale factor is used in all cases and the dimensions and sample rate of each signal can be arbitrary

This module is multi-type and supports both floating-point and fract32 audio signals. The module is not smoothly varying, and the gain value is applied to both the real and imaginary parts. If you update the gain value, you may introduce an audible click. For clickless operation, use the ScalerSmoothedFract32 module instead, which does not work with complex data.

Type Definition

CODE
typedef struct _ModuleScalerFract32
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    FLOAT32 gain;                                 // Linear gain
    fract32 f;                                    // Multiplicative gain factor
    INT32 shift;                                  // Number of bits to shift
} ModuleScalerFract32Class;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

gain

float

parameter

0

1

-10:10

linear

f

fract32

derived

1

0.5

Unrestricted

shift

int

derived

1

1

Unrestricted

Pins

Input Pins

Name: in1

Description: Input signal

Data type: fract32

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real and Complex

Output Pins

Name: out1

Description: Output signal

Data type: fract32

MATLAB Usage

File Name: scaler_fract32_module.m

CODE
 M=scaler_fract32_module(NAME, NUMPINS)
 Creates a linear scaler for use with the Audio Engine.  The scaler
 operates on fractional 32-bit values. By default, the scaler
 has a single multichannel input and scales all channels by the same
 value.  Arguments:
    NAME - name of the module.
    NUMPINS - Number of pins
 The module be configured for multiple pins, using an optional
 second argument:
 M=scaler_fract32_module(NAME, NUMPINS)
 The ith input pin is then scaled and placed in the ith output pin.
 In all cases, the same scale factor is applied to all values.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.