Versions Compared

Key

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

Overview

Eliminates NaN and Inf from data

Discussion

This module detects NaN and Inf values in floating-point data and sets them to replacementValue. The module also keeps track of how many of each type of exception is detected. .infCount contains the number of Inf values seen (both positive and negative). .nanCount contains the number of NaN values see.

The module is useful for debugging mathematical errors such as divide by zero.

Type Definition

Code Block
typedef struct _ModuleMathException
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 nanCount;                               // Number of NaNs encountered
    INT32 infCount;                               // Number of Infs encountered
    FLOAT32 replacementValue;                     // NaN and Inf values are replaced with this number.
} ModuleMathExceptionClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

nanCount

int

state

0

0

Unrestricted

infCount

int

state

0

0

Unrestricted

replacementValue

float

parameter

0

0

Unrestricted

Pins

Input Pins

Name: in

Description: audio input

...

Complex support: Real and Complex

Output Pins

Name: out

Description: audio output

Data type: float

MATLAB Usage

File Name: math_exception_module.m

...