Back To Schedule

Building an Optimized DSP Framework in Modern C++

11:20 - 12:10 | Wednesday 12th November 2025 | Bristol 2
Advanced

The introduction of C++23 and upcoming C++26 features have significantly expanded the potential for building expressive, manageable embedded domain-specific languages (EDSLs) that compile efficiently into optimized lower-level representations. Features like enhanced constexpr and consteval execution enable a single, descriptive and clear representation of audio DSP algorithms to generate multiple optimized versions tailored to specific execution contexts and runtime constraints.

Inspired by successful libraries such as Halide and Eigen, we will look at a prototype C++ library developed to explore clean separation between algorithm description, data structures, and execution strategies. It generalizes inner-loop optimizations vectorized across two dimensions, enabling consistent application of advanced optimization techniques across diverse DSP algorithms. The library provides us a collection of design patterns that we can use to formulate how a contemporary C++23/26 audio graph can be built.

This talk will explore practical techniques and simple examples for implementing these design patterns in modern C++, demonstrating how they collectively form a robust framework for defining and executing efficient DSP algorithms:

  • Zero-cost Compile-time / Runtime Variant Values: Approaches to building scalar compile-time-constant and runtime-variant values, as well as more complex aggregate / property tree data structures, without incurring memory or performance penalties.
  • Parametric Data Structures: Designing simple, readable data structures that can be optimized cache friendly access and vectorization.
  • Expression Templates: Using C++'s template metaprogramming to defer computation, enabling optimized evaluation and graph transformations.
  • Loop and Data Optimizations: Techniques for loop-invariant value hoisting, re-blocking, and linearization to improve memory and execution efficiency.
  • Finite Difference Optimization: Automated optimizations for polynomials, trigonometric functions, and interpolation routines to minimize runtime computation.
  • Unified Parallelism Models: Integrating voice-parallel and time-parallel computations within a single descriptive graph representation.
  • Compile-time Graph Transformations: Leveraging constexpr to construct and optimize directed graphs representing DSP signal flows, including handling feedback loops and delays.
  • Benchmarking Execution Strategies: Describing, benchmarking, and comparing graph execution strategies (time-parallel, voice-parallel, block-based), enabling parametric, empirical optimization decisions.
  • Empirical Validation: Investigating whether and how these techniques improve DSP performance in realistic scenarios, with comparisons against established commercial and OS audio engines.

By applying these strategies, we demonstrate how a single algorithmic representation can flexibly handle multiple DSP use-cases—from polynomial interpolation and envelope generation to buffer read/write operations—significantly reducing redundant code and enabling focused optimization.

Furthermore, separating algorithm logic from execution strategies allows parameterizing benchmarks and optimizations based on CPU architecture and usage patterns, preserving algorithm clarity without embedding machine-specific details.

These strategies will be presented individually so they can be applied immediately in existing audio code-bases, and demonstrated within a unified framework context to highlight potential improvements in code clarity, performance, maintainability, testing, and benchmarking. Topics will be accessible for moderate-to-advanced C++ programmers, and anyone interested in exploring cutting-edge practices in modern audio DSP programming. Attendees will gain actionable insights, directly applicable techniques, and inspiration for advancing audio DSP code performance and clarity with modern C++.

Scott Carver

NA

pScott Carver is a sound artist, composer, and software developer, specializing in synthesis, specialization, and control systems for music performances and installations. They have been a professional C++ programmer for almost 20 years, working at Adobe Systems, Native Instruments, and on open-source creative software like SuperCollider, on topics like video / audio render graphs, expressive scripting, programming language design. They have worked an engineer-collaborator on numerous large-scale art installations and performances with artists like Christopher Kulendran Thomas & Annika Kuhlmann, Lauryn Youden, and Nicolas Varchausky. In their own music work, they are concerned with the power of sound to restructure space and the body, and provide a landscape for emotional catharsis and communal, unstructured perception.

They currently reside in Berlin, and work as a freelance artist and developer.

VolumetricCondensed