Skip to content

LPF1Control

Discussion

THIS MODULE IS DEPRECATED AND NOT RECOMMENDED FOR NEW DESIGNS. PLEASE USE THE FOFControl MODULE INSTEAD.

This module implements a time-varying 1st order lowpass filter. The first input pin specifies the cutoff frequency of the module, in Hz. The second input pin is the audio signal. The audio signal can contain any number of channels and have any blockSize.

Internally, every time the module processes a block of data, it runs a simple design equation to compute the coefficients of the first order filter. Then, on a sample-by-sample basis, the module processes the input and then smoothes the filter coefficients with a first order IIR smoother. The .smoothingTime control variable specifies the smoothing time of the coefficient update (in milliseconds). Note, only use this module if you need time varying behavior. The fixed and smoothed filters have much lower MIPs requirements.

Module Pack

Advanced

ClassID

classID = 1294

Type Definition

typedef struct _ModuleLPF1Control
{
ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
FLOAT32 smoothingTime;                        // Time constant of the smoothing process
FLOAT32 smoothingCoeff;                       // Smoothing coefficient
FLOAT32 currentA1;                            // Instantaneous a1 filter coefficient
FLOAT32* state;                               // State variables.  2 per channel
} ModuleLPF1ControlClass;

Variables

Properties

Name Type Usage isHidden Default Value Range Units
smoothingTime float parameter 0 10 0:1000 msec
smoothingCoeff float derived 1 0.002081 Unrestricted
currentA1 float state 1 0 Unrestricted
state float* state 1 [2 x 1] Unrestricted

Pins

Input Pins

Name f
Description Cutoff frequency (Hz)
Data type float
Channel range 1
Block size range 1
Sample rate range Unrestricted
Complex support Real
Name in
Description audio input
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: lpf1_control_module.m 
 M=lpf1_control_module(NAME) 
 1st order lowpass filter with a cutoff frequency that can be set using 
 a control pin. The module supports an arbitrary number of channels. 
 Arguments: 
    NAME - name of the module. 

 The module has an internal design equation which is performed on a block 
 by block basis.  Smoothing ocurs on a sample by sample basis.  Use this 
 module only if you need dynamic time-varying behavior. 

Copyright (c) 2026 DSP Concepts, Inc.