本文へ移動
cccskills
無料GitHub で公開

matlab-analyze-time-frequency-content

Perform time-frequency analysis in MATLAB using CWT, STFT, synchrosqueezing, reassignment, wavelet coherence, cross spectrogram, EMD/VMD, multiresolution analysis, and time-frequency filtering. Triggers on: time-frequency, spectrogram, scalogram, cwt, stft, istft, fsst, wsst, wcoherence, xspectrogram, modwt, modwtmra, modwpt, emd, vmd, hht, tffilt, dgt, gabor, instantaneous frequency, synchrosqueezing, reassignment, ridge extraction, wavelet coherence, cross spectrum, mode decomposition, signal decomposition, time-frequency filtering.

インストール方法を見る

含まれるファイル(15)

  • SKILL.md10.7 KB
  • manifest.yaml517 B
  • references/cross-analysis-guide.md11.7 KB
  • references/cwt-guide.md22.3 KB
  • references/method-selection-guide.md6.2 KB
  • references/multiresolution-guide.md17.9 KB
  • references/reassignment-guide.md11.8 KB
  • references/stft-guide.md16.4 KB
  • scripts/assessBoundary.m3.1 KB
  • scripts/assessSignalForTF.m4.8 KB
  • scripts/assessSpectralEnergy.m3.4 KB
  • scripts/boundaryExDisjointSine.mat7.6 KB
  • scripts/illustrateBoundary.m902 B
  • scripts/illustrateTransientLocalization.m1.3 KB
  • scripts/plotAntiAnalyticScalogram.m831 B

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Time-Frequency Analysis in MATLAB

Analyze how frequency content evolves over time using STFT, CWT, synchrosqueezing, reassignment, cross-signal methods, and data-adaptive decomposition.

Agent directive: Consult the reference guides in references/ before answering. Each guide covers a specific domain with syntax, gotchas, and common mistakes.

When To Use

  • Analyzing how frequency content evolves over time (spectrogram, scalogram)
  • Choosing between STFT, CWT, synchrosqueezing, reassignment, or EMD/VMD
  • Extracting and reconstructing individual signal components from a TF representation
  • Computing time-varying coherence or cross-spectrum between two signals
  • Decomposing signals into additive time-domain components (wavelet MRA, EMD, VMD)
  • Estimating instantaneous frequency or Hilbert spectrum

When Not To Use

  • Designing or applying classical FIR/IIR filters — use matlab-design-digital-filter
  • Extracting scalar features for ML classification — use matlab-extract-signal-features
  • Signal preprocessing (resampling, detrending, gap filling) — use matlab-prepare-signal-data
  • Quadratic/bilinear TFDs (Wigner-Ville) — not supported in MATLAB toolboxes
  • Audio-specific representations (mel spectrogram, MFCC) — use Audio Toolbox

Method Selection

Choose the analysis method based on the user's goal and signal characteristics:

GoalMethodGuide
Interactive TF exploration (spectrogram + scalogram)signalAnalyzer—
General TF visualization (uniform freq resolution)stft, spectrogram, pspectrumreferences/stft-guide.md
TF visualization (multi-resolution, constant-Q)cwt, cwtfilterbankreferences/cwt-guide.md
Sharpest TF picture (non-invertible)spectrogram("reassigned"), pspectrum(Reassigned=true)references/reassignment-guide.md
Remove specific TF regions (mask-based filtering)tffilt with binary maskreferences/stft-guide.md
Mode extraction + reconstruction (STFT domain)fsst → tfridge → ifsstreferences/reassignment-guide.md
Mode extraction + reconstruction (CWT domain)wsst → wsstridge → iwsstreferences/reassignment-guide.md
Signal reconstruction from CWTicwt (exact or approximate)references/cwt-guide.md
Additive decomposition (octave bands)modwt + modwtmrareferences/multiresolution-guide.md
Additive decomposition (uniform bands)modwptdetailsreferences/multiresolution-guide.md
Adaptive decomposition (unknown components)emdreferences/multiresolution-guide.md
Adaptive decomposition (known mode count)vmdreferences/multiresolution-guide.md
Hilbert spectrum / instantaneous frequencyhht, instfreqreferences/multiresolution-guide.md
Time-varying coherence between two signalswcoherencereferences/cross-analysis-guide.md
Cross spectrogram between two signalsxspectrogramreferences/cross-analysis-guide.md
Global coherence (no time axis)mscohere, cpsdreferences/cross-analysis-guide.md

For detailed decision logic, see references/method-selection-guide.md.

Quick Decision Tree

What is the primary goal?
│
├── Interactive exploration (adjust parameters, compare views)
│   └── signalAnalyzer — supports spectrogram + scalogram (CWT) side by side
│
├── Visualize one signal's TF content
│   ├── Need uniform frequency resolution? → stft / spectrogram / pspectrum
│   ├── Need multi-resolution (better low-freq)? → cwt
│   └── Need sharpest picture (no reconstruction)? → spectrogram("reassigned")
│
├── Remove unwanted content visible in spectrogram
│   └── Define binary mask over TF plane → tffilt (Gabor domain)
│
├── Extract and reconstruct individual components
│   ├── From TF representation (invertible)?
│   │   ├── STFT domain → fsst → tfridge → ifsst
│   │   └── CWT domain → wsst → wsstridge → iwsst
│   ├── Additive time-domain components?
│   │   ├── Octave bands → modwt + modwtmra
│   │   ├── Uniform bands → modwptdetails
│   │   └── Data-adaptive → emd or vmd
│   └── From CWT directly? → icwt (see references/cwt-guide.md)
│
├── Compare two signals
│   ├── Time-varying coherence? → wcoherence
│   ├── Time-varying cross-spectrum? → xspectrogram
│   └── Global relationship? → mscohere / cpsd
│
└── Estimate instantaneous frequency
    ├── Single monocomponent signal? → instfreq(x, fs)
    ├── Multicomponent (want per-mode IF)? → emd → instfreq(imf, fs)
    └── Multicomponent (want single average)? → instfreq(x, fs, Method="tfmoment")

Critical Rules

  1. stft has no reassignment option. Use fsst for invertible synchrosqueezing or spectrogram("reassigned") for non-invertible visualization.

  2. wsstridge argument order differs from tfridge:

    • wsstridge(sst, penalty, f, ...) — penalty is 2nd positional arg
    • tfridge(tfm, f, penalty, ...) — penalty is 3rd positional arg
  3. wsst subtracts the signal mean internally. iwsst does NOT restore it. Add mean(x) back manually if DC matters.

  4. ifsst is machine-precision; iwsst is approximate (Morlet single-integral formula).

  5. xspectrogram first output is real (cross-spectrogram magnitude). For phase, use the 4th output P. This differs from spectrogram whose first output is complex STFT.

  6. wcoherence has no Parent option. For App Designer, compute outputs and plot manually.

  7. wcoherence phase arrows show the phase lag of Y relative to X:

    • ↑ = Y lags X by π/2
    • ↓ = Y leads X by π/2
    • → = in-phase
    • ← = anti-phase PhaseDisplayThreshold (default 0.5) is plot-only — it controls which arrows are drawn but has no effect on returned numeric outputs.
  8. hht takes IMFs, not raw signal. Always decompose first: imf = emd(x); hht(imf, fs).

  9. instfreq Hilbert method is meaningless for multicomponent signals. Decompose first, or use Method="tfmoment" for a single average curve.

  10. Synchrosqueezing is precision-sensitive. Use double-precision data with fsst/wsst for reproducible results across MATLAB, codegen, and GPU.

Signal Assessment Workflow

When the user provides a signal and asks "what should I use?", run the assessment script then apply agent-side interpretation:

Step 1: Run MATLAB assessment

report = assessSignalForTF(x, fs);
disp(report)
disp(report.recommendations)

The script returns: signal length, occupied bandwidth, number of spectral peaks (with frequencies), nonstationarity indicator, DC content, precision, and auto-generated recommendations.

Step 2: Agent-side interpretation (combine script output with user goals)

User GoalKey Report FieldsRecommendation Logic
"Explore / I'm not sure what I need"—Suggest signalAnalyzer for interactive exploration (spectrogram + scalogram views, adjustable parameters)
"Visualize frequency content over time"likelyNonstationary, fractionalBandwidthIf wideband (>2 octaves): cwt. If narrowband or uniform resolution needed: stft/spectrogram
"Separate/extract components"numSpectralPeaks, peakFrequenciesHz2–3 peaks: synchrosqueezing (fsst/wsst). Many peaks: emd/vmd. Closely-spaced: modwptdetails or fsst
"Reconstruct after filtering"hasDC, precisionfsst/ifsst for exact. wsst/iwsst for CWT-domain (warn about mean). icwt for CWT bandpass
"Compare two signals"(run on both)wcoherence for coherence. xspectrogram for cross-spectrum
"Detect transients/events"signalLength, occupiedBandHzcwt with low TimeBandwidth. Or short-window stft

Step 3: Refine with follow-up questions if ambiguous

  • "Do you need to reconstruct the signal, or just visualize?"
  • "Do you need uniform frequency resolution, or is multi-resolution acceptable?"
  • "Are you comparing this signal to another?"

Reference Guides

FileCoverage
references/stft-guide.mdstft/istft, spectrogram, pspectrum, stftmag2sig, length preservation, COLA
references/cwt-guide.mdcwt, cwtfilterbank, icwt, dlicwt/icwtLayer, boundary, constant-Q
references/reassignment-guide.mdfsst/ifsst, wsst/iwsst, spectrogram("reassigned"), pspectrum(Reassigned=true), ridge extraction, penalty
references/cross-analysis-guide.mdwcoherence, xspectrogram, cpsd, mscohere, phase arrows, unsmoothed cross-spectrum
references/multiresolution-guide.mdmodwt/modwtmra, modwpt/modwptdetails, emd, vmd, hht, instfreq, instbw
references/method-selection-guide.mdDecision logic for choosing among all methods

Toolbox Requirements

ToolboxFunctions
Signal Processingstft, istft, spectrogram, pspectrum, fsst, ifsst, tfridge, xspectrogram, instfreq, instbw, stftmag2sig, cpsd, mscohere
Waveletcwt, cwtfilterbank, icwt, wsst, iwsst, wsstridge, wcoherence, modwt, modwtmra, modwpt, modwptdetails, emd, vmd, hht, tffilt, dgt
FunctionAvailable FromNote
tffiltR2025aTF mask-based filtering; all other functions available in R2024b

Documentation References

TopicLink
Time-frequency galleryhttps://www.mathworks.com/help/signal/time-frequency-analysis.html
Wavelet time-frequencyhttps://www.mathworks.com/help/wavelet/time-frequency-analysis.html
CWT referencehttps://www.mathworks.com/help/wavelet/ref/cwt.html
STFT referencehttps://www.mathworks.com/help/signal/ref/stft.html
Synchrosqueezing examplehttps://www.mathworks.com/help/wavelet/ug/time-frequency-reassignment-and-mode-extraction-with-synchrosqueezing.html
Wavelet coherence examplehttps://www.mathworks.com/help/wavelet/ug/compare-time-frequency-content-in-signals-with-wavelet-coherence.html

Copyright 2026 The MathWorks, Inc.


レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Guide for accessing financial and economic data in MATLAB using the Datafeed Toolbox. Covers Bloomberg (market data via bloomberg/blp/bloombergHypermedia), FRED (Federal Reserve economic data via fredrs), Haver Analytics (economic data via haver/haverdirect/haverview), and LSEG Datastream (historical data via datastreamws). Use when connecting to any of these data providers from MATLAB.

日本語の概要は準備中です。原文の説明を表示しています。

matlab/matlab-agentic-toolkit1,1502026年10月9日 更新

Read BEFORE writing any code that adds Additive White Gaussian Noise (AWGN) to signals and converts between SNR, Eb/No, Es/No, and per-subcarrier SNR for communications simulations, using awgn(), convertSNR(), berawgn(). The default MATLAB patterns for AWGN (e.g., 'measured' option, manual SNR formulas) produce subtly incorrect results. This skill specifies the correct calling conventions, required function usage, and critical anti-patterns that must be avoided.

日本語の概要は準備中です。原文の説明を表示しています。

matlab/matlab-agentic-toolkit1,1502026年10月9日 更新

Analyze AMS waveform data using Mixed-Signal Blockset utilities: phase noise measurement, clock jitter, anti-aliased resampling, timing measurements, lock time, INL/DNL, ADC/DAC calibration, HSpice import. Use when analyzing time-domain voltage from PLL/VCO/clock simulations, measuring phase noise from variable-step solver output, computing jitter, or resampling non-uniform data.

日本語の概要は準備中です。原文の説明を表示しています。

matlab/matlab-agentic-toolkit1,1502026年10月9日 更新

Design and analyze electrically large antenna structures using MATLAB Antenna Toolbox. Covers reflector antennas (parabolic, Cassegrain, Gregorian, offset, corner, cylindrical, spherical, custom STL), reflectarrays and reconfigurable intelligent surfaces (RIS), antennas installed on platforms (vehicles, aircraft, ships, satellites), and radar cross section (RCS) analysis. Includes solver selection (MoM-PO, PO, MoM, FMM), mesh control, and GPU acceleration. Use when the user wants to design a dish/reflector antenna, reflectarray, analyze an antenna on a platform, or compute RCS.

日本語の概要は準備中です。原文の説明を表示しています。

matlab/matlab-agentic-toolkit1,1502026年10月9日 更新

Analyze data using MATLAB. Use when the task involves tables, timetables, time-series data, numeric arrays, sensor matrices, or gridded data — including but not limited to exploring, row filtering, sorting, cleaning, transforming, aggregating, smoothing, padding, trimming, and answering questions about data. MATLAB provides extensive, easy-to-use built-in functions for these workflows with no additional products required.

日本語の概要は準備中です。原文の説明を表示しています。

matlab/matlab-agentic-toolkit1,1502026年10月9日 更新

S-parameters, insertion loss, fields, currents, mesh control, and solver selection for RF PCB performance validation. TRIGGER: user asks to compute S-parameters, analyze insertion/return loss, extract fields or currents, compare MoM vs FEM, or control mesh for any RF PCB component. Invoke BEFORE writing sparameters() or solver code — API is non-obvious. SKIP: designing or creating components (use the specific matlab-design-pcb-* skill), material/stackup setup only (use matlab-manage-pcb-material), optimization sweeps (use matlab-optimize-pcb-design), PDN/IR-drop analysis (use matlab-analyze-pcb-pdn).

日本語の概要は準備中です。原文の説明を表示しています。

matlab/matlab-agentic-toolkit1,1502026年10月9日 更新

matlab のスキルをすべて見る

このスキルの問題を報告する