matlab-prepare-signal-data

Condition, label, split, and frame signal data for MATLAB analysis and ML training.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Preparing raw signal data for analysis or machine learning in MATLAB involves many error-prone steps: filling gaps, removing drift and outliers, denoising, resampling to a uniform rate, aligning channels, deriving labels, splitting datasets, and framing long signals. This Skill routes each task to the correct Signal Processing Toolbox function and workflow, preventing hallucinated function names and hand-rolled loops.

Core Features & Use Cases

  • Signal Conditioning: Fill NaN gaps with fillmissing or fillgaps, detrend polynomial drift, remove outliers with filloutliers or hampel, denoise with smoothdata or sgolayfilt, and resample or align channels with resample, retime, and synchronize.
  • ML Data Pipelines: Build signalDatastore pipelines, derive labels from filenames or folders with filenames2labels and folders2labels, create stratified train/val/test splits with splitlabels, and frame long signals with framesig and framelbl.
  • Structured Labeling: Create labeledSignalSet containers with attribute, ROI, point, and time-frequency ROI labels for Signal Labeler export and trainnet hand-off.
  • Use Case: Given a folder of sensor .mat files with class names encoded in subfolders, build a signalDatastore, derive labels with folders2labels, split stratified with splitlabels, and hand off combined datastores to trainnet.

Quick Start

Ask the agent to clean a noisy signal by removing outliers and drift, then load a folder of signal files into a labeled, split datastore ready for trainnet training.

Frequently Asked Questions about matlab-prepare-signal-data

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

FAQPage Schema
How do I fill missing samples in a MATLAB signal?

Use fillmissing with an interpolation method like "pchip" for short gaps, or fillgaps for long gaps in oscillatory signals where AR modeling preserves the spectrum. Set MaxGap on fillmissing to refuse fabricating data across wide dropouts.

How do I remove outliers and spikes from signal data in MATLAB?

Use filloutliers with the default median detector for sparse spikes, or hampel when you need the outlier mask and local statistics. For dense impulse noise above roughly 10 percent of samples, use medfilt1 instead since windowed detection breaks down.

What is the difference between fillmissing and fillgaps in MATLAB?

fillmissing interpolates from neighboring samples and suits short gaps, while fillgaps fits autoregressive models that continue oscillations through long gaps. fillgaps requires Signal Processing Toolbox and preserves the spectrum for downstream FFT analysis.

How do I create stratified train test splits for a signalDatastore?

Derive labels with filenames2labels or folders2labels, then call splitlabels with ratios like [0.7 0.15 0.15] and apply subset(ds, idx) per split. Check class counts first with countlabels to avoid infeasible split errors.

When should I use resample instead of retime in MATLAB?

Use resample whenever changing a signal's rate, especially downsampling, because it applies an anti-aliasing FIR filter. retime only interpolates or aggregates timetable rows without antialiasing, so it suits regularizing jitter or upsampling, not genuine rate reduction.

Can I use this skill for audio classification with Audio Toolbox?

No, raw .wav audio classification should use audioDatastore from Audio Toolbox as the canonical path. This skill's custom ReadFcn workflow handles .wav files only when Audio Toolbox is unavailable.