(8.D.2.7) Invert
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 _ModuleInvert
{
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.
} ModuleInvertClass;
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 | Â |
Pins
Input Pins
Name: in
Description: audio input
Data type: float
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real and Complex
Output Pins
Name: out
Description: audio output
Data type: float
MATLAB Usage
File Name: invert_module.m
M=invert_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.
Â