Matlab Extract Signal Features
MathWorksOfficialCreated by MathWorks
- Skill
- Tool integration
- Science and research
- BSD-2-Clause
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured approach to extracting per-frame features from 1D signals using the Signal Processing Toolbox. It guides users in selecting the appropriate extractor—time, frequency, or time-frequency—based on signal characteristics, configuring parameters, and handling output formats. The skill emphasizes a systematic workflow: performing preliminary analysis to determine signal stationarity, ranking candidate features across domains to improve downstream machine learning performance, and utilizing optional GPU acceleration for efficient processing. It includes patterns for common tasks like feature table generation, handling vector-valued features, and managing batch processing via datastores.
What it does
- Computes time-domain features like RMS, crest factor, and peak value.
- Extracts frequency-domain features including spectral location, power, and bandwidth.
- Calculates time-frequency features such as spectral shape, instantaneous frequency, and wavelet-based metrics.
- Supports GPU-accelerated feature extraction for compatible hardware.
- Generates structured feature tables suitable for training machine learning classifiers or regressors.
- Provides patterns for per-frame statistics and multi-domain feature concatenation.
When to use it
- When you need to prepare 1D signal data for machine learning or statistical analysis.
- When you require per-frame feature statistics from vibration, biosignal, radar, or sensor data.
- When you need to combine features from multiple domains (time, frequency, time-frequency) into a single feature table.
- When you want to optimize feature extraction performance using GPU acceleration.
Advantages
- Standardizes feature extraction workflows using official toolbox objects.
- Promotes better model performance by encouraging multi-domain feature selection.
- Provides clear guidance on handling complex output shapes like cell arrays and matrices.
- Includes robust patterns for GPU integration and parallel processing.
- Reduces errors by providing specific references for feature flags and parameter names.
Usage examples
- “Extract RMS and crest factor from a 1D signal x with sampling rate fs.”
- The agent configures a signalTimeFeatureExtractor with RMS and CrestFactor flags enabled, then runs the extract function to return a table of per-frame time-domain features.
- “Compute spectral features for a stationary signal for a classifier.”
- The agent uses signalFrequencyFeatureExtractor to calculate metrics like BandPower and OccupiedBandwidth, ensuring the output is formatted as a table for downstream model training.
- “How do I run feature extraction on a GPU?”
- The agent provides a code pattern using the canUseGPU guard and gpuArray to safely move the signal to the GPU before calling the extract function.
- “I need to combine time and frequency features into one table.”
- The agent explains how to configure both extractors with identical frame settings and provides the logic to concatenate the resulting tables while aligning the frame indices.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/matlab/matlab-extract-signal-features/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip matlab-extract-signal-features.zip -d .agents/skills
Documentation by MathWorks
Extract Signal Features
Per-frame feature extraction for 1D signals using the three Signal Processing Toolbox extractor objects. Picks the right extractor, configures it with real parameters only, and adds a GPU code path when one is available.
When to Use
The user has a 1D signal and wants per-frame features for analysis or ML.
The user names specific features from any of the three extractor domains (time, frequency, time-frequency).
The user asks for a feature table or feature matrix to feed
fitcecoc,fitcnet, or any classifier / regressor.The user asks for per-frame statistics over a windowed signal.
When NOT to Use
Filter design or signal preprocessing — out of scope. Filtering before feature extraction is a separate concern.
Audio-specific features (MFCC, mel-spectrogram, pitch, chroma, gammatone). Audio Toolbox's
audioFeatureExtractorcovers those — out of scope here.Batch / dataset orchestration —
signalDatastore,labeledSignalSet,tallarrays. The per-file extraction is in scope; building the pipeline around it is not.2D, image, or multivariate features — out of scope by signal-type boundary.
Workflow
(Recommended) Run a quick preliminary analysis. Check spectral stationarity — does the frequency content drift over time? — on a representative subset using Signal Processing Toolbox alone: a
pspectrum(x, fs, "spectrogram")look plus a per-frameMeanFrequencydrift ratio (no Econometrics Toolbox needed;adftest/kpsstestare an optional supplement only). Use the verdict to pick the primary extractor — non-stationary signals favoursignalTimeFrequencyFeatureExtractor; spectrally stationary signals lean on the frequency extractor. Seereferences/preliminary-analysis.md. Then write down a ranked candidate feature list, spanning more than one domain for a classifier/regressor feature table, with one-line justifications tying each feature to an observed signal characteristic, before configuring the extractors. The verdict picks the primary extractor, not the only one — a set that collapses onto a single extractor is the most common cause of a weak downstream classifier. Example: "MeanFrequency — stationary harmonic, energy localized at known frequencies." Seereferences/feature-ranking.md.Pick the extractor based on what the user wants. See "Choosing the right extractor" below.
Configure with
SampleRate,FrameSize, and eitherFrameRateorFrameOverlapLength(not both). Enable feature flags as name-value pairs.(Optional) Set per-feature or per-transform parameters via
setExtractorParametersfor features/transforms that have them. OnlysignalFrequencyFeatureExtractorandsignalTimeFrequencyFeatureExtractorsupport this method. The second argument can be a feature name OR a transform name. Before writing anysetExtractorParameterscall, open the matching reference file and copy the parameter name verbatim. Parameter names are not what you'd guess. The references are the source of truth.(Optional) Move to GPU using the guard pattern in
references/gpu-patterns.md.Run
extract(sFE, x)on the signal. Output shape depends onFeatureFormat(matrix or table).srcmay also be asignalDatastore/audioDatastore, in which caseextractreturns one result per file (a cell array) and acceptsUseParallel=trueto process files on a parallel pool — use it whenever extracting over many files. For the input contract, the per-extractor output shape, datastore/parallel extraction, and how to combine outputs across extractors, seereferences/extract-function.md.Decide output shape. Do NOT aggregate per-frame results by default. The per-frame table is a valid final output. Aggregate (mean/std across frames) only if the user's downstream model requires one fixed-length vector per signal (e.g.,
fitcecoc,fitcsvm, tree ensembles). If the model consumes sequences (LSTM, 1-D CNN, transformer), keep the per-frame table as-is. If the user has variable-length signals and the downstream task is unclear, ask rather than assuming aggregation. Seereferences/post-extraction-patterns.md.
Stop and check the matching per-extractor reference before:
Enabling any feature on
signalTimeFrequencyFeatureExtractor— eachTransformsupports a different subset.Calling
setExtractorParameters— parameter names differ per feature and per transform.Using any feature flag, parameter, or
Transformvalue not already shown in this file's patterns. If it isn't in the per-extractor reference, it doesn't exist on the object.
Choosing the right extractor
| User wants | Use |
|---|---|
| Time-domain features (amplitude, energy, shape factors) | signalTimeFeatureExtractor |
| Frequency-domain features (spectral location, power, bandwidth, PSD) | signalFrequencyFeatureExtractor |
| Time-frequency features (spectral shape, instantaneous, ridges, wavelet, EMD-derived) | signalTimeFrequencyFeatureExtractor |
| Multiple of the above | Use multiple extractors; concatenate the resulting tables |
For the time-frequency extractor, the Transform property gates which features are valid. See the compatibility matrix in references/signal-time-frequency-feature-extractor.md.
Key Functions
| Function | Purpose | Toolbox | Available From |
|---|---|---|---|
signalTimeFeatureExtractor | Time-domain feature extractor object | Signal Processing Toolbox | R2021a |
signalFrequencyFeatureExtractor | Frequency-domain feature extractor object | Signal Processing Toolbox | R2021b |
signalTimeFrequencyFeatureExtractor | Time-frequency feature extractor object | Signal Processing Toolbox | R2024a |
extract | Run a configured extractor on a signal | Signal Processing Toolbox | R2021a |
getExtractorParameters / setExtractorParameters | Read/write per-feature or per-transform parameters (frequency and time-frequency only) | Signal Processing Toolbox | R2021b |
timeFrequencyFeatureTransformOptions | Create transform options object for signalTimeFrequencyFeatureExtractor (replaces string Transform=) | Signal Processing Toolbox | R2026a |
generateMATLABFunction | Emit a codegen-compatible MATLAB function from an extractor | Signal Processing Toolbox | R2021a |
canUseGPU, gather | GPU availability check and data transfer (core MATLAB, no toolbox) | MATLAB | R2020b |
gpuArray | Move array to GPU memory | Parallel Computing Toolbox | R2012a |
gpuArray input to extract is available per extractor from: signalTimeFeatureExtractor R2023a, signalFrequencyFeatureExtractor R2023a, signalTimeFrequencyFeatureExtractor R2024b (one release after the object itself). Requires Parallel Computing Toolbox. See references/gpu-patterns.md for per-transform limitations.
generateMATLABFunction exists for codegen workflows. Mention it when relevant; full codegen guidance is out of scope for this skill.
Patterns
Time-domain features per frame
function featureTable = extractTimeFeaturesExample(x, fs)
%extractTimeFeaturesExample Per-frame time-domain features as a table.
arguments
x (:, 1) double {mustBeFinite}
fs (1, 1) double {mustBePositive}
end
sFE = signalTimeFeatureExtractor( ...
SampleRate=fs, ...
FrameSize=round(0.1 * fs), ...
FrameOverlapLength=round(0.05 * fs), ...
RMS=true, ...
CrestFactor=true, ...
PeakValue=true, ...
FeatureFormat="table");
featureTable = extract(sFE, x);
endFor valid time-feature flags, see references/signal-time-feature-extractor.md.
Frequency-domain features with per-feature parameters
function featureTable = extractBandPowerExample(x, fs)
%extractBandPowerExample Band power and occupied bandwidth per frame.
arguments
x (:, 1) double {mustBeFinite}
fs (1, 1) double {mustBePositive}
end
sFE = signalFrequencyFeatureExtractor( ...
SampleRate=fs, ...
FrameSize=round(0.1 * fs), ...
FrameOverlapLength=round(0.05 * fs), ...
BandPower=true, ...
OccupiedBandwidth=true, ...
FeatureFormat="table");
setExtractorParameters(sFE, "OccupiedBandwidth", Percentage=95);
featureTable = extract(sFE, x);
endFor per-feature parameter tables (including the trap that PowerBandwidth takes RelativeAmplitude not Power), see references/signal-frequency-feature-extractor.md.
Time-frequency features (spectrogram transform)
function featureTable = extractTFFeaturesExample(x, fs)
%extractTFFeaturesExample Spectral entropy and instantaneous frequency per frame.
arguments
x (:, 1) double {mustBeFinite}
fs (1, 1) double {mustBePositive}
end
% R2026a+ (preferred): use timeFrequencyFeatureTransformOptions.
% Constructor is name-value only, keyed by FEATURE name -> transform.
% There is no positional-string form: timeFrequencyFeatureTransformOptions("spectrogram") errors.
tfOpts = timeFrequencyFeatureTransformOptions( ...
SpectralEntropy="spectrogram", ...
InstantaneousFrequency="spectrogram");
sFE = signalTimeFrequencyFeatureExtractor( ...
Transform=tfOpts, ...
SampleRate=fs, ...
FrameSize=256, ...
FrameOverlapLength=128, ...
SpectralEntropy=true, ...
InstantaneousFrequency=true, ...
FeatureFormat="table");
% R2024a–R2025b: use string directly (deprecated from R2026a)
% sFE = signalTimeFrequencyFeatureExtractor( ...
% Transform="spectrogram", ...
% SampleRate=fs, ...
% FrameSize=256, ...
% FrameOverlapLength=128, ...
% SpectralEntropy=true, ...
% InstantaneousFrequency=true, ...
% FeatureFormat="table");
setExtractorParameters(sFE, "spectrogram", Leakage=0.9, OverlapPercent=85);
featureTable = extract(sFE, x);
endEach Transform supports a different subset of features, and per-feature parameters depend on (transform, feature). Always check references/signal-time-frequency-feature-extractor.md before enabling a feature or calling setExtractorParameters.
Multi-transform routing (R2026a+): A single extractor can route different features to different transforms — you do NOT need separate extractors. Use timeFrequencyFeatureTransformOptions with per-feature properties (e.g., SpectralKurtosis="synchrosqueezedspectrogram", SpectralEntropy="spectrogram"). See the full example and valid-transform table in references/signal-time-frequency-feature-extractor.md.
GPU-accelerated extraction
Toolbox note: The GPU path (
gpuArray) and theUseParallel=truedatastore path both require Parallel Computing Toolbox. It is not required for core feature extraction — the skill runs fully on CPU without it, because thecanUseGPU()guard skips the GPU branch andUseParalleldefaults tofalse. Enable these paths only when Parallel Computing Toolbox is installed.
function featureTable = extractWithGPU(x, fs)
%extractWithGPU Run feature extraction on GPU when available, CPU otherwise.
arguments
x (:, 1) double {mustBeFinite}
fs (1, 1) double {mustBePositive}
end
sFE = signalTimeFeatureExtractor( ...
SampleRate=fs, ...
FrameSize=round(0.1 * fs), ...
FrameOverlapLength=round(0.05 * fs), ...
RMS=true, ...
StandardDeviation=true, ...
FeatureFormat="table");
if canUseGPU()
x = gpuArray(x);
end
featureTable = extract(sFE, x);
endThe feature table may contain gpuArray columns. Downstream code (ML training, plotting) often accepts these directly. Call gather only when a specific consumer requires it (e.g., save to .mat, writetable to CSV).
See references/gpu-patterns.md for the rationale behind the canUseGPU guard and why unconditional gpuArray calls are wrong. If the GPU path unexpectedly falls back to CPU or gpuArray errors, the matlab-setup-gpu skill diagnoses GPU availability problems (unlicensed PCT, outdated driver, compute mode).
Post-extraction: aggregation and reproducibility
Do not aggregate unless the user's workflow explicitly requires one feature vector per signal. The per-frame table is the default output. Two optional patterns that run after extract:
Per-frame → per-signal aggregation — only when the downstream model requires a fixed-length vector per example (tree ensembles, SVM, etc.). Collapse with
varfun(@mean, ...)/varfun(@std, ...), droppingFrameStartTime/FrameEndTimefirst. Skip aggregation for sequence models (LSTM, 1-D CNN) that consume the frame sequence directly. For scalar summaries of vector-valued features, usesetScalarizationMethodsat extraction time instead.Save extractor + data card —
save("featureConfig.mat", "sFE", "dataCard")wheredataCardrecordsSampleRate,FrameSize,FrameOverlapLength,class(sFE), andversion("-release"). Minimum sidecar to reproduce the extraction on new data.
See references/post-extraction-patterns.md for the worked code blocks and edge cases (vector-valued columns, label-column handling, alternative scalarization route).
Conventions (apply to all three extractors)
Always set
SampleRate. Frequency-derived features interpret the signal asfs = 1ifSampleRateis omitted.Pick
FrameRateorFrameOverlapLength, not both. They control the same thing two different ways. Setting both raises an error.FrameOverlapLengthmust be< FrameSize.Set
FrameSizeandFrameOverlapLengthin samples, not seconds. Convert:FrameSize = round(durationSeconds * fs).Prefer
FeatureFormat="table"when the extractor produces a mix of scalar and vector features.FrameStartTime/FrameEndTimeare 1-indexed sample positions, not seconds. Convert:tSec = (T.FrameStartTime - 1) / fs. Strip them before training a classifier.Vector-valued feature columns are numeric matrices when per-frame length is fixed, cells when it varies. Check with
iscell(T.(colName))before indexing.Don't guess feature names or parameters. Read the relevant per-extractor reference. Anything not in the reference does not exist on the object.
Common cross-cutting pitfalls
| What you tried | Fix |
|---|---|
| Hand-rolled per-frame statistics over a windowed signal (e.g. RMS / crest factor loop on a buffered signal) | Use the extractor object — composes with extract, has a codegen path. |
FrameLength=N instead of FrameSize=N | Property is FrameSize on all three extractors. |
Set both FrameRate and FrameOverlapLength | Pick one. |
gpuArray(x) without canUseGPU() guard | Hard-errors on CPU-only machines. Wrap in if canUseGPU(); x = gpuArray(x); end. |
For extractor-specific pitfalls (e.g., Skewness=true on the time extractor, MeanEnvelopeEnergy on a non-EMD transform, the PowerBandwidth parameter being RelativeAmplitude rather than guessed from the feature name), see the per-extractor references.
References
references/preliminary-analysis.md— Signal-Processing-only spectral-stationarity check (pspectrumspectrogram + per-frameMeanFrequencydrift ratio), the optional Econometricsadftest/kpsstestsupplement, and the verdict→extractor decision rules. Read before picking an extractor when the signal character is unclear.references/feature-ranking.md— a-priori candidate-feature list pattern and the signal-profile→feature mapping. Read when the user asks for a starting feature set or wants a ranked list.references/extract-function.md—extractinput/output contract, per-extractor output character, multi-extractor row alignment, and common error modes. Read when debugging shape or alignment issues.references/signal-time-feature-extractor.md— full property and feature-flag surface for the time extractor. Read when verifying a time-feature name or property.references/signal-frequency-feature-extractor.md— full property surface plus per-feature parameter tables (OccupiedBandwidth,PowerBandwidth,WelchPSD, peak parameters). Read when configuring frequency features.references/signal-time-frequency-feature-extractor.md— Transform×feature compatibility matrix and per-transform parameter tables. Read this before enabling any feature on the time-frequency extractor.references/scalarization-options.md— the three*ScalarFeatureOptionsobjects and thesetScalarizationMethodsAPI. Read when adding scalar summary columns to vector-valued features.references/gpu-patterns.md—canUseGPUguard pattern and rationale. Read when the user mentions GPU.
Copyright 2026 The MathWorks, Inc.
Files
- ATTRIBUTION.mdAdded by AutoGineer1.1 KiB
- LICENSELicence file added by AutoGineer1.4 KiB
- SKILL.md18.0 KiB
- manifest.yaml482 B
- references/extract-function.md6.9 KiB
- references/feature-ranking.md5.7 KiB
- references/gpu-patterns.md6.5 KiB
- references/post-extraction-patterns.md4.3 KiB
- references/preliminary-analysis.md7.1 KiB
- references/scalarization-options.md5.8 KiB
- references/signal-frequency-feature-extractor.md6.7 KiB
- references/signal-time-feature-extractor.md5.0 KiB
- references/signal-time-frequency-feature-extractor.md14.1 KiB
references/signal-time-frequency-feature-extractor.md
signalTimeFrequencyFeatureExtractor reference
Time-frequency feature extraction for 1D signals. Available since R2024a.
This extractor differs from the others in two important ways:
Feature availability depends on
Transform. Each transform supports a specific subset of the 13 feature flags. Enabling an unsupported feature for the chosen transform raises an error at construction.FrameSizeis not allowed foremd/vmdtransforms. For those transforms, leaveFrameSizeandFrameOverlapLengthunset (the entire signal is processed as one).
Construction
sFE = signalTimeFrequencyFeatureExtractor(Name=Value, ...);Frame and output properties
| Property | Type | Default | Notes |
|---|---|---|---|
Transform | string or timeFrequencyFeatureTransformOptions (R2026a+) | "spectrogram" | One of "spectrogram", "synchrosqueezedspectrogram", "scalogram", "synchrosqueezedscalogram", "wavelet", "waveletpacket", "emd", "vmd". R2026a+: prefer a timeFrequencyFeatureTransformOptions object built with name-value pairs keyed by feature (e.g. timeFrequencyFeatureTransformOptions(SpectralEntropy="spectrogram")) — there is no positional-string form. Passing Transform="spectrogram" as a string still works but emits a deprecation warning. Drives which features are valid. |
FrameSize | positive integer | not set | Required for non-EMD/VMD transforms. Must be unset for emd / vmd. |
FrameRate | positive integer | not set | Mutually exclusive with FrameOverlapLength. |
FrameOverlapLength | positive integer | not set | Must be < FrameSize. Cannot be set when Transform is emd or vmd. |
SampleRate | positive scalar | [] | Set this. |
IncompleteFrameRule | "drop" | "zeropad" | "drop" | Last-frame handling. |
FeatureFormat | "matrix" | "table" | "matrix" | Output shape. |
ScalarizationMethod | timeFrequencyScalarFeatureOptions | not set | Methods to scalarize per-frame feature vectors. See scalarization-options.md. |
Feature × Transform compatibility matrix
Y = supported, N = unsupported (signal:featurextractor:timefrequency:SpectrogramFeaturesForInvalidTransform or similar at construction).
| Feature | spectrogram | synchrosqueezed-spectrogram | wavelet | waveletpacket | scalogram | synchrosqueezed-scalogram | emd | vmd |
|---|---|---|---|---|---|---|---|---|
SpectralKurtosis | Y | Y | N | N | N | Y | N | N |
SpectralSkewness | Y | Y | N | N | N | Y | N | N |
SpectralCrest | Y | Y | N | N | N | Y | N | N |
SpectralFlatness | Y | Y | N | N | N | Y | N | N |
SpectralEntropy | Y | Y | N | N | N | Y | N | N |
TFRidges | Y | Y | N | N | N | Y | N | N |
InstantaneousBandwidth | Y | Y | N | N | N | Y | N | N |
InstantaneousFrequency | Y | Y | Y | Y | N | Y | Y | Y |
InstantaneousEnergy | N | N | Y | Y | N | N | Y | Y |
MeanEnvelopeEnergy | N | N | N | N | N | N | Y | N |
WaveletEntropy | N | N | Y | Y | N | N | N | N |
TimeSpectrum | N | N | N | N | Y | N | N | N |
ScaleSpectrum | N | N | N | N | Y | N | N | N |
When a feature is unsupported for the chosen transform, MATLAB lists the valid set in the error message. Read that list — it's authoritative.
Per-feature parameters
Per-feature parameters depend on both the feature flag and the active transform. The tables below list parameters per (transform, feature) pair as captured from getExtractorParameters. Empty [] defaults mean "use the function's internal default" (typically the same default the underlying function would use without the extractor).
spectrogram and synchrosqueezedspectrogram
| Feature | Parameters |
|---|---|
SpectralKurtosis, SpectralSkewness, SpectralCrest, SpectralFlatness | none |
SpectralEntropy | Range |
TFRidges | NumRidges, NumFrequencyBins, Penalty |
InstantaneousBandwidth | FrequencyLimits, ScaleFactor |
InstantaneousFrequency | FrequencyLimits |
wavelet and waveletpacket
| Feature | Parameters |
|---|---|
InstantaneousFrequency | FrequencyLimits, FrequencyResolution, MinThreshold |
InstantaneousEnergy | FrequencyLimits, FrequencyResolution, MinThreshold |
WaveletEntropy | Entropy, Exponent, Distribution, Scaled |
scalogram
| Feature | Parameters |
|---|---|
TimeSpectrum | Normalization, SpectrumType, TimeLimits |
ScaleSpectrum | Normalization, SpectrumType, FrequencyLimits |
synchrosqueezedscalogram
Same as synchrosqueezedspectrogram plus InstantaneousBandwidth (FrequencyLimits, ScaleFactor).
emd and vmd
| Feature | Parameters |
|---|---|
InstantaneousFrequency | FrequencyLimits, FrequencyResolution, MinThreshold |
InstantaneousEnergy | FrequencyLimits, FrequencyResolution, MinThreshold |
MeanEnvelopeEnergy (emd only) | none |
Per-transform parameters
Set via setExtractorParameters(sFE, "TransformName", Param=Value, ...). These control the underlying transform computation, not individual features. The second argument is the transform name (e.g., "spectrogram"), not a feature name.
spectrogram
| Parameter | Type | Default | Notes |
|---|---|---|---|
Leakage | scalar in [0, 1] | [] | Window leakage factor. |
OverlapPercent | scalar in [0, 100) | [] | Overlap percentage for the internal spectrogram. |
TimeResolution | positive scalar | [] | Time resolution in seconds. |
synchrosqueezedspectrogram
| Parameter | Type | Default | Notes |
|---|---|---|---|
Window | vector | [] | Window applied to each segment. |
wavelet
| Parameter | Type | Default | Notes |
|---|---|---|---|
Wname | string | [] | Wavelet name. |
LowPass | vector | [] | Lowpass filter coefficients. |
HighPass | vector | [] | Highpass filter coefficients. |
Level | positive integer | [] | Decomposition level. |
Reflection | logical | [] | Signal extension mode. |
waveletpacket
| Parameter | Type | Default | Notes |
|---|---|---|---|
Wname | string | [] | Wavelet name. |
LowPass | vector | [] | Lowpass filter coefficients. |
HighPass | vector | [] | Highpass filter coefficients. |
Level | positive integer | [] | Decomposition level. |
FullTree | logical | [] | Use full decomposition tree. |
scalogram and synchrosqueezedscalogram
| Parameter | Type | Default | Notes |
|---|---|---|---|
Wavelet | string | [] | Wavelet name. |
VoicesPerOctave | positive integer | [] | Frequency resolution of the CWT. |
WaveletParameters | vector | [] | Additional wavelet parameters. |
FrequencyLimits | 2-element vector | [] | [fLow fHigh] in Hz. |
emd
| Parameter | Type | Default | Notes |
|---|---|---|---|
MaxNumIMF | positive integer | [] | Maximum number of intrinsic mode functions. |
MaxNumExtrema | positive integer | [] | Stopping criterion: max extrema count. |
MaxEnergyRatio | positive scalar | [] | Stopping criterion: energy ratio. |
Interpolation | string | [] | Interpolation method for envelope. |
vmd
| Parameter | Type | Default | Notes |
|---|---|---|---|
NumIMFs | positive integer | [] | Number of modes to decompose. |
CentralFrequencies | vector | [] | Initial central frequencies. |
PenaltyFactor | positive scalar | [] | Balances data fidelity vs. bandwidth. |
InitializeMethod | string | [] | Initialization method for VMD. |
Methods
| Method | Signature | Purpose |
|---|---|---|
extract | features = extract(sFE, x) | Run the configured extractor on signal x. |
getExtractorParameters | params = getExtractorParameters(sFE, "FeatureName") | Read current per-feature parameters. |
setExtractorParameters | setExtractorParameters(sFE, "FeatureName"|"TransformName", Param=Value, ...) | Set per-feature or per-transform parameters. See "Per-feature parameters" and "Per-transform parameters" sections above. |
getScalarizationMethods | m = getScalarizationMethods(sFE, "FeatureName") | Read current scalarization (returns a string array). |
setScalarizationMethods | setScalarizationMethods(sFE, "FeatureName", Mean=true, StandardDeviation=true, ...) | Add scalar summary columns alongside the vector column for a feature. |
generateMATLABFunction | generateMATLABFunction(sFE) | Emit a codegen-compatible function. |
Scalarization
All vector-valued features on this extractor accept scalarization. The exact set depends on the active Transform (e.g., on Transform="spectrogram", SpectralKurtosis / SpectralSkewness / SpectralCrest / SpectralFlatness / SpectralEntropy are vector-valued and scalarizable). For the API, valid method names, the WaveletEntropy / SpectralEntropy Entropy exception, and output behavior, see scalarization-options.md.
Memory budget. Vector-valued features grow output linearly with frames × per-frame resolution. InstantaneousFrequency, InstantaneousEnergy, WaveletEntropy, TFRidges, TimeSpectrum, and ScaleSpectrum return a vector per frame — and on the wavelet/waveletpacket transforms, InstantaneousFrequency is per-sample-resolution, which can take a feature table to gigabytes for long signals or many recordings. Rough check before extracting: numRecordings * numFrames * frameOutputLength * 8 bytes per vector column. If that exceeds a few hundred MB and you only need summary statistics for a classifier, either (a) call setScalarizationMethods and drop the vector with removevars post-extract, or (b) drop the vector column post-extract directly.
extract output shape
Same conventions as the other extractors. Most time-frequency features are scalars per frame; TFRidges, TimeSpectrum, ScaleSpectrum, and the spectral-shape features on Transform="spectrogram" (SpectralKurtosis, SpectralSkewness, SpectralCrest, SpectralFlatness, SpectralEntropy) are vector-valued (one value per frequency bin). On R2026a, output column names are <FeatureName><TransformName> (e.g., SpectralKurtosisSpectrogram). Inspect T.Properties.VariableNames after extract if uncertain.
With FeatureFormat="table" the table starts with FrameStartTime and FrameEndTime (1-indexed sample positions, not seconds — convert: tSec = (T.FrameStartTime - 1) / fs), then one column per feature. Vector-valued columns are stored as numeric matrices when per-frame length is fixed; as cell arrays when it varies. Use iscell(T.(colName)) before indexing. Strip the time columns before training a classifier. Use FeatureFormat="table" when mixing scalar and vector features.
R2026a+: timeFrequencyFeatureTransformOptions
On R2026a+, prefer Transform=timeFrequencyFeatureTransformOptions(...) over the string form Transform="spectrogram". The string form still works but emits a deprecation warning.
Single-transform usage
tfOpts = timeFrequencyFeatureTransformOptions(SpectralEntropy="spectrogram");
sFE = signalTimeFrequencyFeatureExtractor(Transform=tfOpts, ...);Multi-transform routing (one extractor, different transforms per feature)
A single extractor can route different features to different transforms. You do NOT need separate extractors. Each property on the options object specifies which transform to use for that feature:
tfOpts = timeFrequencyFeatureTransformOptions( ...
SpectralKurtosis="synchrosqueezedspectrogram", ...
SpectralEntropy="spectrogram");
sFE = signalTimeFrequencyFeatureExtractor( ...
Transform=tfOpts, ...
SampleRate=fs, ...
FrameSize=256, ...
FrameOverlapLength=128, ...
SpectralKurtosis=true, ...
SpectralEntropy=true, ...
FeatureFormat="table");
featureTable = extract(sFE, x);Per-feature transform options
| Property | Valid transforms | Default |
|---|---|---|
SpectralKurtosis, SpectralSkewness, SpectralCrest, SpectralFlatness, SpectralEntropy, TFRidges, InstantaneousBandwidth | "spectrogram", "synchrosqueezedspectrogram", "synchrosqueezedscalogram" | "spectrogram" |
InstantaneousFrequency | all of the above + "emd", "vmd", "wavelet", "waveletpacket" | "spectrogram" |
InstantaneousEnergy | "emd", "vmd", "wavelet", "waveletpacket" | "emd" |
MeanEnvelopeEnergy | "emd" | "emd" |
WaveletEntropy | "wavelet", "waveletpacket" | "wavelet" |
TimeSpectrum, ScaleSpectrum | "scalogram" | "scalogram" |
Important notes
The options object routes features to transforms but does NOT carry transform-level parameters — those are still set via
setExtractorParameters(sFE, "spectrogram", Leakage=..., OverlapPercent=...).Only set properties for features you actually enable on the extractor. Unset properties use their defaults.
The compatibility matrix above still applies — a feature must be valid for the transform you route it to.
Common solutions
| What you tried | Fix |
|---|---|
Transform="STFT" | Not a valid value. Use Transform="spectrogram" for STFT-style analysis. Valid set: spectrogram, synchrosqueezedspectrogram, wavelet, waveletpacket, scalogram, synchrosqueezedscalogram, emd, vmd. |
MeanEnvelopeEnergy=true on Transform="spectrogram" (or any non-EMD) | MeanEnvelopeEnergy is EMD-only. Either drop the feature or switch to Transform="emd" (and unset FrameSize/FrameOverlapLength). |
FrameSize set with Transform="emd" or "vmd" | EMD/VMD process the entire signal — leave FrameSize and FrameOverlapLength unset. |
Feature enabled that isn't valid for the chosen Transform | Read the error message — MATLAB lists the valid set. Cross-check with the compatibility matrix above. |
setExtractorParameters with an unknown param name | Per-feature parameters depend on (transform, feature). Check the per-feature parameter table above for the active transform. |
setExtractorParameters raised NoParameterFeature | The (transform, feature) pair has no parameters. Check the per-feature parameter tables above. |
getScalarMethods(sFE, "FeatureName") | That's an internal method that takes no arguments. Use getScalarizationMethods(sFE, "FeatureName"). |
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-extract-signal-features · 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.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download matlab-extract-signal-features.zip