Apply output smoothing when connecting fixed-step networks with different step sizes
Simscape / Utilities / Network Couplers / Fundamental Components
Prediction and smoothing algorithms are built into the Network Coupler blocks, and you can enable them by using the check boxes in the block dialogs. The prediction and smoothing blocks in the Fundamental Components sublibrary are provided for your reference only.
When network with faster sampling (Network 1) has high-frequency activity above what the slower network (Network 2) can sample, applying smoothing to the output of Network 1 can sometimes be advantageous because it helps you avoid picking a local peak or trough of the Network 1 activity. The Smoothing (fast->slow) block provides an averaged value of the Network 1 output to Network 2. The block implementation is a masked subsystem.
The smoothing works by averaging the last N samples. You specify N by using the Number of samples over which to smooth parameter.
u — Signal with faster sampling
Connect this port to the faster network, Network 1, to capture its output.
y — Smoothed signal for the slower network
Connect this port to the input of the slower network, Network 2.
Number of samples over which to smooth — Specify number of samples for averaging the output
1 (default) | positive scalar
Specify the number of samples for averaging the output of the faster network, Network 1.
Port u discrete sample time (s) — Specify sample time for the faster network
-1 (default) | positive scalar
Specify sample time for the faster network, Network 1, in seconds.
Initial output — Specify initial output value
0 (default) | scalar
Specify initial output value for the faster network, Network 1.
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Introduced in R2022a