Versions Compared

Key

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

Overview

Discrete-time running-sum integral

Discussion

Approximates the integral of a discrete-time signal using the rectangle method. The integral is defined as:

...

The hidden internal array .cumSum stores the previous value of the running sum of x[n] between blocks. The length of the array is set by the prebuild function to the number of channels.

Type Definition

Code Block
typedef struct _ModuleIntegral
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    FLOAT32 gain;                                 // Additional gain.
    FLOAT32* cumSum;                              // Running sum of input samples since last reset.
} ModuleIntegralClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

gain

float

parameter

0

1

-10:10

linear

cumSum

float*

state

1

[1 x 1]

Unrestricted

Pins

Input Pins

Name: in

Description: Input signal

...

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: Output signal

Data type: float

MATLAB Usage

File Name: integral_module.m

...