TimeOut
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 _ModuleTimeOut
{
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 behavior: MuteTheOutput=0 ReduceTheOutputLevel=1 PlaySineTone=2
FLOAT32 outputLevel; // Output level after timeout in dB.
FLOAT32 currentGain; // Instantaneous gain applied by the module. This is also the starting gain of the module.
FLOAT32 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.
FLOAT32 smoothingCoeff; // Smoothing coefficient.
FLOAT32* sineTable; // Pre-computed Sine tone table.
} ModuleTimeOutClass;
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 | float | state | 0 | 0 | Unrestricted | |
gain | float | 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 | float | derived | 1 | 0.0006942 | Unrestricted | |
sineTable | float* | state | 0 | [200 x 1] | Unrestricted |
Pins
Input Pins
Name: in1
Description: audio input
Data type: float
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out1
Description: audio output
Data type: float
MATLAB Usage
File Name: timeout_module.m
M = timeout_module(NAME, NUMPINS)
General purpose Timeout module. 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.