Signalsmith Audio's DSP Library  1.6.0
Useful C++ classes/templates for audio effects
Static Methods | Methods
signalsmith::mix::StereoMultiMixer< Sample, channels > Class Template Reference

#include <mix.h>

Detailed Description

template<typename Sample, int channels>
class signalsmith::mix::StereoMultiMixer< Sample, channels >

Upmix/downmix a stereo signal to an (even) multi-channel signal.

When spreading out, it rotates the input by various amounts (e.g. a four-channel signal would produce (left, right, mid side)), such that energy is preserved for each pair.

When mixing together, it uses the opposite rotations, such that upmix → downmix produces the same stereo signal (when scaled by .scalingFactor1().

Static Methods

static constexpr Sample scalingFactor1 ()
 Scaling factor for the downmix, if channels are phase-aligned. More...
 
static Sample scalingFactor2 ()
 Scaling factor for the downmix, if channels are independent. More...
 

Methods

template<class In , class Out >
void stereoToMulti (In &input, Out &output) const
 
template<class In , class Out >
void multiToStereo (In &input, Out &output) const
 

Method Details

◆ scalingFactor1()

template<typename Sample , int channels>
static constexpr Sample signalsmith::mix::StereoMultiMixer< Sample, channels >::scalingFactor1 ( )
inlinestaticconstexpr

Scaling factor for the downmix, if channels are phase-aligned.

◆ scalingFactor2()

template<typename Sample , int channels>
static Sample signalsmith::mix::StereoMultiMixer< Sample, channels >::scalingFactor2 ( )
inlinestatic

Scaling factor for the downmix, if channels are independent.