Skip to main content
ClaudeWave
ES, Spanish
Skill1.2k estrellas del repoactualizado 6d ago

matlab-design-antenna-matching-network

This skill synthesizes lumped element L/C matching networks for antennas and RF loads using MATLAB's matchingnetwork object. It generates multiple candidate topologies (L, Pi, Tee, 2-element, 3-element), ranks designs by return loss or gain, exports optimized circuits, and converts designs to distributed elements via Richards transformation. Use when designing impedance matching networks, improving antenna return loss, transforming impedances between stages, or converting to microstrip stub implementations.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/matlab/matlab-agentic-toolkit /tmp/matlab-design-antenna-matching-network && cp -r /tmp/matlab-design-antenna-matching-network/skills-catalog/rf-and-mixed-signal/matlab-design-antenna-matching-network ~/.claude/skills/matlab-design-antenna-matching-network
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# Matching Network Design Skill

You are an expert RF and antenna engineer assisting a professional with impedance matching network design. Use MATLAB RF Toolbox `matchingnetwork` to synthesize, evaluate, and export L/C matching networks for antennas and RF loads.

## Core Concept

`matchingnetwork` synthesizes lumped L/C networks that transform a complex load impedance to a source impedance (default 50 ohm). It generates multiple candidate topologies, ranks them by performance goals (return loss, transducer gain), and exports the best designs as RF Toolbox `circuit` objects.

## When to Use

- User wants to match an antenna to a target impedance (typically 50 ohm)
- User asks about improving return loss or VSWR
- User wants to design an L, Pi, or Tee matching network
- User wants to transform impedance between stages
- User asks about distributed element matching (microstrip stubs)

## When NOT to Use

- User wants to design the antenna itself — use `matlab-design-antenna`
- User wants a PCB antenna with integrated matching — use `matlab-designing-pcb-antennas`
- User wants S-parameter analysis without matching — use `matlab-design-antenna`

## Core Workflow

1. **Parse the request** -- Identify the load (antenna, impedance, file), frequency, bandwidth, topology preference, and performance goals.
2. **Create the matchingnetwork** -- Set `CenterFrequency` FIRST, then `LoadImpedance`, `Bandwidth`, `Components`.
3. **Add evaluation parameters** -- Rank/filter designs by `gammain` or `Gt` over a frequency band.
4. **Inspect results** -- `circuitDescriptions` returns a table of all candidate circuits with component values.
5. **Visualize** -- `rfplot` (S11/gain vs frequency), `smithplot` (impedance transformation).
6. **Export** -- `exportCircuits` produces RF Toolbox `circuit` objects for further analysis.

## Key Properties

| Property | Default | Description |
|----------|---------|-------------|
| `SourceImpedance` | 50 | Source impedance (real scalar, ohms) |
| `LoadImpedance` | 100 | Load: scalar, antenna, sparameters, file, or function handle |
| `CenterFrequency` | 1e9 | Design center frequency (Hz) |
| `Bandwidth` | `CenterFrequency/20` | Design bandwidth (Hz) |
| `Components` | 2 | Topology: 2, 3, `"L"`, `"Pi"`, `"Tee"` |
| `LoadedQ` | Inf | Component quality factor (finite for realistic losses) |

**Critical constraint:** Set `CenterFrequency` BEFORE `LoadImpedance` when the load is a frequency-dependent object (antenna, sparameters, file). MATLAB errors if it cannot evaluate the load at the current center frequency.

## Load Impedance Options

| Type | Example | Notes |
|------|---------|-------|
| Complex scalar | `25 + 1j*30` | Frequency-independent |
| Antenna object | `design(pifa, freq)` | Evaluated at CenterFrequency |
| sparameters | `sparameters(ant, freqRange)` | 1-port S-params |
| Touchstone file | `"antenna.s1p"` | .s1p or .s2p file path |
| Function handle | `@(f) 36 + 1j*21*(f/2.4e9-1)` | Z(f) in ohms |

## Topology Selection

| Components | Topologies Generated | Use Case |
|------------|---------------------|----------|
| 2 | All 2-element L-sections | Narrowband, simplest |
| 3 | All 3-element networks | Wider bandwidth |
| `"L"` | L-section variants only | Equivalent to 2 |
| `"Pi"` | Pi (shunt-series-shunt) | Low-pass or band-pass |
| `"Tee"` | Tee (series-shunt-series) | High-impedance loads |

## Workflow 1: Antenna Impedance Matching

Match an antenna to 50 ohm with automatic topology selection:

```matlab
freq = 2.4e9;
ant = design(pifa, freq);

mn = matchingnetwork;
mn.CenterFrequency = freq;
mn.Bandwidth = 200e6;
mn.LoadImpedance = ant;
mn.Components = 2;

% Add performance goal: S11 < -15 dB in band
addEvaluationParameter(mn, 'gammain', '<', -15, [2.3e9 2.5e9], 1);

% View ranked circuits
cd = circuitDescriptions(mn);
disp(cd)

% Visualize matched performance
figure; rfplot(mn);
figure; smithplot(mn);

% Report best design
fprintf("Best: %s = %.3g F, %s = %.3g H\n", ...
    cd.component1Type(1), cd.component1Value(1), ...
    cd.component2Type(1), cd.component2Value(1));
```

### Before/After Comparison

```matlab
freqRange = linspace(2e9, 3e9, 101);
sAnt = sparameters(ant, freqRange);
sMN = sparameters(mn, freqRange);
S = sMN.Parameters;
gammaL = squeeze(sAnt.Parameters(1,1,:));
gammain = squeeze(S(1,1,:)) + squeeze(S(1,2,:)).*squeeze(S(2,1,:)).*gammaL ./ ...
    (1 - squeeze(S(2,2,:)).*gammaL);

figure;
plot(freqRange/1e9, 20*log10(abs(gammaL)), ...
     freqRange/1e9, 20*log10(abs(gammain)));
xlabel("Frequency (GHz)"); ylabel("S_{11} (dB)");
legend("Before", "After"); grid on;
title("Impedance Matching Improvement");
```

## Workflow 2: Topology Comparison

```matlab
freq = 5.8e9;
Zload = 15 + 1j*40;

topologies = {2, 3, "Pi", "Tee"};
for k = 1:numel(topologies)
    mn = matchingnetwork;
    mn.CenterFrequency = freq;
    mn.Bandwidth = 500e6;
    mn.LoadImpedance = Zload;
    mn.Components = topologies{k};
    addEvaluationParameter(mn, 'gammain', '<', -15, [5.5e9 6.1e9], 1);
    cd = circuitDescriptions(mn);
    fprintf("Components=%s: %d candidates\n", string(topologies{k}), height(cd));
end
```

### Three-Element for Wider Bandwidth

```matlab
freq = 2.4e9;
mn = matchingnetwork;
mn.CenterFrequency = freq;
mn.Bandwidth = 400e6;
mn.LoadImpedance = design(pifa, freq);
mn.Components = 3;
addEvaluationParameter(mn, 'gammain', '<', -10, [2.2e9 2.6e9], 1);

figure; rfplot(mn);
cd = circuitDescriptions(mn);
disp(cd(1,:))
```

## Workflow 3: Evaluation Parameters (Ranking & Filtering)

```matlab
mn = matchingnetwork;
mn.CenterFrequency = 2.4e9;
mn.Bandwidth = 200e6;
mn.LoadImpedance = design(dipole, 2.4e9);
mn.Components = 2;

% Goal 1: Return loss < -15 dB in passband (weight 2)
addEvaluationParameter(mn, 'gammain', '<', -15, [2.3e9 2.5e9], 2);

% Goal 2: Transducer gain > -1 dB (weight 1)
addEvaluationParameter(mn, 'Gt', '>', -1, [2.3e9 2.5e9], 1);

% View all active parameters
ep = getEvaluationParameters(mn);
disp(ep)

% Remove a specific evaluation p
matlab-access-datafeedSkill

>

matlab-analyze-ams-waveformSkill

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-analyze-dataSkill

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, 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-analyze-dependenciesSkill

Analyze the effective toolbox file set to produce a Dependency Manifest — classify all transitive dependencies as included, product, add-on, or external-unresolved, then present resolution options with tradeoffs. Use after matlab-define-toolbox-api when the spec is approved.

matlab-analyze-emSkill

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-analyze-installed-antennaSkill

Analyze antennas installed on electrically large conducting platforms using MATLAB Antenna Toolbox. Loads platform geometry from STL/STEP/IGES, installs antenna elements, selects electromagnetic solvers (MoM-PO, FMM, MoM), and computes patterns, impedance, coupling, and efficiency. Use when the user wants to model an antenna on a vehicle, aircraft, ship, satellite, or other large structure.

matlab-analyze-pcb-pdnSkill

PDN DC voltage/current analysis, IR drop, design rule checking, and multi-net batch analysis on imported PCB layouts. TRIGGER: user asks about power integrity, PDN analysis, IR drop, voltage distribution, current density, power nets, or design rule checking on a PCB. Invoke BEFORE writing code — the PDN API chain is specialized and non-obvious. SKIP: importing a PCB file (use matlab-read-pcb-layout), EM field/S-parameter extraction (use matlab-analyze-em), material/stackup setup only (use matlab-manage-pcb-material), transmission line design (use matlab-design-pcb-txline).

matlab-analyze-rcsSkill

Calculate and visualize monostatic and bistatic radar cross section (RCS) using MATLAB Antenna Toolbox. Computes RCS of platforms, antennas, and arrays with PO, MoM, and FMM solvers, supporting HH/VV/HV/VH polarization, GPU acceleration, and near-field observation. Use when the user wants to compute, plot, or analyze radar cross section.