ambisonictoolkit / atk-sc3

An extension library for the SuperCollider programming language
GNU General Public License v3.0
74 stars 12 forks source link

Active matrix processor for decoding #111

Closed mkschulze closed 2 years ago

mkschulze commented 2 years ago

Hi there,

just getting into Ambisonics & SC and the kit, but from what I gather so far, Ambisonics has the main limitation of the narrow sweet spot after decoding. Which the harpex decoder plugin claims to have solved as an active matrix processor, which is supposed to have a much larger sweet spot.

I wonder if this is something you have in consideration or is somehow already implemented in one of the SC tools available.

thx for letting me now!

joslloand commented 2 years ago

Add documentation illustrating the use of parametric upsamplers:

NOTE: Requires use of vstplugin extension for SuperCollider.

mkschulze commented 2 years ago

Does parametric upsampling basically mean, that If I route a stereo or mono synth into a 3rd Order Ambisonic bus and encode it there, let's say in ambix with SN3D and ACN, I will reach a larger sweetspot when decoding?

The signal flow in my case would look like this:

Stereo source -> 3rd Order AmbiBus (1. Insert: COMPASS Upsampler, 2. Insert: AmbiEncoder) -> 3rd Order Ambibus (Decoder) -> Quadro Out (Loudspeaker)

joslloand commented 2 years ago

@mkschulze

Does parametric upsampling basically mean, that If I route a stereo or mono synth into a 3rd Order Ambisonic bus and encode it there, let's say in ambix with SN3D and ACN, I will reach a larger sweetspot when decoding?

No... the input is a 1st order Ambisonic signal. This could be from a 1st order microphone, or a 1st order mix. Parametric upsampling is "soundfield sharpening", and generates a signal with higher harmonics from a signal with lower harmonics.

If you have a synth that outputs mono, just directly encode into HOA. No need for upsampling.

For a synth outputting stereo, the most simple approach is to just encode into HOA by directly specifying encoding angles. For instance L @ [ 30.0, 0.0 ].degrad and R @ [ -30.0, 0.0 ].degrad.

Make sense?

mkschulze commented 2 years ago

Kinda, but is parametric upscaling the same as active matrix processing? I am curious about the claim that it makes up for a larger sweet spot, which is supposed to be the weak point of Ambisonics. I try to understand or find a way to control this, ideally open source.

mkschulze commented 2 years ago

Also it seems that the compass decoder can also take HOA as input and is seemingly superior to traditional encoding/decoding.

joslloand commented 2 years ago

Kinda, but is parametric upscaling the same as active matrix processing?

Parametric upsampling / upscaling could be described as an active matrix process, but I wouldn't use that last phrase because it is not specific. HOA reverberation could be described as an active matrix process. A modulating transform, like rotation, could also be described as an active matrix process as could a modulating beamformer.

As an aside, technically we can implement spatial upsampling as a collection of modulating beamformers.

I am curious about the claim that it makes up for a larger sweet spot

As soon as we increase the order, we increase the sweet spot size. FYI, the ATK includes an estimator. Some example code:

// params
~order = 3;
~hoaOrder = ~order.asHoaOrder;
~freq = 220;

// find effective radius
~hoaOrder.radiusAtFreq(~freq);

// returns, meters
// -> 0.74441107473436

This "looks" small, but the effective radius is the area of exact soundfield reconstruction. Perceptually, the sweet spot extends beyond this.

which is supposed to be the weak point of Ambisonics

Sweet spot size isn't the primary goal of Ambisonics, actually. Instead, the goal is an isotropic soundfield. The result is a smooth sound world where loudspeakers don't jump out. We can think of this as "blurring" the soundfield in the direction of the physical loudspeakers and "sharpening" it in between. (It is quite elegant, actually!)

Also it seems that the compass decoder can also take HOA as input and is seemingly superior to traditional encoding/decoding.

As a parametric decoder, the COMPASS decoder uses a pairwise or triple-wise panning law. This makes the final result "sharper" (in some directions) for incident sounds (sounds with a direction).

seemingly superior

If sharper is superior given your use case, then yes. (There may be other issues to consider....)

There are quite a few publications on the COMPASS technique, along with open source implementations, if you'd like to inspect. Also if interest: COMPASS: Coding and Multidirectional Parameterization of Ambisonic Sound Scenes

The short answer, Politis, et al, have done excellent work here....

mkschulze commented 2 years ago

thanks for your explanation, much appreciated!