(8.D.2.2 ) MathException
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
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
Data type: float
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real and Complex
Output Pins
Name: out
Description: audio output
Data type: float
MATLAB Usage
File Name: math_exception_module.m
M=math_exception_module(NAME)
This module eliminates NaN and Inf's from data and replaces them
with the parameter replacementValue. The module also counts how many NaN's and Inf's it
has replaced.
NAME - name of the module.
Â