ClipIndicatorFract32
Overview
Detects clipping by measuring when a signal level exceeds a specified threshold
Discussion
Module Pack
Standard
ClassID
classID = 138
Type Definition
typedef struct _ModuleClipIndicatorFract32
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
FLOAT32 threshold; // Threshold in dB above which clipping occurs
FLOAT32 attackTime; // Attack time of the clipping detector. Specifies how quickly the value is allowed to rise
FLOAT32 releaseTime; // Release time of the clipping detector. Specifies how quickly the value is allowed to decay
fract32 thresholdCoeff; // Internal derived parameter which equals undb20(threshold)
fract32 attackCoeff; // Internal coefficient that realizes the attack time
fract32 releaseCoeff; // Internal coefficient that realizes the release time
fract32* value; // Internal array of envelope follower state variables, one per channel
INT32* isClipping; // Boolean array of clipping values, one per channel
} ModuleClipIndicatorFract32Class;
Variables
Properties
| Name | Type | Usage | isHidden | Default Value | Range | Units |
|---|---|---|---|---|---|---|
| threshold | float | parameter | 0 | -3 | -100:0 | dB |
| attackTime | float | parameter | 0 | 5 | 0:1000 | msec |
| releaseTime | float | parameter | 0 | 100 | 0:10000 | msec |
| thresholdCoeff | fract32 | derived | 1 | 0.70795 | Unrestricted | linear |
| attackCoeff | fract32 | derived | 1 | 0.12483 | Unrestricted | |
| releaseCoeff | fract32 | derived | 1 | 0.0066445 | Unrestricted | |
| value | fract32* | state | 1 | [1 x 1] | 0:1000 | |
| isClipping | int* | state | 0 | [1 x 1] | 0:1:1 |
Pins
Input Pins
| Name | in |
| Description | audio input |
| Data type | fract32 |
| Channel range | Unrestricted |
| Block size range | Unrestricted |
| Sample rate range | Unrestricted |
| Complex support | Real |
Scratch Pins
| Channel Count | 1 |
| Block size | 32 |
| Sample rate | 48000 |
Matlab Usage
File Name: clip_indicator_fract32_module.m
M=clip_indicator_fract32_module(NAME)
Creates a module that tests for clipping of an audio signal. The
clipping threshold is programmable. Arguments:
NAME - name of the module.
Copyright (c) 2026 DSP Concepts, Inc.