Overview
Checks if the input signal levels are within a specified upper and lower range.
Discussion
This module determines if the input signal falls within a specified range. The range is specified by the instance variables .lower and .upper. An input sample falls within the range if (in[i] >= .lower) && (in[i] <= .upper). The instance variable .withinRange is set to 1 if all of the input samples are within range. If one or more input samples are outside of the allowable range, then .withinRange is set to 0.
...
When the module is bypassed, the output is set to 1.
Type Definition
Code Block |
---|
typedef struct _ModuleWithinRangeFract32 { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure fract32 lower; // Lower edge of the allowable range fract32 upper; // Upper edge of the allowable range INT32 withinRange; // Equals 1 if all input samples in the block are within range. Otherwise equals 0. INT32 outputValue; // Specifies the behavior of the output pin. } ModuleWithinRangeFract32Class; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
lower | fract32 | parameter | 0 | -0.5 | -1:1 | |
upper | fract32 | parameter | 0 | 0.5 | -1:1 | |
withinRange | int | state | 0 | 0 | Unrestricted | |
outputValue | int | const | 0 | 1 | Unrestricted |
Pins
Input Pins
Name: in
Description: audio input
...
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: Boolean
Data type: int
MATLAB Usage
File Name: within_range_fract32_module.m
...