(8.D.2.1) SMixer2x1Fract32
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 module's .gain1 and .gain2 variables specify the target gains for the mixing process. The module's .currentGain1 and .currentGain2 variables 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
typedef struct _ModuleSMixer2x1Fract32
{
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
fract32 targetGain1; // Fractional portion of the desired (or target) gain of the first channel
fract32 currentGain1; // Fractional portion of the instantaneous gain of the first channel
fract32 targetGain2; // Fractional portion of the desired (or target) gain of the second channel
fract32 currentGain2; // Fractional portion of the instantaneous gain of the second channel
fract32 smoothingCoeff; // Smoothing coefficient
INT32 postShift; // Number of bits to shift after the fractional multiply. This is based on gain.range.
FLOAT32 twoPowMinusPostShift; // 2^(-postShift). Used by to streamline the operation of the set function
} ModuleSMixer2x1Fract32Class;
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 |
targetGain1 | fract32 | derived | 1 | 0.0625 | Unrestricted | Â |
currentGain1 | fract32 | state | 1 | 0.0625 | Unrestricted | Â |
targetGain2 | fract32 | derived | 1 | 0.0625 | Unrestricted | Â |
currentGain2 | fract32 | state | 1 | 0.0625 | Unrestricted | Â |
smoothingCoeff | fract32 | derived | 1 | 0.002081 | Unrestricted | Â |
postShift | int | derived | 1 | 4 | Unrestricted | Â |
twoPowMinusPostShift | float | derived | 1 | 0.0625 | Unrestricted | Â |
Pins
Input Pins
Name: in1
Description: audio input
Data type: fract32
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Â
Name: in2
Description: audio input
Data type: fract32
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: audio output
Data type: fract32
MATLAB Usage
File Name: smixer2x1_fract32_module.m
M=smixer2x1_fract32_module(NAME)
Creates a 2-input 1-output smoothly varying mixer for use in the
Audio Weaver environment. Arguments:
NAME - name of the module.
Copyright 2007. DSP Concepts, Inc. All Rights Reserved.
Author: Paul Beckmann
AudioWeaverModule [This tag makes it appear under awe_help]
----------------------------------------------------------------------
Create the high-level object with interface variables only.
----------------------------------------------------------------------
Â