simulink-frequency-response

Estimate frequency response from Simulink models using simulation-based frestimate workflows.

1.0k|98|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/matlab/simulink-agentic-toolkit --skill simulink-frequency-response
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: simulink-frequency-response
Source: https://github.com/matlab/simulink-agentic-toolkit/tree/main/skills-catalog/control-systems/simulink-frequency-response
Command: npx skills add https://github.com/matlab/simulink-agentic-toolkit --skill simulink-frequency-response

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Analytical linearization with linearize fails or returns zero for Simulink models containing hard discontinuities such as PWM, switching elements, relays, or quantizers, leaving no way to obtain frequency response data. This Skill provides a simulation-based estimation workflow using frestimate that works on any discontinuous model.

Core Features & Use Cases

  • Simulation-Based Estimation: Estimate frequency response with frestimate using PRBS or Sinestream perturbation signals, producing frd data objects for Bode plots and margin analysis.
  • Guided Signal Selection: Decision logic for choosing PRBS versus Sinestream, configuring sample times, amplitudes, and validating simulation duration with getSimulationTime.
  • Time-Varying Source Handling: Identify and disable source blocks with frest.findSources and BlocksToHoldConstant so the model stays at its operating point during estimation.
  • Use Case: A buck converter model with PWM switching linearizes to zero. Use this Skill to define I/O points, inject a PRBS signal, run frestimate, and fit a transfer function with tfest to obtain a usable linear model.

Quick Start

Estimate the frequency response of my Simulink model from the input block to the output block using frestimate with a PRBS signal.

Frequently Asked Questions about simulink-frequency-response

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I estimate frequency response from a Simulink model?

Define I/O points with linio, create a perturbation signal such as frest.PRBS, then call frestimate with the model, I/O points, and signal. The result is an frd object you can plot or fit with tfest.

When should I use frestimate instead of linearize in Simulink?

Use frestimate when the model contains hard discontinuities like PWM, switching, relays, or quantizers that cause linearize to return zero or NaN. If the model linearizes cleanly, linearize is the simpler choice.

PRBS vs Sinestream for frequency response estimation?

PRBS estimates the full frequency range in a single simulation and is the default choice. Sinestream simulates each frequency sequentially, making it slower but more precise at specific frequencies.

Why does frestimate give wrong gain estimates on my model?

Time-varying source blocks like Step or Signal Generator can drive the model away from its operating point during estimation. Use frest.findSources to identify them and set BlocksToHoldConstant in frestimateOptions to hold them constant.

What products are required for Simulink frequency response estimation?

frestimate requires Simulink Control Design and Control System Toolbox, with MATLAB R2023a or later recommended. Fitting parametric models with tfest additionally uses System Identification Toolbox.