Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Scroll Documents: Update page title prefix

Overview

General purpose scaler with separate gains per channel

Discussion

Scaler (or gain) module for floating-point signals. Compared to the general purpose scaler, this module takes equal time for fadein and fadeout as decided by fadingTime. This module has a single gain (masterGain) which is applied all channels plus a separate per channel gain (trimGain). For each channel, masterGain and trimGain[n] is combined to form the target gain value.

...

The module argument NUMCHANNELS sets the initial number of channels. This allows you to configure the module for the proper number of channels before the system is built. After the system is built, NUMCHANNELS is no longer used and the number of channels is determined from the input wire.

Type Definition

Code Block
typedef struct _ModuleScalerNSymmetricFading
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    FLOAT32 masterGain;                           // Overall gain to apply.
    FLOAT32 fadingTime;                           // Time in which the target gain has to be reached (0 = unsmoothed).
    INT32 isDB;                                   // Selects between linear (=0) and dB (=1) operation
    FLOAT32* trimGain;                            // Array of trim gains, one per channel
    FLOAT32* targetGain;                          // Computed target gains in linear units
    FLOAT32* currentGain;                         // Instanteous gains. These ramp towards targetGain
    FLOAT32* factor;                              // The factor to be multiplied for implementing the exponential ramp up or ramp down
    INT32* numSamples;                            // Number of samples over which smoothing has to be applied
    FLOAT32* prevGain;                            // Previous gains
} ModuleScalerNSymmetricFadingClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

masterGain

float

parameter

0

0

-24:24

dB

fadingTime

float

parameter

0

10

0:1000

msec

isDB

int

parameter

0

1

0:1

trimGain

float*

parameter

0

[1 x 1]

-24:24

dB

targetGain

float*

derived

1

[1 x 1]

Unrestricted

currentGain

float*

state

1

[1 x 1]

Unrestricted

factor

float*

derived

1

[1 x 1]

Unrestricted

numSamples

int*

derived

1

[1 x 1]

Unrestricted

Pins

Input Pins

Name: in

Description: audio input

...

Complex support: Real and Complex

Output Pins

Name: out

Description: audio output

Data type: float

MATLAB Usage

File Name: scalern_symmetric_fading_module.m

...