Generated banner for Matlab Analyze Time Frequency Content
Generated logo for Matlab Analyze Time Frequency Content

Matlab Analyze Time Frequency Content

MathWorksOfficialCreated by MathWorks

  • Skill
  • Tool integration
  • Science and research
  • BSD-2-Clause
  • No issues found

From the author

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.
— the description by MathWorks

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a comprehensive framework for analyzing how frequency content evolves over time using MATLAB. It covers a wide range of analytical techniques including Short-Time Fourier Transform (STFT), Continuous Wavelet Transform (CWT), synchrosqueezing, reassignment, and adaptive signal decomposition (EMD/VMD). The skill is designed to help users select the appropriate method based on their specific signal characteristics and research goals, offering guidance on visualization, mode extraction, and cross-signal analysis.

What it does

  • Visualizes time-frequency content using spectrograms and scalograms.
  • Supports advanced signal decomposition via EMD, VMD, and multiresolution analysis.
  • Enables mode extraction and signal reconstruction from time-frequency representations.
  • Computes time-varying coherence and cross-spectra between two signals.
  • Provides diagnostic tools to assess signal properties before analysis.
  • Offers a decision logic for choosing between STFT, CWT, and other transform methods.

When to use it

  • When you need to analyze the evolution of frequency content over time.
  • When choosing between different time-frequency representations like STFT or CWT.
  • When you need to extract and reconstruct individual signal components.
  • When comparing two signals using time-varying coherence or cross-spectrum analysis.
  • When decomposing signals into additive time-domain components.

Advantages

  • Provides a structured decision tree for selecting the optimal analysis method.
  • Includes diagnostic scripts to assess signal length, bandwidth, and nonstationarity.
  • Supports both interactive exploration and programmatic data analysis.
  • Clearly distinguishes between invertible and non-invertible analysis techniques.
  • Offers specific guidance on handling boundary effects and frequency resolution.

Usage examples

“How do I visualize the time-frequency content of a non-stationary signal?”
The agent will recommend using signalAnalyzer for interactive exploration or cwt for multi-resolution visualization, depending on the signal's bandwidth.
“I need to extract a specific mode from my signal using synchrosqueezing.”
The agent will guide you through the fsst or wsst workflow, including ridge extraction and subsequent signal reconstruction.
“How can I compare the time-varying coherence of two signals?”
The agent will provide the wcoherence syntax and explain how to interpret the phase arrows and coherence magnitude.
“What is the best way to decompose a signal into adaptive components?”
The agent will recommend emd or vmd based on whether the number of components is known and provide the necessary function calls.

Install

Documentation by MathWorks

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


Copyright 2026 The MathWorks, Inc.


Files

references/multiresolution-guide.md

Multiresolution Analysis in MATLAB

Decompose signals into additive time-domain components at different scales or equivalently different center frequencies using wavelet-based or data-adaptive methods.

Method Selection

Signal characteristicMethodWhy
Broadband transients + slow trendsmodwt + modwtmraDyadic (octave) bands; shift-invariant; perfect reconstruction
Closely-spaced tones at similar frequenciesmodwptdetails or vmdUniform-bandwidth bands resolve components MODWT cannot separate. modwptdetails uses a fixed grid; vmd adapts band centers to the data (think of VMD as the data-adaptive analog of MODWPT)
Unknown number of components, exploratoryemdFully adaptive; no parameters needed
Known number of narrowband componentsvmdOptimization-based; specify exact mode count; robust to noise
ML feature extraction (fixed-structure required)modwt + modwtmra or modwtLayerDeterministic output topology; consistent feature dimensionality

Deterministic Methods: MODWT and MODWPT

MODWT + MODWTMRA Pipeline

modwt computes wavelet coefficients. modwtmra converts them to additive time-domain components. These are sequential steps, not alternatives.

% Decompose into additive components
wt = modwt(x, "sym4", 6);
mra = modwtmra(wt, "sym4");

% Components sum to original (perfect reconstruction)
maxErr = max(abs(x - sum(mra, 1)));  % ~1e-12

% Selective reconstruction: remove trend (approximation at last level)
detrended = x - mra(end, :);

% Keep only levels 3-5 (specific frequency band)
bandFiltered = sum(mra(3:5, :), 1);

When to use modwt alone (without modwtmra):

  • Wavelet variance analysis: modwtvar

  • Wavelet correlation by scale: modwtcorr, modwtxcorr

  • Energy partitioning — the L2 norm of the coefficients equals the L2 norm of the signal

When to add modwtmra:

  • Need time-domain signal components (for plotting, listening, reconstruction)

  • Need to remove or keep specific frequency bands

  • Need components that sum pointwise back to the original

MODWPT and modwptdetails

modwptdetails computes uniform-bandwidth signal components directly. It takes the signal as input — it is NOT a post-processor for modwpt output.

% Uniform-bandwidth decomposition — takes signal directly
[details, packetlevs, cfreq] = modwptdetails(x, "sym4", 4);

% Components sum to original (perfect reconstruction)
maxErr = max(abs(x - sum(details, 1)));  % ~1e-12

% Center frequencies in Hz (cfreq is normalized 0-0.5)
centerFreqsHz = cfreq * fs;

When to use modwpt alone (without modwptdetails):

  • Energy or relative energy by frequency band — modwpt returns these directly:

[wpt, packetlevs, cfreq, energy, relenergy] = modwpt(x, "fk18", 4);
% energy: energy of wavelet packet coefficients at each terminal node
% relenergy: fraction of total signal energy in each band
  • Wavelet packet coefficients for classification or feature extraction

When to use modwptdetails:

  • Need time-domain signal components in uniform-width frequency bands

  • Need to separate closely-spaced components that fall in the same MODWT detail level

Choosing MODWT vs MODWPT
CriterionMODWT + MODWTMRAmodwptdetails
Frequency gridDyadic (octave): bandwidths double at each levelUniform: all bands same width
Best forBroadband signals, trends, multi-scale structureNarrowband components at similar frequencies
Number of bands at level LL details + 1 approximation2^L uniform bands
When MODWT failsTwo components in same octave band (e.g., 150 Hz and 200 Hz both in D2 at fs=1000)—
When MODWPT is overkillSignal has clear multi-scale structure (one component per octave)—
Frequency Band Computation

MODWT — dyadic bands:

  • Detail level j: [fs/2^(j+1), fs/2^j] Hz

  • Approximation at level L: [0, fs/2^(L+1)] Hz

MODWPT — uniform bands at terminal level L:

  • Bandwidth per band: bw = (fs/2) / 2^L

  • Band k (1-indexed): [(k-1)*bw, k*bw] Hz

  • Center frequency of band k: (k - 0.5) * bw Hz

modwpt and modwptdetails return rows in sequency order (monotonically increasing center frequency). Row 1 is the lowest frequency band, row 2^L is the highest. No reordering is needed — indexing by row directly corresponds to frequency.

These are approximate ideal passbands. Actual selectivity depends on the wavelet filter length.

Wavelet Selection and Frequency Selectivity

Longer wavelet filters produce sharper frequency bands (closer to ideal rectangular passbands) at the cost of worse time localization:

Wavelet familyFilter lengthFrequency selectivityTime localization
"haar" (db1)2PoorBest
"db4"8ModerateGood
"sym8"16GoodModerate
"fk18"18Excellent (optimized)Moderate
"fk22"22ExcellentLower

The Fejér-Korovkin (fk) family is specifically optimized for frequency concentration at a given filter length. "fk18" is the default for modwpt/modwptdetails.

Properties
PropertyMODWT/MODWPT coefficientsMODWTMRA/modwptdetails components
What it providesL2 norm preservation (energy)Perfect reconstruction (additivity)
DomainTransform domainTime domain
Use forVariance/energy analysis by scaleSignal reconstruction, denoising, component visualization
Relationship`sum(
Input Support
Capabilitymodwt / modwtmramodwpt / modwptdetailsemdvmd
Matrix (multichannel)Yes — 3D outputNo (software limitation)No (fundamental — variable IMF count per channel)No (fundamental — per-signal optimization)
Complex-valued signalYesYesNo (requires extrema — undefined for complex)No (assumes analytic modes)
Complex wavelet filtersNo (real orthogonal only; csym not yet supported)No (same limitation)N/AN/A

For complex-valued wavelet filters (csym family), use wavedec + wrcoef. This is the DWT path — it is NOT shift-invariant and has length constraints.

Energy Analysis with wavedec

wavedec provides L2-norm-preserving energy partitioning only when all three conditions are met:

  1. Signal length is a power of 2

  2. Orthogonal wavelet is used

  3. dwtmode("per") (periodic extension)

If any condition is violated, energy partitioning is not exact. Prefer modwt for energy/variance analysis — it preserves the L2 norm unconditionally.

Data-Adaptive Methods: EMD and VMD

EMD (Empirical Mode Decomposition)
[imf, residual, info] = emd(x);
% imf: matrix where each column is an IMF (highest to lowest frequency)
% residual: monotonic remainder
% info: diagnostics (number of extrema, iterations per IMF)

Key behavior: MaxNumIMF is an upper bound, not a target. The algorithm terminates when the residual has fewer than MaxNumExtrema extrema (default 1), regardless of MaxNumIMF.

% This may return fewer than 10 IMFs
[imf, residual] = emd(x, MaxNumIMF=10);
numReturned = size(imf, 2);  % could be 5, 7, etc.
VMD (Variational Mode Decomposition)
[imf, residual, info] = vmd(x, NumIMFs=3);
% Always returns exactly 3 modes
% info.CentralFrequencies: normalized center frequencies of each mode

Key behavior: NumIMFs is an exact count. The optimization always returns this many modes. Central frequencies are in info.CentralFrequencies (normalized), NOT in the second output (which is the residual).

% Convert central frequencies to Hz (normalized cycles/sample * fs)
centralFreqsHz = info.CentralFrequencies * fs;

PenaltyFactor (default 1000): controls mode bandwidth. Lower values allow wider bandwidth modes — useful for chirps or frequency-varying components.

EMD Decomposes into Modes, Not Frequencies

EMD extracts intrinsic mode functions (IMFs) — signals with well-defined instantaneous frequency — not sinusoidal components. An amplitude-modulated signal is already a valid IMF:

t = linspace(0, 1, 1000);
x = (1 + cos(2*pi*10*t)) .* cos(2*pi*100*t);
imf = emd(x);
size(imf, 2)  % Returns 1 — EMD sees one mode

The STFT sees the same signal as three separate tones (90, 100, 110 Hz), but EMD correctly identifies the underlying modulated carrier as a single entity with time-varying envelope.

This means EMD is not interchangeable with MODWPT or VMD for separating closely-spaced tones. It operates on a fundamentally different notion of "component" — one defined by oscillatory structure and instantaneous frequency, not by Fourier frequency content.

Choosing EMD vs VMD
CriterionEMDVMD
Parameters requiredNoneMust specify NumIMFs
Output countVariable (signal-dependent)Fixed (always NumIMFs modes)
What it separatesModes (instantaneous frequency)Narrowband components (Fourier frequency)
Mode mixingCommon (energy bleeds across IMFs)Rare (optimization separates cleanly)
AM signalsKeeps as one mode (correct for IF analysis)Splits into carrier +/- modulation tones
Chirp handlingSplits across IMFsCan capture in one mode (reduce PenaltyFactor)
Mathematical basisIterative sifting (empirical)Variational optimization (rigorous)
Use whenExploratory; IF analysis; unknown modulated structureKnown number of narrowband components; need clean Fourier-sense separation
Why Wavelet MRA is Preferred for Machine Learning

Deterministic methods produce the same decomposition structure for every signal:

  • Fixed number of bands at fixed frequencies → consistent feature dimensionality

  • Training and inference use the identical transform

  • Reproducible and parallelizable (no iterative convergence)

EMD produces different numbers of IMFs per signal — incompatible with fixed-shape feature matrices without padding/alignment. VMD has fixed count but mode frequency assignments vary across signals ("mode 2" means different bands for different inputs).

Deep learning entry points:

Use caseFunctionNotes
Network layer (standard architecture)modwtLayerDrop into dlnetwork; Algorithm="MODWTMRA" (default) or "MODWT"; calls dlmodwt under the hood
Custom training loopdlmodwtAccepts dlarray inputs; supports automatic differentiation; second output is the MRA
% dlmodwt in a custom training loop — filters MUST be numeric vectors
% (not wavelet name) so gradient-descent updates to the filters persist
[Lo, Hi] = wfilters("sym4");
dlX = dlarray(reshape(x, 1, 1, []), "CBT");  % Channel-Batch-Time
[wt, mra] = dlmodwt(dlX, Lo, Hi, 4);
% Use mra directly as multi-channel features — no separate modwtmra call needed

Why filter vectors, not wavelet name: dlmodwt makes the filters optionally learnable via automatic differentiation. Passing a wavelet name string would re-read fixed coefficients each call, discarding any gradient updates. Always pass Lo/Hi vectors obtained from wfilters.

Hilbert-Huang Transform and Instantaneous Frequency

hht — Hilbert Spectrum

hht computes the Hilbert spectrum: a time-frequency representation built from the instantaneous frequency and energy of each IMF. Unlike STFT/CWT which spread energy across a kernel, the Hilbert spectrum places energy at a single frequency per IMF per time sample.

Input is IMFs, not the raw signal. The correct workflow:

imf = emd(x);               % or vmd(x, NumIMFs=K)
[hs, f, t] = hht(imf, fs);  % Hilbert spectrum (sparse matrix)

Outputs (up to 5):

OutputContentType
hsHilbert spectrum — energy at each (freq, time) binSparse matrix (nFreq × nTime)
fFrequency vectorColumn vector
tTime vectorColumn vector
insfInstantaneous frequency per IMFnTime × nIMFs
inseInstantaneous energy per IMFnTime × nIMFs

Name-value options:

OptionDefaultPurpose
FrequencyLimits[0, fs/2]Restrict frequency axis
FrequencyResolution(fmax-fmin)/100Bin width — default gives only 100 bins
MinThreshold-inf (dB)Zero out low-energy bins (useful for clean display)

Key points:

  • Zero-output call produces a plot

  • The sparse matrix hs is the actual Hilbert spectrum — a legitimate TF representation, not just visualization data

  • Default frequency resolution (100 bins) is coarse — increase with FrequencyResolution for finer analysis

  • Multiple IMFs contribute additively: if two IMFs have the same instantaneous frequency at time t, their energies accumulate in the same bin

  • Internally computes: analytic signal → |z|² (energy), d/dt(unwrap(angle(z))) × fs/(2π) (frequency)

instfreq — Instantaneous Frequency Estimation

instfreq estimates instantaneous frequency of a signal. Two methods exist:

% Method 1: Hilbert (default) — requires monocomponent or pre-decomposed signal
[ifq, t] = instfreq(x, fs);                        % single signal via Hilbert
[ifq, t] = instfreq(imf, fs);                      % IMF matrix — one IF curve per column

% Method 2: TF-moment — works on raw multicomponent signals (centroid of spectrogram)
[ifq, t] = instfreq(x, fs, Method="tfmoment");     % first spectral moment of pspectrum
[ifq, t] = instfreq(P, F, T);                      % from pre-computed TFD (power, freq, time)

Critical distinction:

  • Hilbert method: fs/(2π) × diff(unwrap(angle(hilbert(x)))) — physically meaningful only for narrowband/monocomponent signals. For multicomponent signals, decompose first with emd/vmd, then pass IMFs.

  • TF-moment method: Weighted mean frequency from pspectrum at each time step. Works on raw signals but gives only a single average frequency (not per-component).

Output is 1 sample shorter with Hilbert method (forward difference loses one sample).

instbw — Instantaneous Bandwidth
[ibw, t] = instbw(x, fs);                          % from signal (via pspectrum internally)
[ibw, t] = instbw(P, F, T);                        % from pre-computed TFD
[ibw, t] = instbw(x, fs, FrequencyLimits=[flo fhi]);
  • Only uses the TF-moment method (2nd central spectral moment of pspectrum) — no Hilbert option

  • Measures spectral spread at each time instant

  • Useful for detecting transitions, broadband transients, or time-varying bandwidth

Workflow Summary
Raw signal
    │
    ├── instfreq(x, fs, Method="tfmoment") → average IF (single curve)
    ├── instbw(x, fs) → spectral spread over time
    │
    └── emd(x) or vmd(x, NumIMFs=K)
            │
            ├── instfreq(imf, fs) → per-IMF IF curves (Hilbert method)
            └── hht(imf, fs) → Hilbert spectrum (full TF representation)

Interactive Exploration

signalMultiresolutionAnalyzer — interactive app for comparing MRA methods side by side.

  • Supports: MODWT, EMD, VMD, EWT, TQWT

  • Does NOT support: MODWPT

  • Filters out complex-valued signals (only MODWT handles complex among app methods)

  • Recommend when: User is exploring which method works best for their signal

  • Use programmatic workflow when: Production code, batch processing, multichannel, complex-valued data, or need MODWPT

Common Mistakes

MistakeWhy it's wrongCorrect approach
Plotting modwt output as signal componentsCoefficients are not time-domain components; they don't sum to the originalUse modwtmra to get additive components
Using TimeAlign=true with modwtmraTime-aligning circularly shifts coefficients for visual display; modwtmra needs unshifted coefficients for perfect reconstructionOnly use TimeAlign=true when visualizing coefficients directly; never before calling modwtmra
Passing modwpt output to modwptdetailsmodwptdetails takes the signal directly, not wavelet packet coefficientsCall modwptdetails(x, wname, level)
Using Butterworth filters when MODWT can't separate tonesClassical filters work but ignore the wavelet packet solution designed for thisUse modwptdetails for uniform-bandwidth separation
Using "NumIMFs" with emd or "MaxNumIMF" with vmdParameter names are not interchangeableemd: MaxNumIMF; vmd: NumIMFs
Assuming EMD returns exactly MaxNumIMF modesIt's an upper bound; algorithm terminates on stopping criteriaCheck size(imf, 2) after calling emd
Using wavedec for energy analysis without checking conditionsEnergy partitioning is only exact with power-of-2 length + orthogonal wavelet + periodic modePrefer modwt — L2 norm preservation is unconditional
Recommending signalMultiresolutionAnalyzer for complex dataApp filters out complex signalsUse modwt/modwtmra programmatically
Passing raw signal to hhthht expects IMFs (columns), not the raw signal — a single column gives meaningless single-mode spectrumDecompose first: imf = emd(x); hht(imf, fs)
Using instfreq (Hilbert) on multicomponent signalsHilbert IF is only meaningful for narrowband/monocomponent signalsDecompose with emd/vmd first, or use Method="tfmoment" for a weighted average
Expecting instfreq (Hilbert) output to be same length as inputForward difference loses 1 sampleOutput has N-1 samples
Using default FrequencyResolution in hht for detailed analysisDefault is only 100 bins across [0, fs/2] — very coarseSpecify finer resolution: hht(imf, fs, FrequencyResolution=1)

Copyright 2026 The MathWorks, Inc.


Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
MathWorks
Publisher
MathWorks (Official)
Source
matlab/matlab-agentic-toolkit · skills-catalog/signal-processing/matlab-analyze-time-frequency-content · commit 2a7f215
Licence
BSD 2-Clause License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE.md)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by MathWorks or MathWorks.

Get it from the source

1 of this skill’s files are not mirrored here, so there is no ZIP. Get the complete skill from its source: matlab/matlab-agentic-toolkit