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

matlab-design-digital-filter

Design and validate digital filters in MATLAB. Use when cleaning up noisy signals, removing interference, filtering signals, designing FIR/IIR filters (lowpass/highpass/bandpass/bandstop/notch), or comparing filters in Filter Analyzer.

インストール方法を見る

含まれるファイル(16)

  • SKILL.md6.1 KB
  • manifest.yaml473 B
  • references/best-practices.md7.8 KB
  • references/efficient-filtering.md14.4 KB
  • references/filter-analyzer.md18.1 KB
  • references/INDEX.md2.9 KB
  • references/multirate.md13.2 KB
  • references/multistage-ifir.md8.5 KB
  • references/patterns.md16.2 KB
  • references/quick-ref/designfilt.md6.0 KB
  • references/quick-ref/efficient-filtering.md6.1 KB
  • references/quick-ref/filter-analyzer.md3.0 KB
  • references/quick-ref/general-iir-fir.md3.0 KB
  • references/quick-ref/multirate-offline.md2.3 KB
  • references/quick-ref/multirate-streaming.md3.6 KB
  • references/quick-ref/multistage-ifir.md2.8 KB

SKILL.md(原文)

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

Design Digital Filters in MATLAB

Design, implement, and validate digital filters using Signal Processing Toolbox and DSP System Toolbox. Choose the right architecture (single-stage vs efficient alternatives), generate correct code, and verify the result with plots and numbers.

When to Use

  • Designing lowpass, highpass, bandpass, bandstop, or notch filters
  • Cleaning up noisy signals or removing interference
  • Choosing between FIR and IIR filter architectures
  • Comparing filter designs in Filter Analyzer
  • Building streaming (real-time) or offline (batch) filtering pipelines
  • Handling narrow transition bands with multirate or IFIR approaches

When NOT to Use

  • Adaptive filtering (LMS, RLS) -- use Signal Processing Toolbox docs directly
  • Audio-specific processing (equalization, room correction) -- use Audio Toolbox
  • Image filtering (2D convolution, morphological ops) -- use Image Processing Toolbox
  • General spectral analysis without filtering intent -- FFT/periodogram docs suffice

Key Rules

  • Read references/INDEX.md before writing any filter design code.
  • Always write to .m files. Never put multi-line MATLAB code directly in evaluate_matlab_code. Write to a .m file, run with run_matlab_file, edit on error.
  • Preflight before ANY MATLAB call. Before calling any function listed in INDEX.md, read the required quick-ref first. State Preflight: [files] at the top of the response.
  • Do not guess key requirements. If Mode (streaming vs offline) or Phase requirement is not stated, ask.
  • No Hz designs without Fs. If Fs is unknown, stop and ask (unless the user explicitly wants normalized frequency).
  • Always pin the sample rate. Use designfilt(..., SampleRate=Fs) and freqz(d, [], Fs).
  • IIR stability: Prefer SOS/CTF forms (avoid high-order [b,a] polynomials).

Preflight Procedure

  1. List MATLAB functions to call
  2. Check references/INDEX.md for each (function-level + task-level tables)
  3. Read required quick-ref files
  4. State at response top: Preflight: quick-ref/filter-analyzer.md, quick-ref/designfilt.md (or Preflight: none required)

Workflow

Phase 1: Signal Analysis

  • Analyze input data via MCP (spectrum, signal length, interference location)
  • Compute trans_pct and identify interference characteristics

Phase 2: Clarify Intent

After signal analysis, ask Mode + Phase if not stated:

  • Mode: streaming (causal) | offline (batch)
  • Phase: zero-phase | linear-phase | don't-care

Wait for answer before showing any approach comparison or overview.

Phase 3: Architecture Selection

  • Open references/efficient-filtering.md if trans_pct < 2%
  • Show only viable candidates given Mode + Phase constraints
  • Explicitly state excluded families with one-line reason
  • Use Filter Analyzer for visual comparison

Design Intake Checklist

Required signal + frequency spec (cannot proceed without)

  • Fs (Hz)
  • Response type: lowpass / highpass / bandpass / bandstop / notch
  • Edge frequencies in Hz

If any item is missing, ask.

Required intent for architecture choice (ask if unknown)

  • Mode: streaming (causal) | offline (batch)
  • Phase: zero-phase | linear-phase | don't-care
  • Magnitude constraints: Rp_dB passband ripple (default 1 dB), Rs_dB stopband attenuation (default 60 dB)

If Mode or Phase is unknown, ask 1-2 clarifying questions and stop.

Architecture Checkpoint

Compute and state before finalizing an approach:

  • trans_bw = Fstop - Fpass
  • trans_pct = 100 * trans_bw / Fs
  • M_max = floor(Fs/(2*Fstop)) (only meaningful for lowpass-based multirate)

Decision rule:

  • trans_pct > 5% -- single-stage FIR or IIR is usually fine
  • 2% <= trans_pct <= 5% -- single-stage possible; mention efficient alternatives if cost/latency matters
  • trans_pct < 2% -- stop and do a narrow-transition comparison (see references/quick-ref/efficient-filtering.md)

Design + Verify

  1. Feasibility check -- Let designfilt choose minimum order, then query filtord(d). Optionally use kaiserord/firpmord for FIR length estimates.
  2. Design candidates -- Prefer designfilt() with explicit Rp/Rs and SampleRate=Fs. Streaming IIR: use SystemObject=true. Offline zero-phase: filtfilt() is allowed but state that it squares the magnitude response.
  3. Compare visually -- Use filterAnalyzer() for comparing 2+ designs. Read references/quick-ref/filter-analyzer.md first. Minimum displays: magnitude + group delay.
  4. Verify with numbers -- Worst-case passband ripple and stopband attenuation vs spec. For filtfilt(), verify the effective response (magnitude squared).
  5. Deliver the output -- Specs recap, derived metrics, chosen architecture + why, MATLAB code, verification snippet + results, implementation form.

Key Functions

FunctionPurpose
designfilt()Primary filter design (FIR and IIR, all response types)
filterAnalyzer()Visual comparison of 2+ filter designs
freqz(), grpdelay()Frequency response and group delay analysis
filtfilt()Zero-phase offline filtering
dsp.SOSFilterStreaming IIR via SystemObject=true
designMultirateFIR()Multirate decimator/interpolator design
ifir()Interpolated FIR for narrow transitions at constant rate
cost()MPIS (MultiplicationsPerInputSample) on DSP System objects
kaiserord(), firpmord()FIR order estimation

Conventions

  • Always specify SampleRate=Fs in designfilt() and plot in Hz with freqz(d, [], Fs)
  • Use filterAnalyzer() for multi-filter comparison, not custom freqz/grpdelay plots
  • Use SOS form for IIR (avoid [b,a] for order > 8)
  • Use tiledlayout/nexttile for multi-panel figures (not subplot)

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 のスキルをすべて見る

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