Skip to content

matlab/matlab-agentic-toolkit / skills-catalog/wireless-communications/matlab-generate-ble-waveform

matlab-generate-ble-waveform

Verified

Generate Bluetooth Low Energy (BLE) PHY waveforms. Read BEFORE writing any BLE waveform code to avoid hallucinating API patterns. Covers bleWaveformGenerator, bleIdealReceiver, bleCTEIQSample, bleAngleEstimate, bluetoothTestWaveform for LE1M/LE2M/LE500K/LE125K. Bluetooth Toolbox R2022a+.

references/cte-direction-finding.md

View on GitHub
# CTE Direction Finding Reference

## Overview

Constant Tone Extension (CTE) enables Bluetooth direction finding by appending
an unmodulated constant-frequency tone to the end of a BLE packet. Receivers
use antenna switching during the CTE to measure phase differences for Angle
of Arrival (AoA) or Angle of Departure (AoD) estimation.

## CTE Types

| Type | Description | Supported Modes |
|------|-------------|----------------|
| `ConnectionCTE` | Connection-oriented, used in data channels | LE1M, LE2M |
| `ConnectionlessCTE` | Periodic advertising, direction broadcast | LE1M only |

## Mode Compatibility Matrix

| Mode | Disabled | ConnectionCTE | ConnectionlessCTE |
|------|:--------:|:-------------:|:-----------------:|
| LE1M | Yes | Yes | Yes |
| LE2M | Yes | Yes | No |
| LE500K | Yes | No | No |
| LE125K | Yes | No | No |

## Duration Impact

CTE adds unmodulated samples after the packet payload:
- LE1M + ConnectionCTE: adds ~56-240 us (depends on CTE length)
- LE1M + ConnectionlessCTE: adds ~104-240 us
- LE2M + ConnectionCTE: adds ~184-240 us

## Key Constraints

1. **ConnectionlessCTE requires LE1M** -- attempting LE2M throws an error
2. **Coded modes do not support CTE** -- LE500K/LE125K with any CTE type throws an error
3. **CTE is appended, not embedded** -- the packet payload is unchanged
4. **The CTE portion is a pure tone** -- constant phase, no modulation

## BLE 5.1 Specification Reference

- CTE length: 2-20 units (each unit = 8 us, so 16-160 us of tone)
- Switching slots: 1 us or 2 us
- Reference period: 8 us (4 us reference + 4 us for first switch slot)

----

Copyright 2026 The MathWorks, Inc.
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall