(8.D.1.2) TimeOutFract32
Overview
General purpose time out module with configurable timeout in seconds
Discussion
General purpose time out module for floating-point signals. The module counts the blocks untill the timeOut seconds reached. Behaviour after the timeout is controlled by the parameter timeOutBehaviour. It is a droplist control with 0-mute output, 1-attenuate output and 2-Sine tone output. The attenuation level is controled by the parameter outputLevel in dB.
The module supports multiple input and output pins using the argument NUMPINS. By default, NUMPINS=1 and the module has a single input and output pin. If you set NUMPINS > 1 then the timeout applied on all pins with same settings.
Type Definition
typedef struct _ModuleTimeOutFract32
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
FLOAT32 timeOut; // Timeout value in seconds. Module waits these many seconds and applies timeout based on timeOutBehaviour.
INT32 timeOutBehaviour; // Selects the timeout behaviour: MuteTheOutput=0 ReduceTheOutputLevel=1 PlaySineTone=2
FLOAT32 outputLevel; // Output level after timeout in dB.
fract32 currentGain; // Instantaneous gain applied by the module. This is also the starting gain of the module.
fract32 gain; // Target gain in linear units.
FLOAT32 sineFreq; // Sine tone frequency in Hz.
INT32 sineTableSize; // Sine table length.
INT32 sineTableIndx; // Sine table read index.
INT32 currentBlockCount; // Blocks counter.
INT32 blockCounterCount; // Number of blocks to wait before timeout occures.
FLOAT32 smoothingTime; // Time constant of the smoothing process.
fract32 smoothingCoeff; // Smoothing coefficient.
INT32 postShift; // Number of bits to shift after the fractional multiply. This is based on outputLevel.range.
FLOAT32 twoPowMinusPostShift; // 2^(-postShift). Used by to streamline the operation of the set function
fract32* sineTable; // Pre-computed Sine tone table.
} ModuleTimeOutFract32Class;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
timeOut | float | parameter | 0 | 10 | Unrestricted | sec |
timeOutBehaviour | int | parameter | 0 | 0 | 0:2 | Â |
outputLevel | float | parameter | 0 | 0 | -50:0 | Â |
currentGain | fract32 | state | 0 | 0 | Unrestricted | Â |
gain | fract32 | derived | 1 | 1 | Unrestricted | Â |
sineFreq | float | const | 1 | 240 | Unrestricted | Â |
sineTableSize | int | derived | 1 | 200 | Unrestricted | Â |
sineTableIndx | int | state | 1 | 0 | Unrestricted | Â |
currentBlockCount | int | state | 1 | 0 | Unrestricted | Â |
blockCounterCount | int | derived | 1 | 15000 | Unrestricted | Â |
smoothingTime | float | const | 1 | 30 | Unrestricted | msec |
smoothingCoeff | fract32 | derived | 1 | 0.0006942 | Unrestricted | Â |
postShift | int | derived | 1 | 0 | Unrestricted | Â |
twoPowMinusPostShift | float | derived | 1 | 1 | Unrestricted | Â |
sineTable | fract32* | state | 0 | [200 x 1] | 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
Output Pins
Name: out1
Description: audio output
Data type: fract32
MATLAB Usage
File Name: timeout_fract32_module.m
M = timeout_fract32_module(NAME, NUMPINS)
Fract32 version of general purpose Timeout moudle. Module waits for TimeOut seconds and then once
the timeout is reached the output will be muted or attenuated or a sine wave
depending on the parameter timeOutBehaviour. User can control the timeout level
through the parameter outputLevel. Arguments:
NAME - name of the module.
NUMPINS - number of pins. Default = 1.
Â