(8.D.2.3) InvertFract32
Overview
Phase invert module
Discussion
This module inverts the phase of a signal. Inverting the phase is simply multiplying by -1. The variable isInverted is a Boolean which controls the behavior. When isInverted=1, the module multiplies the input signal by -1. When isInverted=0, the module passes the input signal through unchanged. Internally, the module uses a first order smoother to seamlessly switch between +1 and -1. The smoothing time of the switching process is set by the smoothingTime variable.
Type Definition
typedef struct _ModuleInvertFract32
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 isInverted; // Boolean that specifies whether the signal is inverted (=1) or not (=0)
FLOAT32 smoothingTime; // Time constant of the smoothing process
FLOAT32 currentGain; // Instantaneous gain applied by the module. This is also the starting gain of the module.
FLOAT32 smoothingCoeff; // Smoothing coefficient
fract32 currentGainFract32; // Instantaneous gain applied by the module. This is also the starting gain of the module.
fract32 smoothingCoeffFract32; // Smoothing coefficient
} ModuleInvertFract32Class;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
isInverted | int | parameter | 0 | 0 | 0:1 | Â |
smoothingTime | float | parameter | 0 | 10 | 0:1000 | msec |
currentGain | float | state | 1 | 1 | -1:1 | linear |
smoothingCoeff | float | derived | 1 | 0.002081 | Unrestricted | Â |
currentGainFract32 | fract32 | state | 1 | 1 | Unrestricted | Â |
smoothingCoeffFract32 | fract32 | derived | 1 | 0.002081 | Unrestricted | Â |
Pins
Input Pins
Name: in
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: invert_fract32_module.m
M=invert_fract32_module(NAME)
Creates a module which inverts the phase of a signal (that is, sets the
gain equal to -1). The change happens smoothly with a specified
smoothing time. Arguments:
NAME - name of the module.
Â