Versions Compared

Key

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

Overview

Slew rate limiter

Discussion

Slew rate limiter that restricts the rate of change of a signal. The module computes the derivative of a signal and limits positive values to .maxSlew and minimum values to .minSlew. This mimics slew rate limiting that occurs in analog amplifiers.

...

The .reset flag forces the output value to match the input value. This temporarily stops slew rate limiting for 1 sample period. By default, .reset=1 when the module is constructed. This causes the module to start in a converged state (no slew limiting on the first sample). Otherwise, if you set .reset=0 before the module is built it causes the module output to start at 0 and apply slew limiting immediately.

Type Definition

Code Block
typedef struct _ModuleSlewRateLimiter
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 units;                                  // Specifies the units for the minSlew and maxSlew variables (0=sample, 1=msec, 2=sec)
    FLOAT32 minSlew;                              // Minimum allowed slew rate
    FLOAT32 maxSlew;                              // Maximum allowed slew rate
    INT32 reset;                                  // Forces the output to equal the input
    FLOAT32 minSlewSample;                        // Minimum allowed slew rate per sample
    FLOAT32 maxSlewSample;                        // Maximum allowed slew rate per sample
    FLOAT32* state;                               // State variables. One per channel
} ModuleSlewRateLimiterClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

units

int

parameter

0

2

0:2

minSlew

float

parameter

0

-100

Unrestricted

maxSlew

float

parameter

0

100

Unrestricted

reset

int

parameter

0

1

Unrestricted

minSlewSample

float

derived

1

-0.002083

Unrestricted

maxSlewSample

float

derived

1

0.002083

Unrestricted

state

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: slew_rate_limiter_module.m

...