(8.D.2.7) LogicAll
Overview
Check if the input block has all non-zero values
Discussion
This module checks if all samples in the input block are non-zero. If there are zero values, then the instance variable .result is set to 0. Otherwise, if all input samples are non-zero, then .result is set to 1.
By default, the module has no output pin and the result of the computation is only stored to the internal instance variable. If the optional second input argument, OUTPUTVALUE, is set to 1, then the module has an output pin with dimension 1 channel and 1 sample. The output pin is updated on a block-by-block basis and contains .result.
When the module is bypassed, the output is set to 1.
Type Definition
typedef struct _ModuleLogicAll
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 result; // Equals 1 if all input values in the block are non-zero. Otherwise equals 0.
} ModuleLogicAllClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
result | int | state | 0 | 0 | 0:1 | Â |
Pins
Input Pins
Name: in
Description: Integer inputs
Data type: {int, fract32}
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: Contains the instance variable .result
Data type: int
MATLAB Usage
File Name: logic_all_module.m
M=logic_all_module(NAME, OUTPUTVALUE)
Audio Weaver module that checks if all input samples within a block
are non-zero. The module is similar to the MATLAB all() function.
The module sets the internal Boolean variable .result. Arguments:
NAME - name of the module.
OUTPUTVALUE - specifies whether the module has an output pin.
By default, OUTPUTVALUE=0 and the result of the
computation is only stored to the instance variable
.result. If OUTPUTVALUE=1, then the module has
an output pin with numChannels = 1 and blockSize = 1
containing .result.
Â