matlab-analyze-time-frequency-content

Analyze time-frequency content in MATLAB using CWT, STFT, synchrosqueezing, and wavelet coherence.

995|122|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-analyze-time-frequency-content
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab-analyze-time-frequency-content
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/signal-processing/matlab-analyze-time-frequency-content
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-analyze-time-frequency-content

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Choosing and correctly applying time-frequency analysis methods in MATLAB is error-prone: STFT, CWT, synchrosqueezing, reassignment, EMD/VMD, and wavelet coherence each have different parameter conventions, invertibility properties, and toolbox requirements. This Skill guides an AI agent to select the right method, avoid common API mistakes, and produce correct MATLAB code for time-frequency analysis.

Core Features & Use Cases

  • Method Selection Guidance: Decision trees and selection tables map user goals (visualization, mode extraction, cross-signal comparison, instantaneous frequency) to the correct MATLAB function such as stft, cwt, fsst, wsst, wcoherence, emd, or vmd.
  • Critical API Rules: Documents pitfalls like wsstridge argument order, wsst mean subtraction, xspectrogram real first output, and stft/istft length-preservation conditions.
  • Signal Assessment Workflow: Runs an assessment script on the user's signal and interprets the results to recommend an analysis approach.
  • Use Case: A user asks how to separate two closely-spaced chirp components and reconstruct them individually; the Skill directs the agent to use fsst, tfridge with a penalty, and ifsst with matching window parameters.

Quick Start

Ask the agent to analyze how the frequency content of your signal evolves over time and recommend the best MATLAB method for your goal.

Frequently Asked Questions about matlab-analyze-time-frequency-content

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

FAQPage Schema
How do I choose between STFT and CWT for time-frequency analysis in MATLAB?

Use STFT (stft, spectrogram) when you need uniform frequency resolution or must resolve closely-spaced high-frequency tones. Use CWT (cwt) for multi-resolution analysis of signals with transients or wideband content, since its constant-Q property gives better time resolution at high frequencies.

How do I extract and reconstruct individual signal components in MATLAB?

Use synchrosqueezing: fsst followed by tfridge and ifsst in the STFT domain gives machine-precision reconstruction, or wsst with wsstridge and iwsst in the CWT domain for approximate reconstruction. Note that wsst subtracts the signal mean and iwsst does not restore it.

What is the difference between wcoherence and xspectrogram in MATLAB?

wcoherence computes time-varying magnitude-squared coherence between two signals using wavelets, while xspectrogram computes the time-varying cross-spectrum using the STFT with uniform frequency resolution. For phase information from xspectrogram, use its fourth output since the first output is real magnitude only.

Why does istft return a different length than my original signal?

The ratio (Nx - L) / (M - L) must be an integer for istft to preserve length, where Nx is signal length, L is overlap, and M is window length. Adjust the window or overlap parameters to satisfy this condition, and verify the COLA constraint with iscola.

When should I use EMD versus VMD for signal decomposition?

Use EMD for exploratory analysis when the number of components is unknown, since it is fully adaptive but may return fewer modes than MaxNumIMF. Use VMD when you know the exact number of narrowband components, as NumIMFs is an exact count and the optimization separates modes cleanly.

Which MATLAB toolboxes are required for time-frequency analysis?

STFT, spectrogram, fsst, and xspectrogram require Signal Processing Toolbox, while cwt, wsst, wcoherence, modwt, emd, vmd, and hht require Wavelet Toolbox. Most functions are available from R2024b, except tffilt which requires R2025a.