audio-dsp

Implements real-time DSP filters, STFT analysis, and lock-free audio threading in C++.

Updated May 22, 2026
One-click install
npx skills add https://github.com/viniciuscs84/sdd-toolkit --skill audio-dsp-viniciuscs84
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audio-dsp
Source: https://github.com/viniciuscs84/sdd-toolkit/tree/main/skills/audio-dsp
Command: npx skills add https://github.com/viniciuscs84/sdd-toolkit --skill audio-dsp-viniciuscs84

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing audio DSP code that runs on a real-time audio thread without dropouts, zipper noise, or data races is error-prone. This Skill provides a structured workflow for designing thread-safe audio architectures, implementing RT-safe filters and spectral analysis, and testing them correctly. ## Core Features & Use Cases - RT-Safe DSP Implementation: Provides ready-to-use Biquad filter (Direct Form II Transposed), parameter smoothing, and STFT pipeline code with strict real-time constraints (no allocation, no locks, no IO on the audio thread). - Lock-Free Concurrency Wiring: Includes an SPSC queue template for passing events from the audio thread to worker threads using correct memory ordering. - Testing & Optimization Guidance: Covers impulse response tests, stability tests with white noise, edge cases (0 Hz, Nyquist, silence), and SIMD/vectorization tips. - Use Case: You are building a lowpass filter that users can sweep in real time. Use this Skill to implement the Biquad, smooth the cutoff parameter to avoid zipper noise, and push visualization data to a worker thread via an SPSC queue. ## Quick Start Use the audio-dsp skill to implement an RT-safe lowpass Biquad filter with smoothed cutoff control and an SPSC queue for metering output.

Frequently Asked Questions about audio-dsp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a real-time safe Biquad filter in C++?

Use the Direct Form II Transposed structure with precomputed coefficients and preallocated state. Compute coefficients with setLowpass only on a non-RT thread or in prepare(), never mid-block, and smooth parameter changes to avoid zipper noise.

How to pass data from an audio thread to a worker thread without locks?

Use a single-producer single-consumer (SPSC) ring buffer with atomic head and tail indices and acquire/release memory ordering. The audio thread pushes and silently drops on full; the worker thread pops and processes.

What operations are forbidden on a real-time audio thread?

The audio thread must avoid new/malloc, vector push_back, mutexes, file IO, printf, syscalls, exceptions, and dynamic container resizing. All state must be pre-allocated in prepare() or prepareToPlay().

Why does my audio filter cause CPU spikes on silence?

CPU spikes on silence are caused by denormal floating-point numbers. Fix them by enabling FTZ/DAZ flags, using juce::ScopedNoDenormals, or adding a tiny DC offset like 1e-25f to the filter state.

What are the limitations of this DSP approach?

This Skill covers DSP algorithms, threading, and offline spectral analysis only. It does not cover JUCE plugin lifecycle wiring or ffmpeg integration, and STFT analysis with allocation is intended for offline or hybrid use, not the RT thread.