SAF
Loading...
Searching...
No Matches
panner_internal.h File Reference

A frequency-dependent 3D panner based on the Vector-base Amplitude Panning (VBAP) method [1], with an optional spread control [2]. More...

#include "panner.h"
#include "saf.h"
#include "saf_externals.h"

Go to the source code of this file.

Data Structures

struct  panner_data
 Main structure for panner. More...
 

Macros

#define FORCE_3D_LAYOUT
 FLAG: Force 2D loudspeaker setups to also use 3D VBAP (i.e.
 
#define PANNER_FRAME_SIZE   ( 128 )
 Framesize, in time-domain samples.
 
#define HOP_SIZE   ( 128 )
 STFT hop size.
 
#define HYBRID_BANDS   ( HOP_SIZE + 5 )
 Number of frequency bands.
 
#define TIME_SLOTS   ( PANNER_FRAME_SIZE / HOP_SIZE )
 Number of STFT timeslots.
 

Functions

void panner_setCodecStatus (void *const hPan, CODEC_STATUS newStatus)
 Sets codec status (see CODEC_STATUS enum)
 
void panner_initGainTables (void *const hPan)
 Intialises the VBAP gain table used for panning.
 
void panner_initTFT (void *const hPan)
 Initialise the filterbank used by panner.
 
void panner_loadSourcePreset (SOURCE_CONFIG_PRESETS preset, float dirs_deg[MAX_NUM_INPUTS][2], int *newNCH, int *nDims)
 Loads source directions from preset.
 
void panner_loadLoudspeakerPreset (LOUDSPEAKER_ARRAY_PRESETS preset, float dirs_deg[MAX_NUM_INPUTS][2], int *newNCH, int *nDims)
 Loads source/loudspeaker directions from preset.
 

Detailed Description

A frequency-dependent 3D panner based on the Vector-base Amplitude Panning (VBAP) method [1], with an optional spread control [2].

Depending on the listening room, it may be beneficial to employ amplitude- normalised gains for low frequencies, and energy-normalised gains for high frequencies. Therefore, this VBAP implementation also uses the method described in [3], to do just that.

See also
[1] Pulkki, V. (1997). Virtual sound source positioning using vector base amplitude panning. Journal of the audio engineering society, 45(6), 456-466.
[2] Pulkki, V. (1999). Uniform spreading of amplitude panned virtual sources. In Proceedings of the 1999 IEEE Workshop on Applications of Signal Processing to Audio and Acoustics. WASPAA'99 (Cat. No. 99TH8452) (pp. 187-190). IEEE.
[3] Laitinen, M., Vilkamo, J., Jussila, K., Politis, A., Pulkki, V. (2014). Gain normalisation in amplitude panning as a function of frequency and room reverberance. 55th International Conference of the AES. Helsinki, Finland.
Author
Leo McCormack
Date
25.09.2017
License
ISC

Definition in file panner_internal.h.

Macro Definition Documentation

◆ FORCE_3D_LAYOUT

#define FORCE_3D_LAYOUT

FLAG: Force 2D loudspeaker setups to also use 3D VBAP (i.e.

with 2 virtual loudspeakers on the top/bottom)

Definition at line 59 of file panner_internal.h.

◆ HOP_SIZE

#define HOP_SIZE   ( 128 )

STFT hop size.

Definition at line 67 of file panner_internal.h.

◆ HYBRID_BANDS

#define HYBRID_BANDS   ( HOP_SIZE + 5 )

Number of frequency bands.

Definition at line 68 of file panner_internal.h.

◆ PANNER_FRAME_SIZE

#define PANNER_FRAME_SIZE   ( 128 )

Framesize, in time-domain samples.

Definition at line 64 of file panner_internal.h.

◆ TIME_SLOTS

#define TIME_SLOTS   ( PANNER_FRAME_SIZE / HOP_SIZE )

Number of STFT timeslots.

Definition at line 69 of file panner_internal.h.

Function Documentation

◆ panner_initGainTables()

void panner_initGainTables ( void *const hPan)

Intialises the VBAP gain table used for panning.

Note
Call ambi_dec_initTFT() (if needed) before calling this function

Definition at line 58 of file panner_internal.c.

◆ panner_initTFT()

void panner_initTFT ( void *const hPan)

Initialise the filterbank used by panner.

Note
Call this function before panner_initGainTables()

Definition at line 99 of file panner_internal.c.

◆ panner_loadLoudspeakerPreset()

void panner_loadLoudspeakerPreset ( LOUDSPEAKER_ARRAY_PRESETS preset,
float dirs_deg[MAX_NUM_INPUTS][2],
int * newNCH,
int * nDims )

Loads source/loudspeaker directions from preset.

Parameters
[in]presetSee LOUDSPEAKER_ARRAY_PRESETS enum
[out]dirs_degSource/loudspeaker directions
[out]newNCH(&) new number of channels
[out]nDims(&) estimate of the number of dimensions (2 or 3)

Definition at line 326 of file panner_internal.c.

◆ panner_loadSourcePreset()

void panner_loadSourcePreset ( SOURCE_CONFIG_PRESETS preset,
float dirs_deg[MAX_NUM_INPUTS][2],
int * newNCH,
int * nDims )

Loads source directions from preset.

Parameters
[in]presetSee SOURCE_CONFIG_PRESETS enum
[out]dirs_degSource/loudspeaker directions
[out]newNCH(&) new number of channels
[out]nDims(&) estimate of the number of dimensions (2 or 3)

Definition at line 116 of file panner_internal.c.

◆ panner_setCodecStatus()

void panner_setCodecStatus ( void *const hPan,
CODEC_STATUS newStatus )

Sets codec status (see CODEC_STATUS enum)

Definition at line 47 of file panner_internal.c.