Skip to content
cccskills
FreePublished on GitHub

matlab-signal-vision-ai

MATLAB workflow for signal processing, DSP, image processing, computer vision, lidar, medical imaging, deep learning, and AI-assisted reproducible experiments. Use for filters, spectrograms, wavelets, object detection, segmentation, classification, training, inference, and generated figures.

The English summary is being prepared. Showing the original description.

Run score Not tested

See how to install

Files included (6)

  • SKILL.md5.7 KB
  • scripts/mas_image_metrics.m4.5 KB
  • scripts/mas_ofdm_ber.m5.3 KB
  • scripts/mas_spectrum_check.m7.8 KB
  • scripts/mas_split_seed.m3.6 KB
  • tests/test_signal_vision.m15.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

MATLAB Signal Vision AI

Use this skill when the core artifact is a processed signal, image, video, point cloud, neural network, or AI experiment.

Workflow

  1. Identify data modality, sampling rate, image size, color space, labels, and expected outputs.
  2. Confirm toolbox availability before using specialized APIs.
  3. Build a tiny reproducible subset first.
  4. Save intermediate outputs so failures are inspectable.
  5. Validate with numerical metrics, visual artifacts, and data shape checks.

Preferred APIs

  • Signal: designfilt, filter, spectrogram, pwelch, findpeaks, wavelet functions.
  • Vision: imread, im2gray, imresize, imbinarize, regionprops, detectSURFFeatures, bboxOverlapRatio.
  • Deep learning: dlnetwork, trainnet, datastores, minibatchqueue, pretrained models when licensed.
  • Lidar/medical imaging: use domain importers and viewers when available; keep metadata.

Validation

Choose relevant checks:

  • Signal-to-noise ratio, peak frequency, filter stability.
  • Image dimensions, pixel range, mask area, IoU, accuracy, F1.
  • Training loss decreases on a smoke subset.
  • Inference output has expected class names, boxes, or mask shape.
  • Exported figure or video is nonempty.

Reproducibility

Record random seed, split policy, pretrained model version, GPU availability, and dataset hash or URL.

Tools

r = mas_spectrum_check(x, fs, struct('window','hann','nfft',[]));
r.leakage  r.cycles  r.concentration  r.parsevalErr  r.taperBias  r.warnings
o = mas_ofdm_ber([0 2 4 6]);   o.berSim  o.berTheory  o.relErr  o.verdict
m = mas_image_metrics(predMask, trueMask);
m.iou  m.dice  m.precision  m.recall  m.perObject  m.objectIouWorst
s = mas_split_seed(labels, struct('trainFrac',0.7,'seed',0,'stratify',true));
s.trainIdx  s.valIdx  s.noOverlap  s.noGap  s.reproducible  s.classBalance

A spectrum is only trustworthy after two checks

mas_spectrum_check runs both, because a spectrum can be wrong while looking completely normal:

  • Fractional cycles. A tone at exactly bin k puts 100 % of its energy in one bin; half a bin off it concentrates 0.408 (measured). The peak drops, the noise floor rises, and any THD or SNR read off it is wrong. Reported as leakage = low / HIGH / UNKNOWN from the measured fractional cycle count.
  • Power that does not add up. For a windowed periodogram the integral of the one-sided PSD is identically sum(x.^2.*w.^2)/sum(w.^2) — not mean(x.^2). The first version compared against mean(x.^2) with a 1e-6 threshold and failed every noisy record: 7.3e-3 (Hann), 6.7e-3 (Hamming), 9.0e-3 (Blackman), while the same signal with a rectangular window agreed to 5.3e-16. That spread is the taper re-weighting the noise realisation — estimator variance, not a scaling bug. Now parsevalErr is tested against the identity it is equal to (tolerance 1e-8, so it holds to machine precision), and the window's own effect is reported separately as taperBias, which is information about the taper rather than an error.

Concentration is measured on the un-padded rectangular DFT: zero padding makes a tone land between bins, and a Hann display window spreads energy over three bins by design. Neither is leakage in the record, but both corrupted the metric in v1.

OFDM: the reference is independent of the code

mas_ofdm_ber grades against the closed form 0.5*erfc(sqrt(Eb/N0)), which has nothing to do with the IFFT/FFT chain it is testing. The check is deliberately two-sided: a BER well below theory is not a success, it means the noise variance is too small. Tolerance is 15 % because at 6 dB over 2^18 bits the counted errors carry ~4 % relative sampling noise, and the defect the check exists to catch — applying the CP penalty at the receiver instead of at the transmitter — shifts BER by ~30 % (0.102 vs 0.0786 measured at 0 dB). The CP samples are discarded at the receiver, so the noise in them goes with them; the penalty is a transmit power penalty only.

Pixel metrics do not prove the objects are right

mas_image_metrics returns the confusion matrix, the aggregate metrics, and perObject: each predicted blob matched to the truth blob it overlaps most. Matching is by argmax over all truth labels, not by index — bwlabel numbers blobs in raster scan order, so Lp == k has no correspondence to Lt == k once the masks disagree, which is exactly when the number matters. The test asserts that a prediction with the correct total area in the wrong place scores IoU = 0, so the metric cannot degenerate into an area tally. 0/255 uint8 masks are converted with ~= 0; empty prediction against empty truth is IoU = 1, not NaN, so averaged scores survive. perObject is empty when Image Processing Toolbox is unavailable — degraded capability is reported, not hidden.

Splits: three cheap checks

mas_split_seed returns noOverlap, noGap and reproducible as asserted booleans (a row in both sets inflates validation accuracy; a rounding rule that leaves a class empty silently rebalances the problem), plus classBalance with the achieved per-class fraction, because per-class rounding can differ from the target by up to 0.5/n_c and that is a number to look at rather than a boolean to trust.

tests/test_signal_vision.m — cases are graded against a value that does not come from the code under test, with a negative control for every metric that could pass vacuously.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

MATLAB code generation and deployment workflow for MATLAB Coder, Simulink Coder, Embedded Coder, GPU Coder, HDL Coder, fixed-point conversion, MEX validation, and embedded deployment readiness. Use whenever the user asks to generate C/C++/CUDA/HDL/code, deploy algorithms, or validate generated code.

The English summary is being prepared. Showing the original description.

wzyn20051216/matlab-agent-skills26Updated Oct 21, 2026

MATLAB workflow for control systems, system identification, robust control, MPC, Simulink Control Design, parameter tuning, constrained optimization, and numerical validation. Use whenever the user asks for controllers, transfer functions, state-space models, tuning, identification, optimal control, or solver-based engineering.

The English summary is being prepared. Showing the original description.

wzyn20051216/matlab-agent-skills26Updated Oct 21, 2026

MATLAB data analysis workflow for tables, timetables, statistics, fitting, optimization-assisted analysis, visualization, report artifacts, and reproducible paper figures. Use whenever the user asks MATLAB to analyze data, plot results, fit models, process CSV/Excel/MAT files, or reproduce figures.

The English summary is being prepared. Showing the original description.

wzyn20051216/matlab-agent-skills26Updated Oct 21, 2026

MATLAB agentic workflow router. Use this whenever the user asks for MATLAB, Simulink, .m/.mlx/.slx work, toolbox-driven engineering, paper reproduction, simulation, code generation, data analysis, control, robotics, signal/image/AI workflows, or wants an end-to-end automated MATLAB task with validation. For Simulink tasks on this machine, default to a visible workflow: open MATLAB/Simulink windows first so the user can watch modeling, simulation, tuning, and plotting progress.

The English summary is being prepared. Showing the original description.

wzyn20051216/matlab-agent-skills26Updated Oct 21, 2026

MATLAB robotics and autonomy workflow for ROS Toolbox, Robotics System Toolbox, Navigation Toolbox, UAV Toolbox, sensor fusion, trajectory planning, simulation, and reproducible robot experiments. Use for ROS/ROS 2 bags, robot models, path planning, SLAM, state estimation, and autonomy prototyping.

The English summary is being prepared. Showing the original description.

wzyn20051216/matlab-agent-skills26Updated Oct 21, 2026

Run MATLAB tasks from Codex with reliable MCP-based execution, logs, artifacts, toolbox inventory, smoke tests, and reproducible validation. Use whenever MATLAB code, .m/.mlx scripts, MATLAB tests, local toolbox probing, or command-line automation is needed.

The English summary is being prepared. Showing the original description.

wzyn20051216/matlab-agent-skills26Updated Oct 21, 2026

See all skills by wzyn20051216

Report a problem with this skill