50 int i, j, n, N_azi, N_ele, nSH_order, order;
51 float scaleY, hfov, vfov, fi, aspectRatio;
52 float* Y_grid_N, *grid_x_axis, *grid_y_axis;
57 int geosphere_ico_freq = 9;
62 for(n=1; n<=order; n++){
63 nSH_order = (n+1)*(n+1);
64 scaleY = 1.0f/(float)nSH_order;
69 memcpy(pars->
Y_grid[n-1], Y_grid_N, nSH_order * (pars->
grid_nDirs)*
sizeof(
float));
71 for(i=0; i<nSH_order; i++)
86 N_ele = (int)((
float)pData->
dispWidth/aspectRatio + 0.5f);
87 grid_x_axis =
malloc1d(N_azi *
sizeof(
float));
88 grid_y_axis =
malloc1d(N_ele *
sizeof(
float));
89 vfov = hfov/aspectRatio;
90 for(fi = -hfov/2.0f, i = 0; i<N_azi; fi+=hfov/N_azi, i++)
92 for(fi = -vfov/2.0f, i = 0; i<N_ele; fi+=vfov/N_ele, i++)
96 for(i = 0; i<N_ele; i++){
97 for(j=0; j<N_azi; j++){
133 if(pData->
hSTFT==NULL)
135 else if(nSH!=new_nSH){
#define MAX_NUM_SH_SIGNALS
Maximum number of spherical harmonic components/signals supported.
CODEC_STATUS
Current status of the codec.
@ CODEC_STATUS_NOT_INITIALISED
Codec has not yet been initialised, or the codec configuration has changed.
@ CODEC_STATUS_INITIALISING
Codec is currently being initialised, input audio should not be processed.
@ ASPECT_RATIO_2_1
ASPECT_RATIO_2_1 - 2:1.
void afSTFT_clearBuffers(void *const hSTFT)
Flushes time-domain buffers with zeros.
void afSTFT_create(void **const phSTFT, int nCHin, int nCHout, int hopsize, int lowDelayMode, int hybridmode, AFSTFT_FDDATA_FORMAT format)
Creates an instance of afSTFT.
void afSTFT_channelChange(void *const hSTFT, int new_nCHin, int new_nCHout)
Re-allocates memory to support a change in the number of input/output channels.
@ AFSTFT_BANDS_CH_TIME
nBands x nChannels x nTimeHops
#define HOP_SIZE
STFT hop size.
#define HYBRID_BANDS
Number of frequency bands.
#define NUM_DISP_SLOTS
Number of display slots.
void getRSH(int N, float *dirs_deg, int nDirs, float *Y)
Computes real-valued spherical harmonics [1] for each given direction on the unit sphere.
const int __geosphere_ico_nPoints[17]
3LD geosphere number of points (freq = [0 0], [1 0],..., [16 0])
const float * __HANDLES_geosphere_ico_dirs_deg[17]
3LD geosphere HANDLES (freq = [0 0], [1 0],..., [16 0])
void utility_svsmul(float *a, const float *s, const int len, float *c)
Single-precision, multiplies each element in vector 'a' with a scalar 's', i.e.
void generateVBAPgainTable3D_srcs(float *src_dirs_deg, int S, float *ls_dirs_deg, int L, int omitLargeTriangles, int enableDummies, float spread, float **gtable, int *N_gtable, int *nTriangles)
Generates a 3-D VBAP [1] gain table based on specified source and loudspeaker directions,...
void VBAPgainTable2InterpTable(float *vbap_gtable, int nTable, int nDirs)
Renormalises a VBAP gain table (in-place) so it may be utilised for interpolation of data (for exampl...
void * malloc1d(size_t dim1_data_size)
1-D malloc (same as malloc, but with error checking)
void * calloc1d(size_t dim1, size_t data_size)
1-D calloc (same as calloc, but with error checking)
A sound-field visualiser, which utilises spherical harmonic signals as input; note this code is a rem...
void powermap_setCodecStatus(void *const hPm, CODEC_STATUS newStatus)
Sets codec status (see CODEC_STATUS enum)
void powermap_initTFT(void *const hPm)
Initialise the filterbank used by powermap.
void powermap_initAna(void *const hPm)
Intialises the codec variables, based on current global/user parameters.
A sound-field visualiser, which utilises spherical harmonic signals as input; note this code is a rem...
Contains variables for scanning grids, and beamforming.
float_complex * Y_grid_cmplx[MAX_SH_ORDER]
real SH basis (complex datatype); MAX_NUM_SH_SIGNALS x grid_nDirs
float * interp_dirs_deg
2D rectangular window interpolation directions, in degrees; FLAT: interp_nDirs x 2
float * interp_table
Spherical->2D interpolation table; FLAT: interp_nDirs x grid_nDirs.
int grid_nDirs
Number of scanning directions.
float * Y_grid[MAX_SH_ORDER]
real SH basis (real datatype); MAX_NUM_SH_SIGNALS x grid_nDirs
float * grid_dirs_deg
Spherical scanning grid directions, in degrees; FLAT: grid_nDirs x 2.
int interp_nTri
Number of triangles in the spherical triangulared grid.
int interp_nDirs
Number of interpolation directions.
Main structure for powermap.
powermap_codecPars * pars
codec parameters
int dispWidth
Number of pixels on the horizontal in the 2D interpolated powermap image.
float * prev_pmap
grid_nDirs x 1
int new_masterOrder
New maximum/master SH analysis order (current value will be replaced by this after next re-init)
HFOV_OPTIONS HFOVoption
see HFOV_OPTIONS
CODEC_STATUS codecStatus
see CODEC_STATUS
int masterOrder
Current maximum/master SH analysis order.
float * pmap
grid_nDirs x 1
ASPECT_RATIO_OPTIONS aspectRatioOption
see ASPECT_RATIO_OPTIONS
float_complex Cx[HYBRID_BANDS][MAX_NUM_SH_SIGNALS *MAX_NUM_SH_SIGNALS]
covariance matrices per band
float * pmap_grid[NUM_DISP_SLOTS]
powermap interpolated to grid; interp_nDirs x 1
void * hSTFT
afSTFT handle