メインコンテンツ

Low-Pass Filter (Variable Time Constant, Discrete or Continuous)

Discrete-time or continuous-time low-pass filter with external variable time constant

Since R2026a

  • Low-Pass Filter (Variable Time Constant, Discrete or Continuous) block

Libraries:
Simscape / Electrical / Control / General Control

Description

The Low-Pass Filter (Variable Time Constant, Discrete or Continuous) block implements a low-pass filter with an external time constant input and in conformance with IEEE 421.5-2016 [1]. In the standard, the filter is referred to as a Simple Time Constant.

You can switch between continuous and discrete implementations of the integrator using the Sample time parameter.

For a version of this block with the time constant as a parameter, see the Low-Pass Filter (Discrete or Continuous) block.

Equations

Continuous

To configure the filter for continuous time, set the Sample time parameter to 0. This representation is equivalent to the continuous transfer function:

G(s)=KTs+1,

where:

  • K is the filter gain.

  • T is the filter time constant.

From the preceding transfer function, the filter defining equations are:

{x˙(t)=1T(Ku(t)x(t))y(t)=x(t)y(0)=x(0)=Ku0,

where:

  • u is filter input.

  • x is filter state.

  • y is filter output.

  • t is simulation time.

  • u0 is the initial input to the block.

Discrete

To configure the filter for discrete time, set the Sample time parameter to a positive, nonzero value. To inherit the sample time from an upstream block, set the Sample time parameter to -1. The discrete representation is equivalent to the transfer function:

G(z)=K(Ts/T)z11+(Ts/T1)z1,

where:

  • K is the filter gain.

  • T is the filter time constant.

  • Ts is the filter sample time.

From the discrete transfer function, the filter equations are defined using the forward Euler method:

{x(n+1)=(1TsT)x(n)+K(TsT)u(n)y(n)=x(n)y(0)=x(0)=Ku0,

where:

  • u is the filter input.

  • x is the filter state.

  • y is the filter output.

  • n is the simulation time step.

  • u0 is the initial input to the block.

Initial Conditions

To specify the initial conditions of this block, set the Initialization parameter to:

  • Inherited from block input — The block sets the state and output initial conditions to the initial input.

  • Specify as parameter — The block sets the state initial condition to the value of the Initial state parameter.

Limiting the Integral

Set the Upper saturation limit and Lower saturation limit parameters to use the anti-windup saturation method.

The anti-windup method limits the integrator state between the lower saturation limit A and upper saturation limit B:

A<=x<=B.

Because the state is limited, the output can respond immediately to a reversal of the input sign when the integral is saturated. This block diagram depicts the implementation of the anti-windup saturation method in the filter.

A block diagram showing an anti‑windup saturation method. The input signal u passes through a gain block K and then into a summing junction. The sum feeds a gain block 1/T, which then drives an integrator. The integrator output y passes through a saturation block with upper limit A and lower limit B. The saturated output is fed back negatively into the summing junction to limit integrator windup.

This block does not provide a windup saturation method. To use the windup saturation method, set the Upper saturation limit parameter to inf, the Lower saturation limit parameter to -inf, and attach a saturation block to the output.

Bypass Filter Dynamics

To ignore the dynamics of the filter, set the time constant input to a value smaller than or equal to the sample time. When bypassed, the block feeds the gain-scaled input directly to the output:

TTsy=Ku.

In the continuous case, the sample time and time constant must both be zero.

Ports

Input

expand all

Input signal of the low-pass filter. The block uses the input initial value to determine the state initial value.

Data Types: single | double

Time constant of the low-pass filter. In the discrete implementation, to bypass the dynamics of the filter, the value at this input port must be less than the value of the Sample time parameter.

Data Types: single | double

Output

expand all

Output of the low-pass filter.

Data Types: single | double

Parameters

expand all

Gain of the low-pass filter.

Upper state limit of the low-pass filter. Set this parameter to inf for an unsaturated upper limit or to a finite value to prevent upper windup of the filter integrator.

Lower state limit of the low-pass filter. Set this parameter to -inf for an unsaturated lower limit or to a finite value to prevent lower windup of the filter integrator.

Initial state condition for the block. For more information, see Initial Conditions.

Initial state of the block.

Dependencies

To enable this parameter, set Initialization to Specify as parameter.

Time between consecutive block executions. During execution, the block produces outputs and, if appropriate, updates its internal state. For more information, see What Is Sample Time? and Specify Sample Time.

For inherited discrete-time operation, set this parameter to -1. For discrete-time operation, set this parameter to a positive scalar. For continuous-time operation, set this parameter to 0.

If this block is in a masked subsystem or a variant subsystem that supports switching between continuous operation and discrete operation, promote this parameter to ensure correct switching between the continuous and discrete implementations of the block. For more information, see Promote Block Parameters to a Mask.

References

[1] IEEE® Standard 421.5-1992. "IEEE Recommended Practice for Excitation System Models for Power System Stability Studies." August 1992. https://ieeexplore.ieee.org/document/7553421.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2026a