(8.D.2.2) LinSmooth
Overview
Linear Smoothing with separate Up/Down time constants
Discussion
This module restricts the rate of change of a signal in a linear fashion. It computes the steps by calculating the delta between the current and the target value and its rate defined by a time constant. Different smoothing times for up- and down stepping can be defined.
Type Definition
typedef struct _ModuleLinSmooth
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
FLOAT32 smoothingTimeUp; // Smoothing Time Up in ms
FLOAT32 smoothingTimeDown; // Smoothing Time Down in ms
FLOAT32 slewDown; // State variables. One per channel
FLOAT32 slewUp; // State variables. One per channel
FLOAT32 slewStepsUp; // Inverse of slew
FLOAT32 slewStepsDown; // Inverse of slew
FLOAT32* state; // State variables. One per channel
FLOAT32* slew; // State variables. One per channel
INT32* counter; // State variables. One per channel
FLOAT32* targetValue; // Ramping target value
} ModuleLinSmoothClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
smoothingTimeUp | float | parameter | 0 | 20 | 0:10000 | msec |
smoothingTimeDown | float | parameter | 0 | 20 | 0:10000 | msec |
slewDown | float | state | 0 | 0.001042 | Unrestricted | Â |
slewUp | float | state | 1 | 0.001042 | Unrestricted | Â |
slewStepsUp | float | derived | 1 | 960 | Unrestricted | Â |
slewStepsDown | float | derived | 1 | 960 | Unrestricted | Â |
state | float* | state | 1 | [1 x 1] | Unrestricted | Â |
slew | float* | state | 1 | [1 x 1] | Unrestricted | Â |
counter | int* | state | 1 | [1 x 1] | Unrestricted | Â |
targetValue | float* | state | 1 | [1 x 1] | Unrestricted | Â |
Pins
Input Pins
Name: in
Description: Audio In
Data type: float
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: Audio Output
Data type: float
MATLAB Usage
File Name: lin_smooth_module.m