
matlab-design-pcb-filter
Bandpass, lowpass, bandstop filter design — hairpin, coupled-line, combline, stub, SIW for frequency selection and harmonic rejection. TRIGGER: user asks to design, create, or analyze any RF filter (bandpass, lowpass, highpass, bandstop, hairpin, coupled-line, combline, stub, SIW). Invoke BEFORE writing code — filter class names differ from what you would guess. SKIP: EM simulation/S-parameter extraction of an existing filter (use matlab-analyze-em), general PCB layout assembly (use matlab-assemble-pcb-layout), material/stackup setup only (use matlab-manage-pcb-material), optimization sweeps (use matlab-optimize-pcb-design).
- Installs
- 88
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-design-pcb-filter- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads matlab-design-pcb-filter automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Designing RF Filters
When to Use
- Designing bandpass filters (coupled-line, hairpin, open-loop, combline, interdigital, SIW)
- Designing lowpass filters (stepped-impedance)
- Designing bandstop or notch filters (spurline, stub-based)
- Extracting coupling matrices from measured S-parameter data (measuredFilter)
- Selecting a filter topology for a given bandwidth, selectivity, or size requirement
When NOT to Use
- Designing transmission lines for impedance control — use
matlab-design-pcb-transmission-line - Designing couplers or splitters — use
matlab-design-pcb-coupler - Designing passive components (inductors, capacitors, baluns) — use
matlab-design-pcb-passive - Setting up substrate or conductor materials — use
matlab-manage-pcb-material - Optimizing filter dimensions after design — use
matlab-optimize-pcb-design
Typical Workflow
- Before:
matlab-manage-pcb-material— set up substrate and conductor - This skill: Design the filter (catalog object or custom geometry)
- Check mesh/memory:
memoryEstimate(obj, fc, 'RetainMesh', true)— inspect auto-mesh density before committing to a full solve - After:
matlab-analyze-em— validate S-parameters →matlab-optimize-pcb-design— tune dimensions →matlab-write-pcb-layout— export Gerber
Quick Reference — Filter Selection
| Filter Object | Type | Poles | Best For |
|---|---|---|---|
filterCoupledLine | Bandpass | 2–8 | General microstrip BPF |
filterHairpin | Bandpass | 2–8 | Compact BPF, folded resonators |
filterOpenLoop | Bandpass | 4/6/8 | Compact quasi-elliptic |
filterCombline | Bandpass | 2–6 | Narrow-band, high-Q |
filterInterdigital | Bandpass | 2–8 | Wideband, good stopband |
filterStepImpedanceLowPass | Lowpass | 3–9 | Distributed LPF |
filterStub | LP/HP/BS | N stubs | Flexible stub topology |
filterSpurline | Bandstop | 1–2 | Compact notch filter |
SIWFilter | Bandpass | 2–6 | High-Q waveguide-in-PCB |
measuredFilter | Bandpass | N | Model extraction from measurements |
Bandpass Filters
Coupled-Line Filter
f = filterCoupledLine;
f = design(filterCoupledLine, 3e9); % Design at 3 GHz
show(f);
sp = sparameters(f, linspace(1e9, 5e9, 101), 'SweepOption', 'interp');
rfplot(sp);
Key properties: FilterOrder, CoupledLineLength, CoupledLineWidth, CoupledLineSpacing, PortLineLength, PortLineWidth.
Hairpin Filter
Folded coupled-line resonators for compact size:
f = design(filterHairpin, 3e9);
show(f);
memoryEstimate(f, 3e9, 'RetainMesh', true); % Check mesh density before solving
sp = sparameters(f, linspace(1e9, 5e9, 101), 'SweepOption', 'interp');
rfplot(sp);
Key properties: FilterOrder, CoupledLineLength, CoupledLineWidth, CoupledLineSpacing, PortLineLength, PortLineWidth, Spacing, ResonatorOffset, FeedOffset.
Chebyshev Response
Pass FilterType and RippleFactor to design() for equiripple passband response:
f = design(filterHairpin, 1.8e9, FBW=10, FilterType='Chebyshev', RippleFactor=0.5);
FilterType options: 'Butterworth' (default), 'Chebyshev'. FBW sets fractional bandwidth (%). RippleFactor sets passband ripple in dB (default 0.5) — only applies to Chebyshev.
Fifth-Order Hairpin
f = filterHairpin;
f.FilterOrder = 5;
f = design(f, 2.4e9);
show(f);
Open-Loop Filter
Quasi-elliptic response with cross-coupling:
f = filterOpenLoop;
f.NumPoles = 6;
f.FeedOffset = 0.5e-3;
show(f);
sp = sparameters(f, linspace(1e9, 5e9, 101), 'SweepOption', 'interp');
rfplot(sp);
Key Properties: NumPoles (4/6/8), ResonatorLength, ResonatorWidth, SplitGap, GapHorizontal, GapVertical, FeedOffset, CoupledResonatorGap, QuadrupletGap, QuadrupletOffset.
Combline Filter
Short-circuited resonators, excellent for narrow-band. Note: filterCombline does not have a design function — set properties manually:
f = filterCombline;
f.FilterOrder = 3;
f.Height = 1.6e-3;
show(f);
Key Properties: FilterOrder, ResonatorLength (scalar or vector), ResonatorWidth, ResonatorSpacing (scalar or vector), ResonatorOffset, FeedOffset, Capacitor (loading capacitance — distinctive to combline).
Interdigital Filter
Alternating short-circuited resonators, wideband. Note: filterInterdigital does not have a design function — set properties manually:
f = filterInterdigital;
f.FilterOrder = 4;
f.Height = 1.6e-3;
show(f);
sp = sparameters(f, linspace(3e9, 7e9, 101), 'SweepOption', 'interp');
rfplot(sp);
Key Properties: FilterOrder, ResonatorLength (scalar or vector), ResonatorWidth (scalar or vector), ResonatorSpacing (scalar or vector), ResonatorOffset, ViaDiameter (scalar or vector — distinctive to interdigital), FeedOffset, IsShielded, Connector.
Lowpass Filters
Stepped-Impedance Lowpass
f = filterStepImpedanceLowPass;
f = design(filterStepImpedanceLowPass, 2.5e9);
show(f);
sp = sparameters(f, linspace(0.1e9, 5e9, 101), 'SweepOption', 'interp');
rfplot(sp);
Key properties: FilterOrder, HighZLineWidth, LowZLineWidth, HighZLineLength, LowZLineLength.
Bandstop / Notch Filters
Spurline Filter
Compact notch using coupled-line section on one side:
f = filterSpurline;
show(f);
sp = sparameters(f, linspace(1e9, 6e9, 51), 'SweepOption', 'interp');
rfplot(sp);
Double spurline for deeper rejection:
f = filterSpurline;
f.LineType = 'Double';
show(f);
Key Properties: LineType ('Single'/'Double'), CoupledLineLength, CoupledLineWidth, CoupledLineSpacing, LineGap (gap between coupled line and output line — distinctive to spurline), IsShielded, Connector.
Stub Filters (Open/Short)
The filterStub object supports open-circuit stubs (bandstop) and short-circuit stubs (highpass):
f = filterStub;
f.StubLength = [6e-3 6e-3 6e-3];
f.StubWidth = [0.5e-3 0.5e-3 0.5e-3];
f.StubOffsetX = [-6e-3 0 6e-3];
f.StubShort = [0 0 0]; % 0=open (bandstop), 1=short (highpass)
f.StubDirection = [0 0 0]; % 0=below, 1=above trace
f.SeriesLineWidth = 1.8e-3;
f.SeriesLineLength = 12e-3;
show(f);
Key Properties: StubLength (vector), StubWidth (vector), StubFeedOffsetX (vector), StubShort (0=open, 1=short; vector), StubDirection (0=down, 1=up; vector), SeriesLineLength, SeriesLineWidth, IsShielded, Connector.
Radial Stub
rs = stubRadialShunt;
rs = design(stubRadialShunt, 5e9);
show(rs);
SIW Bandpass Filter
SIWFilter uses NumResonators (not FilterOrder), and Substrate is read-only (set via internal resonator objects):
f = SIWFilter;
f.NumResonators = 4;
show(f);
sp = sparameters(f, linspace(8e9, 14e9, 51), 'SweepOption', 'interp');
rfplot(sp);
Measured Filter Extraction
measuredFilter extracts a coupled-resonator circuit model (coupling matrix, external Q, unloaded Q) from measured or simulated 2-port S-parameter data. This enables filter tuning, diagnosis, and comparison against ideal synthesis targets.
Key Properties:
Sparameters— 2-port S-parameters data (sparametersobject)FilterOrder— Number of resonators in the modelCenterFrequency— Passband center frequency (Hz)BandWidth— 3-dB bandwidth (Hz)CouplingMatrix— Extracted N+2 coupling matrix (populated after extraction)QualityFactor— Unloaded quality factor (populated afterqualityfactor())
Key Methods:
residue(mf)— Extract lowpass admittance residues and poles from S-parameter datatransversalMat(mf)— Calculate transversal coupling matrix from residuescanonicalCouplingMat(mf)— Rotate transversal matrix to canonical (folded) formoptimize(mf)— Isospectral optimization of the coupling matrixsparameters(mf, freq)— Synthesize S-parameters from the extracted circuit modelqualityfactor(mf)— Calculate unloaded quality factor
Complete Workflow
% Step 1: Load measured S-parameters and inspect visually
S_meas = sparameters('measured_filter.s2p');
rfplot(S_meas);
% Identify center frequency and bandwidth from the plot
% Step 2: Create measuredFilter with matching initial guess
mf = measuredFilter(Sparameters=S_meas, ...
FilterOrder=8, ...
CenterFrequency=2114.6e6, ...
BandWidth=9.6e6);
% Step 3: Extract residues and poles
residue(mf);
% Step 4: Build transversal matrix, then rotate to canonical form
transversalMat(mf);
M = canonicalCouplingMat(mf);
disp(mf.CouplingMatrix);
% Step 5: Optimize coupling matrix (isospectral flow)
mf = optimize(mf);
% Step 6: Compare extracted model vs measured data
freq = linspace(2.08e9, 2.15e9, 501);
S_model = sparameters(mf, freq);
rfplot(S_meas); hold on;
rfplot(S_model, '--');
legend('Measured', 'Extracted Model');
% Step 7: Quality factor
Q = qualityfactor(mf);
disp(mf.QualityFactor);
Custom Filter Assembly
For topologies not in the catalog, build with pcbComponent:
% Example: custom 2-pole open-loop filter from shape primitives
sub = dielectric("FR4");
sub.Thickness = 1.6e-3;
cond = metal("Copper");
% Build resonator shapes using traceLine, traceRectangular, Boolean ops
% (see matlab-assemble-pcb-layout skill)
pcb = pcbComponent;
pcb.Layers = {filterShape, sub, groundPlane};
pcb.BoardShape = groundPlane;
pcb.BoardThickness = sub.Thickness;
pcb.Conductor = cond;
pcb.FeedDiameter = feedWidth/2;
pcb.FeedLocations = [x1 y1 1 3; x2 y2 1 3];
Multi-Layer Filters
All filter catalog objects support multi-layer dielectrics:
f = design(filterCoupledLine, 3e9);
sub = dielectric("FR4", "Teflon");
sub.Thickness = [0.8e-3 0.4e-3]; % Set Thickness BEFORE assigning to filter
f.Substrate = sub;
f.Height = 1.2e-3;
show(f);
Filter Selection Guide
| Need | Recommended Filter | Notes |
|---|---|---|
| Bandpass, compact | filterHairpin | Folded resonators save board area |
| Bandpass, standard | filterCoupledLine | Supports design(), easiest starting point |
| Bandpass, high selectivity | filterInterdigital | Good stopband rejection, wideband |
| Bandpass, capacitively loaded | filterCombline | Narrow-band, high-Q, short resonators |
| Bandpass, cross-coupling / TZs | filterOpenLoop | Quasi-elliptic, transmission zeros; supports design() |
| Bandpass, SIW technology | SIWFilter | High-Q waveguide-in-PCB |
| Lowpass, stepped impedance | filterStepImpedanceLowPass | Supports design() |
| Bandstop, notch | filterSpurline | Very compact, single or double |
| Bandpass/Bandstop, stub-based | filterStub | Flexible open/short stub topology; no design() |
| Model extraction from data | measuredFilter | Coupling matrix from measurements |
Design Adjustments
| Problem | Adjust | Direction |
|---|---|---|
| Passband too wide | FilterOrder, Spacing | Increase order, decrease spacing |
| Insertion loss too high | Conductor thickness | Use real metal, increase thickness |
| Rejection too shallow | FilterOrder | Increase |
| Center freq shifted | Re-run design(filt, freq) | -- |
| Return loss poor | FeedOffset, FeedType | Tune feed position |
Pitfalls
-
Use interpolating sweep for S-parameters: Always use
sparameters(obj, freq, 'SweepOption', 'interp')for MoM solves. Direct sweeps solve at every frequency point individually and are significantly slower. -
Check mesh density before solving: Catalog filters generate dense auto-meshes that dominate runtime. Always run
memoryEstimate(obj, fc, 'RetainMesh', true)beforesparameters(). If memory is excessive, coarsen:mesh(obj, 'MaxEdgeLength', lambda/6). Seematlab-analyze-emfor full mesh inspection workflow. -
FilterOrder vs NumPoles: Some objects use
FilterOrder, others useNumPoles. Check the specific object's properties. -
PortLineLength affects response: The port feed line length contributes phase and can shift the filter's apparent center frequency. Ensure sufficient length for proper excitation.
-
design() sets all dimensions: After
design(obj, fc), all geometric parameters are overwritten. Customize properties after callingdesign, not before. -
Coupled-line filter bandwidth: Controlled by
CouplingSpacing— smaller gaps = tighter coupling = wider bandwidth, but fabrication-limited. -
StubShort convention: In
filterStub,StubShort=0means open-ended stub (creates bandstop);StubShort=1means short-circuited (creates highpass). This is counterintuitive. -
No design() for combline/interdigital/stub:
filterCombline,filterInterdigital, andfilterStubdo not supportdesign(). Set dimensions manually based on resonator theory. -
SIWFilter Substrate is read-only: You cannot directly set
SIWFilter.Substrate. The substrate is controlled through the internal resonator and transmission line element objects. -
measuredFilter initial guess matters. The
CenterFrequencyandBandWidthmust closely match the actual passband of the measured data. Poor initial values causeresidue()to extract incorrect poles. Inspect the S-parameter data visually first. -
ResonatorSpacing vector length = FilterOrder - 1: For combline, interdigital, and hairpin filters,
ResonatorSpacingspecifies gaps between resonators. An N-th order filter has N resonators but only N-1 gaps. Do NOT pass N elements — pass N-1. -
GroundPlaneLength is read-only on most filters:
GroundPlaneLengthandGroundPlaneWidthare auto-computed from resonator dimensions onfilterCombline,filterHairpin, andfilterInterdigital. Do NOT attempt to set them.
Related Skills
matlab-manage-pcb-material— Substrate selection for filter performancematlab-analyze-em— S-parameter extraction and field visualizationmatlab-optimize-pcb-design— Optimizing filter dimensionsmatlab-assemble-pcb-layout— Custom filter topologies via pcbComponentmatlab-design-pcb-passive— Resonators, baluns, split-ring structures for filters
Copyright 2026 The MathWorks, Inc.
FAQ
What does the matlab-design-pcb-filter skill do?
Bandpass, lowpass, bandstop filter design — hairpin, coupled-line, combline, stub, SIW for frequency selection and harmonic rejection. TRIGGER: user asks to design, create, or analyze any RF filter (bandpass, lowpass, highpass, bandstop, hairpin, coupled-line, combline, stub, SIW). Invoke BEFORE writing code — filter class names differ from what you would guess. SKIP: EM simulation/S-parameter extraction of an existing filter (use matlab-analyze-em), general PCB layout assembly (use matlab-assemble-pcb-layout), material/stackup setup only (use matlab-manage-pcb-material), optimization sweeps (use matlab-optimize-pcb-design).
How do I install matlab-design-pcb-filter?
Run npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-design-pcb-filter in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/matlab-design-pcb-filter/ (personal) or .claude/skills/matlab-design-pcb-filter/ (project).
Which AI agents can use matlab-design-pcb-filter?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is matlab-design-pcb-filter safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains matlab-design-pcb-filter?
It is published by matlab in matlab/matlab-agentic-toolkit. It has 88 recorded installs.
More from matlab/matlab-agentic-toolkit
matlab-review-code
matlab/matlab-agentic-toolkit
Review MATLAB code for quality, performance, maintainability, and adherence to MathWorks coding standards. Uses checkmatlabcode and matlabcodingguidelines. Use when reviewing code, checking style, finding code smells, assessing quality, or preparing code for handoff or publication.
matlab-analyze-data
matlab/matlab-agentic-toolkit
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-design-digital-filter
matlab/matlab-agentic-toolkit
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.
matlab-modernize-code
matlab/matlab-agentic-toolkit
Modernize removed or discouraged MATLAB functions and patterns. Use when the checkmatlabcode MCP tool reports that a function "is not recommended", "will be removed in a future release", or "has been removed" — at any severity (info, warning, or error) — when migrating legacy code, or when replacing removed or discouraged APIs with current equivalents. Also applies to discouraged patterns Code Analyzer does not flag (containers.Map, bsxfun, str2num, eval, clear all) and to removed or discouraged functions such as trainNetwork, csvread, xlsread, datenum, guide, svmtrain, ltln2val, webmap.
matlab-create-live-script
matlab/matlab-agentic-toolkit
Create, edit, and run plain-text MATLAB live scripts (.m files) with rich text formatting, LaTeX equations, section breaks, and inline figures. Use when generating tutorials, analysis notebooks, reports, documentation, or educational content, when modifying existing live scripts, or when converting existing binary .mlx files to .m for version control. Requires R2025a+.
matlab-agentic-toolkit-setup
matlab/matlab-agentic-toolkit
Install and configure the MATLAB Agentic Toolkit — detect MATLAB, install the MCP server, register with your AI coding agent, and verify the environment. Supports Claude Code, Codex, GitHub Copilot, Amp, and Gemini CLI.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
ui-taste
uizze.sh
Give your coding agent better UI taste. Build and polish web and iOS interfaces with Uizze's anti-ui-slop playbooks and optional real-product references. Use for UI design, implementation, redesign, critique, or a final visual review in Claude Code, Codex, Cursor, or Copilot.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.