DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
Loading...
Searching...
No Matches
MultibandCompressor.h File Reference

Multi-band compressor using CrossoverFilter + per-band Compressor. More...

#include "CrossoverFilter.h"
#include "Compressor.h"
#include "../Core/AudioBuffer.h"
#include "../Core/AudioSpec.h"
#include "../Core/DspMath.h"
#include "../Core/SimdOps.h"
#include "../Core/StateBlob.h"
#include <algorithm>
#include <array>
#include <atomic>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <vector>
Include dependency graph for MultibandCompressor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  dspark::MultibandCompressor< T, MaxBands >
 Multi-band compressor: crossover split, per-band compression, sum. More...
 

Namespaces

namespace  dspark
 Main namespace for the DSPark framework.
 

Detailed Description

Multi-band compressor using CrossoverFilter + per-band Compressor.

Splits the signal into 2..MaxBands frequency bands with a Linkwitz-Riley crossover (IIR or linear-phase), compresses each band independently with a full Compressor instance, then sums the bands back together. The band sum relies on every band sharing the same latency (see processBlock()).

Threading model:

  • prepare() / reset() / getState() / setState(): setup thread only (never concurrent with processBlock()).
  • setNumBands() / setCrossoverFrequency() / setOrder() / setCrossoverMode() and the per-band convenience setters: safe from any thread (they delegate to the atomic publications of CrossoverFilter / Compressor).
  • getBandCompressor(): the returned Compressor's parameter setters are safe from any thread; its prepare()/reset()/setState() are setup-thread (this class already prepares and resets every band for you).
  • getBandGainReductionDb() and the other getters: metering-style reads, safe from any thread (approximate while audio is running).

Dependencies: CrossoverFilter.h, Compressor.h, Core/AudioBuffer.h, Core/AudioSpec.h, Core/DspMath.h, Core/SimdOps.h, Core/StateBlob.h.

Definition in file MultibandCompressor.h.