SAF
Loading...
Searching...
No Matches
binauraliser_nf_internal.c
Go to the documentation of this file.
1/*
2 * Copyright 2022 Michael McCrea, Leo McCormack
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 * PERFORMANCE OF THIS SOFTWARE.
15 */
16
40
42(
43 void* const hBin
44)
45{
47
48 if(pData->hSTFT==NULL)
50 else if(pData->new_nSources!=pData->nSources){
53 }
54 pData->nSources = pData->new_nSources;
55}
56
58{
60
61 for(int i=0; i<MAX_NUM_INPUTS; i++)
62 pData->src_dists_m[i] = pData->farfield_thresh_m * pData->farfield_headroom;
63}
64
65
66
67
68
69
70
71
#define MAX_NUM_INPUTS
Maximum number of input channels supported.
Definition _common.h:233
void afSTFT_clearBuffers(void *const hSTFT)
Flushes time-domain buffers with zeros.
Definition afSTFTlib.c:519
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.
Definition afSTFTlib.c:143
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.
Definition afSTFTlib.c:477
@ AFSTFT_BANDS_CH_TIME
nBands x nChannels x nTimeHops
Definition afSTFTlib.h:80
#define HOP_SIZE
STFT hop size.
void binauraliserNF_initTFT(void *const hBin)
Initialise the filterbank used by binauraliserNF.
void binauraliserNF_resetSourceDistances(void *const hBin)
Resets the source distances to the default far field distance.
Convolves input audio (up to 64 channels) with interpolated HRTFs in the time-frequency domain,...
#define NUM_EARS
2 (true for most humans)
Main structure for binauraliserNF.
float farfield_thresh_m
Distance considered to be far field (no near field filtering), meters.
float farfield_headroom
Scale factor applied to farfield_thresh_m when resetting to the far field, and for UI range,...
int nSources
Current number of input/source signals.
int new_nSources
New number of input/source signals (current value will be replaced by this after next re-init)
float src_dists_m[MAX_NUM_INPUTS]
Source distance, meters.