agc-tuner
БесплатноБез исполняемых скриптовНе проверенAnalyze and optimize AGC (Automatic Gain Control) parameters for WaveCap-SDR channels. Use when audio is too quiet, too loud, has pumping artifacts, or when…
от diegosouzapw★ 68 звёзд на GitHubОб этом скилле
AGC Tuner for WaveCap-SDR
This skill helps analyze audio dynamics and optimize AGC (Automatic Gain Control) parameters for different demodulation modes.
When to Use This Skill
Use this skill when:
- Audio output is too quiet or too loud
- Audio has "pumping" or "breathing" artifacts (AGC responding too fast/slow)
- Setting up AGC for a new demodulation mode (AM, SSB, digital)
- Comparing AGC behavior between channels
- Debugging why AGC isn't controlling gain properly
- Finding optimal attack_time, release_time, and target_level
How It Works
The skill provides tools to:
- Analyze audio dynamics - Measure RMS levels, peak levels, crest factor over time
- Visualize AGC behavior - Plot gain adjustments, signal envelope, output level
- Suggest optimal parameters - Recommend attack/release times based on signal characteristics
- Compare settings - A/B test different AGC configurations
AGC Background
WaveCap-SDR's AGC (in backend/wavecapsdr/dsp/agc.py) maintains consistent audio output level:
class AGC:
def __init__(self, attack_time: float, release_time: float, target_level: float):
self.attack_alpha = 1.0 - np.exp(-1.0 / (attack_time * sample_rate))
self.release_alpha = 1.0 - np.exp(-1.0 / (release_time * sample_rate))
self.target_level = target_level
self.current_gain = 1.0
Key Parameters:
attack_time: How quickly AGC responds to increases in signal level (seconds)release_time: How quickly AGC responds to decreases in signal level (seconds)target_level: Desired RMS output level (0.0 to 1.0, typically 0.1-0.3)
Usage Instructions
Step 1: Identify Channel to Analyze
Find the channel you want to optimize:
curl http://127.0.0.1:8087/api/v1/captures | jq '.[] | .channels'
Note the channel ID (e.g., "ch1") and current AGC settings.
Step 2: Capture Audio and Analyze Dynamics
Run the AGC analyzer to capture audio and measure dynamics:
PYTHONPATH=backend backend/.venv/bin/python .claude/skills/agc-tuner/agc_analyzer.py \
--channel ch1 \
--duration 10 \
--port 8087
Parameters:
--channel: Channel ID to analyze (default: ch1)--duration: Seconds of audio to capture (default: 10)--port: Server port (default: 8087)--host: Server host (default: 127.0.0.1)--attack: Test attack time in seconds (default: current AGC setting)--release: Test release time in seconds (default: current AGC setting)--target: Test target level 0.0-1.0 (default: current AGC setting)--plot: Generate plots of AGC behavior--output: Save plots to file
Step 3: Interpret Results
The script outputs:
Signal Characteristics:
- RMS Level: Average signal power over time
- Peak Level: Maximum amplitude
- Crest Factor: Peak/RMS ratio (high = dynamic, low = compressed)
- Dynamic Range: Difference between loudest and quietest parts
AGC Behavior:
- Gain Variation: How much AGC is adjusting gain
- Settling Time: How long AGC takes to stabilize
- Overshoot: Does AGC overcorrect?
- Pumping Detection: Rapid gain changes indicating poor settings
Recommendations: The script suggests optimal attack/release times based on signal type.
Step 4: Typical AGC Settings by Mode
FM Broadcast (Music/Talk):
attack_time = 0.010 # 10ms - respond quickly to peaks
release_time = 0.500 # 500ms - slow release to avoid pumping
target_level = 0.2 # 20% RMS output
AM/SSB Voice:
attack_time = 0.005 # 5ms - fast attack for speech peaks
release_time = 0.300 # 300ms - moderate release
target_level = 0.25 # 25% RMS output (voice needs more headroom)
Digital Modes (P25, DMR):
attack_time = 0.001 # 1ms - very fast attack
release_time = 0.100 # 100ms - fast release
target_level = 0.3 # 30% RMS output (digital is pre-compressed)
NOAA Weather Radio:
attack_time = 0.020 # 20ms - moderate attack
release_time = 0.800 # 800ms - very slow release (steady signal)
target_level = 0.15 # 15% RMS output (avoid distortion)
Step 5: Update Channel AGC Settings
Update AGC parameters via API:
# Update AGC settings for channel
curl -X PATCH http://127.0.0.1:8087/api/v1/channels/ch1 \
-H "Content-Type: application/json" \
-d '{
"agcAttackMs": 10,
"agcReleaseMs": 500,
"agcTargetDb": -20
}'
# Note: Channel settings can be updated while running (no restart needed)
Or update in backend/config/wavecapsdr.yaml presets/recipes.
Common AGC Issues and Solutions
Issue: Audio Too Quiet
Symptoms: Output barely audible even at full volume Diagnosis: Target level too low, or source signal very weak Solution:
- Increase
target_levelfrom 0.1 to 0.3 - Check if antenna/tuning is good (use audio-quality-checker skill)
- Verify channel is started and streaming
Issue: Audio Pumping/Breathing
Symptoms: Volume swells u
Установить agc-tuner в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл agc-tuner?
Analyze and optimize AGC (Automatic Gain Control) parameters for WaveCap-SDR channels. Use when audio is too quiet, too loud, has pumping artifacts, or when tuning AGC attack/release/target settings for FM/AM/SSB modes.
Как установить скилл agc-tuner?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл agc-tuner запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic