Skip to main content
ClaudeWave
Skill618 repo starsupdated 8d ago

matlab-design-pcb-filter

This skill designs RF bandpass, lowpass, and bandstop filters using topologies including coupled-line, hairpin, combline, interdigital, stub, spurline, and substrate-integrated waveguide (SIW) geometries. Use it when a user requests filter design, topology selection, or extraction of coupling matrices from measured data, and invoke before writing code since filter class names differ from conventional nomenclature.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/matlab/matlab-agentic-toolkit /tmp/matlab-design-pcb-filter && cp -r /tmp/matlab-design-pcb-filter/skills-catalog/rf-and-mixed-signal/matlab-design-pcb-filter ~/.claude/skills/matlab-design-pcb-filter
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# 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-txline`
- 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

1. **Before:** `matlab-manage-pcb-material` — set up substrate and conductor
2. **This skill:** Design the filter (catalog object or custom geometry)
3. **Check mesh/memory:** `memoryEstimate(obj, fc, 'RetainMesh', true)` — inspect auto-mesh density before committing to a full solve
4. **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

```matlab
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:

```matlab
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:

```matlab
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

```matlab
f = filterHairpin;
f.FilterOrder = 5;
f = design(f, 2.4e9);
show(f);
```

### Open-Loop Filter

Quasi-elliptic response with cross-coupling:

```matlab
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:

```matlab
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:

```matlab
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

```matlab
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:

```matlab
f = filterSpurline;
show(f);
sp = sparameters(f, linspace(1e9, 6e9, 51), 'SweepOption', 'interp');
rfplot(sp);
```

Double spurline for deeper rejection:

```matlab
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):

```matlab
f = filterStub;
f.StubLength
matlab-train-networkSkill

>

matlab-driving-data-importerSkill

Import recorded driving sensor data (GPS, camera, lidar, actor tracks, lanes) into scenariobuilder.* objects (GPSData, CameraData, LidarData, ActorTrackData, Trajectory, laneData) and run preprocessing — synchronize, offset correction, crop, normalizeTimestamps, convertTimestamps. Also: compute actor tracks from lidar when no annotations exist, attach camera/lidar mounting + intrinsics, export to MAT/workspace/timetable/script. Use for raw driving dataset files (KITTI, nuScenes, Waymo, Pandaset, ROS/ROS2 bags, .mat, .csv, .mp4) or driving/vehicle/sensor logs that need wrapping. drivingLogAnalyzer (DLA) is OPT-IN ONLY — invoke only on explicit user request ('DLA', 'open in DLA', 'inspect/explore/analyze the recording') or reported sensor problem (sync drift, timestamp mismatch, overlay misalignment). NEVER auto-launch DLA after wrapping (Rule 0). For 'build scenario / export to RoadRunner / drivingScenario / OpenSCENARIO / Unreal / simulate', hand off to matlab-scenario-builder.

matlab-scenario-builderSkill

Generate driving scenes, scenarios, road surfaces, and 3D content from already-wrapped scenariobuilder.* sensor data (GPS, camera, lidar, actor tracks) using Scenario Builder for Automated Driving Toolbox. Use to BUILD, EXPORT, or AUGMENT a virtual scenario/scene/map: ego or actor trajectories, trajectory smoothing, OpenCRG road-surface extraction, 3D asset generation, static-object placement, point-cloud georeferencing + elevation, lane-based ego localization, sensor-fusion tracking, scenario-event extraction (cut-ins, hard brakes, near-misses, ADAS disengagements), or export to RoadRunner, drivingScenario, OpenDRIVE, OpenCRG, OpenSCENARIO, or Unreal Engine. Also: log-to-scenario, scenario harvesting, accident/near-miss reconstruction, SOTIF (ISO 21448) and ISO 26262 scenario coverage, USGS-aerial-lidar scene augmentation, traffic-sign placement from camera+lidar logs. NOT for raw-data import or multi-sensor sync/crop/offset/timestamp normalization — route those to matlab-driving-data-importer.

roadrunner-asset-mappingSkill

>

roadrunner-convert-lanelet2-to-rrhdSkill

>

roadrunner-import-sceneSkill

>

roadrunner-rrhd-authoringSkill

>

matlab-build-simbiology-modelSkill

Build, modify, and diagram SimBiology models — API reference, helper functions, and layout patterns. Use when constructing or editing models programmatically or visually.