Versions Compared

Key

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

Overview

2-input x 1-output smoothly varying mixer module

Discussion

Mixes 2 inputs into a single output. The mixing gain parameters are exponentially smoothed (first order IIR) at the sample rate, with the smoothingTime parameter determining the smoothing rate for both of the gain values. The variables, gain1 and gain2, specify the target gains for the mixing process. The variables, currentGain1 and currentGain2, specify the instantaneous gains applied, and these exponentially approach the target gains. At build time, currentGain1 is set to gain1 and currentGain2 is set to gain2. This causes the mixers to startup in a converged state.

Type Definition

Code Block
typedef struct _ModuleSMixer2x1
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    FLOAT32 gain1;                                // Desired gain applied to first input channel.
    FLOAT32 gain2;                                // Desired gain applied to second input channel.
    FLOAT32 smoothingTime;                        // Time constant of the smoothing process.
    FLOAT32 currentGain1;                         // Instantaneous gain for the first input channel.
    FLOAT32 currentGain2;                         // Instantaneous gain for the second input channel.
    FLOAT32 smoothingCoeff;                       // Smoothing coefficient.
} ModuleSMixer2x1Class;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

gain1

float

parameter

0

1

-10:10

gain2

float

parameter

0

1

-10:10

smoothingTime

float

parameter

0

10

0:1000

msec

currentGain1

float

state

1

1

-10:10

linear

currentGain2

float

state

1

1

-10:10

linear

smoothingCoeff

float

derived

1

0.002081

Unrestricted

Pins

Input Pins

Name: in1

Description: audio input

...

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: audio output

Data type: {float, int, fract32}

MATLAB Usage

File Name: smixer2x1_module.m

...