matlab-design-pcb-txline
This skill designs and analyzes transmission line geometries including microstrip, stripline, CPW, and differential pairs on PCB stackups. Use it when calculating impedance-controlled trace dimensions, extracting per-unit-length RLGC parameters from 2D cross-sections, modeling crosstalk between coupled traces, or auto-sizing lines for target impedance at specified frequencies. Invoke before writing electromagnetic simulation code and prefer it over RF Toolbox analytical functions.
git clone --depth 1 https://github.com/matlab/matlab-agentic-toolkit /tmp/matlab-design-pcb-txline && cp -r /tmp/matlab-design-pcb-txline/skills-catalog/rf-and-mixed-signal/matlab-design-pcb-txline ~/.claude/skills/matlab-design-pcb-txlineSKILL.md
# Designing Transmission Lines
## When to Use
- Designing microstrip, stripline, or CPW transmission lines for impedance control
- Modeling differential pairs with or without aggressor traces for NEXT/FEXT crosstalk
- Analyzing 2D cross-sections for fast per-unit-length RLGC extraction
- Creating SIW (substrate integrated waveguide) lines
- Using `design()` to auto-size lines for target impedance at a given frequency
## When NOT to Use
- Building custom PCB structures from shapes — use `matlab-assemble-pcb-layout`
- Setting up substrate or conductor materials — use `matlab-manage-pcb-material`
- Running S-parameter or field analysis after design — use `matlab-analyze-em`
- Cascading transmission lines with other components — use `matlab-integrate-pcb-circuit`
## Tool Selection Priority
1. **RF PCB Toolbox** (default): `microstripLine`, `pcb2D`, `stripLine`, `coplanarWaveguide`, etc.
- 2D field solver — accurate for loss, coupling, and arbitrary stackups
- Use for any RLGC, impedance, cross-section, or transmission line design task
2. **RF Toolbox** (fallback only): `txlineMicrostrip`, `txlineStripline`, `txlineCPW`
- Analytical closed-form approximations, less accurate
- Use ONLY when: the user explicitly names these functions, or states RF PCB Toolbox is unavailable
## Typical Workflow
1. **Before:** `matlab-manage-pcb-material` — set up substrate and conductor
2. **This skill:** Design and analyze the transmission line
3. **Check mesh/memory:** `memoryEstimate(obj, fc, 'RetainMesh', true)` — inspect auto-mesh before solving
4. **After:** `matlab-analyze-em` — validate S-parameters → `matlab-optimize-pcb-design` — tune → `matlab-integrate-pcb-circuit` — cascade
## Quick Reference
| Object | Topology | Key Properties |
|--------|----------|---------------|
| `microstripLine` | Single microstrip on ground | Length, Width, Height, GroundPlaneWidth |
| `stripLine` | Signal embedded in dielectric | Length, Width, Height, GroundPlaneWidth |
| `coplanarWaveguide` | CPW on substrate | Length, Width, Height, SlotWidth, GroundPlaneWidth |
| `coupledMicrostripLine` | Edge-coupled microstrip pair | Length, Width, Spacing, Height |
| `coupledStripLine` | Edge-coupled stripline pair | Length, Width, Spacing, Height |
| `microstripLineCustom` | Custom coupled/differential microstrip | TraceType, TraceWidth, TraceSpacing, aggressor traces |
| `stripLineCustom` | Custom coupled/differential stripline | TraceType, TraceWidth, TraceSpacing |
| `pcbBendCustom` | Custom bend discontinuity (R2025a) | BendShape, Height, GroundPlaneWidth |
| `pcb2D` | 2D cross-section analysis | BoardWidth, BoardCenter, Layers |
| `SIWLine` | Substrate integrated waveguide | Length, Width, ViaSpacing, ViaDiameter |
## Microstrip Line
### Basic Creation and Design
```matlab
ms = microstripLine;
show(ms);
% Design for target impedance at frequency
ms = design(microstripLine, 3e9);
Z0 = getZ0(ms);
```
### Properties
```matlab
ms = microstripLine;
ms.Length = 20e-3;
ms.Width = 5e-3;
ms.Height = 1.6e-3; % Substrate height
ms.GroundPlaneWidth = 30e-3;
ms.Substrate = dielectric("FR4");
ms.Conductor = metal("Copper");
```
### Analysis
```matlab
ms.Conductor = metal("Copper"); % Required for rlgc (finite conductivity)
Z0 = getZ0(ms); % Characteristic impedance (no frequency argument)
td = propagationDelay(ms, 3e9); % Propagation delay (scalar frequency)
params = rlgc(ms, 3e9); % RLGC per unit length (scalar frequency)
freq = linspace(1e9, 6e9, 51);
sp = sparameters(ms, freq, 'SweepOption', 'interp'); % S-parameters (frequency vector OK)
rfplot(sp);
```
### Inverted / Suspended Microstrip
Model inverted or suspended configurations with multi-layer substrates (air gaps):
```matlab
% Inverted: air below trace, substrate above ground
ms = microstripLine;
ms.Substrate = dielectric(Name={"Air","FR4"}, EpsilonR=[1 4.4], ...
LossTangent=[0 0.02], Thickness=[0.5e-3 1.6e-3]);
ms.Height = 0.5e-3 + 1.6e-3;
% Suspended: air / substrate / air
ms.Substrate = dielectric(Name={"Air","FR4","Air"}, EpsilonR=[1 4.4 1], ...
LossTangent=[0 0.02 0], Thickness=[0.3e-3 0.8e-3 0.3e-3]);
ms.Height = sum([0.3e-3 0.8e-3 0.3e-3]);
```
## Stripline
Stripline has the signal trace embedded between two ground planes.
### Symmetric Stripline
```matlab
sl = stripLine;
sl.Length = 20e-3;
sl.Width = 3e-3;
sl.Height = 3.2e-3; % Total dielectric height (top + bottom)
sl.GroundPlaneWidth = 30e-3;
sl.Substrate = dielectric("Teflon");
sl.Conductor = metal("Copper");
show(sl);
```
### Asymmetric Stripline
Use multi-layer dielectric with different thicknesses above and below. `Height` = cumulative thickness of layers **below** the signal (a layer boundary, not the total):
```matlab
sl = stripLine;
sl.Substrate = dielectric(Name={"FR4","FR4"}, EpsilonR=[4.4 4.4], ...
LossTangent=[0.02 0.02], Thickness=[0.8e-3 1.6e-3]);
sl.Height = 0.8e-3; % Signal at the boundary between the two layers
```
### Suspended Stripline
```matlab
sl = stripLine;
sl.Substrate = dielectric(Name={"Air","FR4","Air"}, ...
EpsilonR=[1 4.4 1], LossTangent=[0 0.02 0], ...
Thickness=[0.5e-3 0.8e-3 0.5e-3]);
sl.Height = 0.5e-3; % Signal at Air/FR4 boundary (0.5mm from ground)
sl = design(stripLine, 3e9); % Or design for 50-ohm at target freq
```
## Coplanar Waveguide
### Basic CPW
```matlab
cpw = coplanarWaveguide;
cpw.Length = 20e-3;
cpw.Width = 2e-3; % Center conductor width
cpw.SlotWidth = 0.5e-3; % Gap between center and ground
cpw.Height = 1.6e-3;
cpw.GroundPlaneWidth = 10e-3;
show(cpw);
```
### Design and Analyze
```matlab
cpw = design(coplanarWaveguide, 5e9);
Z0 = getZ0(cpw);
sp = sparameters(cpw, linspace(1e9, 10e9, 51), 'SweepOption', 'interp');
rfplot(sp);
```
## Coupled Transmission Lines
### Edge-Coupled Microstrip
```matlab
cms = coupledMicrostripLine;
cms.Length = 20e-3;
cms.Width = 2e-3;
cms.Spacing = 0.5e-3; % Gap between traces
cms.>
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.
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.
>
>
>
>
Build, modify, and diagram SimBiology models — API reference, helper functions, and layout patterns. Use when constructing or editing models programmatically or visually.