SAF
Loading...
Searching...
No Matches
ambi_dec_internal.c File Reference

A frequency-dependent Ambisonic decoder for reproducing Ambisonic sound scenes over loudspeakers. More...

Go to the source code of this file.

Functions

void ambi_dec_setCodecStatus (void *const hAmbi, CODEC_STATUS newStatus)
 Sets codec status (see CODEC_STATUS enum)
 
void ambi_dec_interpHRTFs (void *const hAmbi, float azimuth_deg, float elevation_deg, float_complex h_intrp[HYBRID_BANDS][NUM_EARS])
 Interpolates between the 3 nearest HRTFs using amplitude-preserving VBAP gains.
 
void loadLoudspeakerArrayPreset (LOUDSPEAKER_ARRAY_PRESETS preset, float dirs_deg[MAX_NUM_LOUDSPEAKERS][2], int *newNCH, int *nDims)
 Returns the loudspeaker directions for a specified loudspeaker array preset.
 

Detailed Description

A frequency-dependent Ambisonic decoder for reproducing Ambisonic sound scenes over loudspeakers.

Different decoder settings can be specified for the low and high frequencies. A number of decoding options are also offered, including [1,2]. When utilising spherical harmonic signals derived from real microphone arrays, this implementation also allows the decoding order to be specified per frequency band; of course, this may also be used creatively. An optional, loudspeaker channel binauraliser is included, along with with SOFA file loading, for headphone listening.

The algorithms utilised in this Ambisonic decoder were pieced together and developed in collaboration with Archontis Politis.

Test
test__saf_example_ambi_dec()
See also
[1] Zotter F, Pomberger H, Noisternig M. Energy–preserving ambisonic decoding. Acta Acustica united with Acustica. 2012 Jan 1; 98(1):37-47.
[2] Zotter F, Frank M. All-round ambisonic panning and decoding. Journal of the audio engineering society. 2012 Nov 26; 60(10):807-20.
Author
Leo McCormack
Date
07.12.2017
License
ISC

Definition in file ambi_dec_internal.c.

Function Documentation

◆ ambi_dec_interpHRTFs()

void ambi_dec_interpHRTFs ( void *const hAmbi,
float azimuth_deg,
float elevation_deg,
float_complex h_intrp[HYBRID_BANDS][NUM_EARS] )

Interpolates between the 3 nearest HRTFs using amplitude-preserving VBAP gains.

The HRTF magnitude responses and HRIR ITDs are interpolated seperately before being re-combined.

Parameters
[in]hAmbiambi_dec handle
[in]azimuth_degInterpolation direction azimuth in DEGREES
[in]elevation_degInterpolation direction elevation in DEGREES
[out]h_intrpInterpolated HRTF

Definition at line 59 of file ambi_dec_internal.c.

◆ ambi_dec_setCodecStatus()

void ambi_dec_setCodecStatus ( void *const hAmbi,
CODEC_STATUS newStatus )

Sets codec status (see CODEC_STATUS enum)

Definition at line 48 of file ambi_dec_internal.c.

◆ loadLoudspeakerArrayPreset()

void loadLoudspeakerArrayPreset ( LOUDSPEAKER_ARRAY_PRESETS preset,
float dirs_deg[MAX_NUM_LOUDSPEAKERS][2],
int * nCH,
int * nDims )

Returns the loudspeaker directions for a specified loudspeaker array preset.

The function also returns the number of loudspeakers in the array, and a crude estimate of whether it is 2D or 3D (based on whether the sum of the absolute loudspeaker elevation angle is not zero). Note: 2-D setups which are not on the horizontal plane (i.e. all elevations==0) will be registered as a 3-D setup. Further Note: default uniformly distributed points are used to pad the dirs_deg matrix up to the MAX_NUM_LOUDSPEAKERS, if nCH is less than this. This can help avoid scenarios of many sources being panned in the same direction, or triangulations errors.

Parameters
[in]presetSee LOUDSPEAKER_ARRAY_PRESETS enum
[out]dirs_degLoudspeaker directions, [azimuth elevation] convention, in DEGREES;
[out]nCH(&) number of loudspeaker directions in the array
[out]nDims(&) number of dimensions (2 or 3)

Definition at line 117 of file ambi_dec_internal.c.