Overview
Counts repeated input values
Discussion
This module checks for repeated input samples from a single channel. The instance variable .value is set to the last input sample value. The instance variable .count is set to the number of consecutive times that the input signal was equal to .value. If the last two input samples are not equal, then .count equals 1.
...
When bypassed and OUTPUTVALUE=1, the module always outputs the last input sample on pin .value and sets pin .count to 1. When muted and OUTPUTVALUE=1, the module always outputs zero on pin .value and sets pin .count to 0.
Type Definition
Code Block |
---|
typedef struct _ModuleConsecutiveCountInt { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 value; // Equals the last input sample UINT32 count; // Number of consecutive times that the last input sample was seen } ModuleConsecutiveCountIntClass; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
value | int | state | 0 | 0 | Unrestricted | |
count | uint | state | 0 | 0 | Unrestricted |
Pins
Input Pins
Name: in
Description: Integer inputs
...
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: value
Description: Contains the instance variable .value
...
Description: Contains the instance variable .count
Data type: int
MATLAB Usage
File Name: consecutive_count_int_module.m
...