Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Scroll Documents: Update page title prefix

Overview

Debounces signals

Discussion

Debouncer module which limits how often a signal can change. After a signal changes, the module holds the current block for .waitTime milliseconds before allowing it to change again. If a signal is constantly changing then it will only change every .waitTime milliseconds.

...

At the start of processing, the module samples and holds the first input block. It holds this block for .waitTime until finally resampling the input.

Type Definition

Code Block
typedef struct _ModuleDebounce
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    FLOAT32 waitTime;                             // Waiting time before switching
    INT32 count;                                  // Counts down to zero
    INT32 waitCount;                              // waitTime as a number of blocks
    INT32 firstTime;                              // Indicates first block processed
    INT32* previousBlock;                         // Held block
} ModuleDebounceClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

waitTime

float

parameter

0

100

0:5000

msec

count

int

state

0

0

Unrestricted

waitCount

int

derived

1

149

Unrestricted

firstTime

int

state

1

1

Unrestricted

previousBlock

float*

state

1

[32 x 1]

Unrestricted

Pins

Input Pins

Name: in

Description: audio input

...

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: audio output

Data type: {float, int, fract32}

MATLAB Usage

File Name: debounce_module.m

...