SAF
Loading...
Searching...
No Matches
saf_utility_dvf.h
Go to the documentation of this file.
1/*
2* Copyright 2020-2021 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
33#ifndef SAF_DVF_H_INCLUDED
34#define SAF_DVF_H_INCLUDED
35
36#ifdef __cplusplus
37extern "C" {
38#endif /* __cplusplus */
39
40#include <stdio.h>
41#include <math.h>
42
62void calcDVFCoeffs(
63 /* Input Arguments */
64 float alpha,
65 float rho,
66 float fs,
67 /* Output Arguments */
68 float * b,
69 float * a);
70
83 /* Input Arguments */
84 float theta,
85 float rho,
86 /* Output Arguments */
87 float* iG0,
88 float* iGInf,
89 float* iFc);
90
102void dvfShelfCoeffs(/* Input Arguments */
103 float g0,
104 float gInf,
105 float fc,
106 float fs,
107 /* Output Arguments */
108 float* b0,
109 float* b1,
110 float* a1);
111
124void calcDVFShelfParams(int i,
125 float rho,
126 float* g0,
127 float* gInf,
128 float* fc);
129
149void doaToIpsiInteraural(float azimuth,
150 float elevation,
151 float* alphaLR,
152 float* betaLR);
153
154#ifdef __cplusplus
155}/* extern "C" */
156#endif /* __cplusplus */
157
158#endif /* SAF_DVF_H_INCLUDED */
void doaToIpsiInteraural(float azimuth, float elevation, float *alphaLR, float *betaLR)
Convert a frontal azimuth/elevation to a modified Interaural-Polar coordinate.
void interpDVFShelfParams(float theta, float rho, float *iG0, float *iGInf, float *iFc)
Calculate the shelving filter parameters for the Distance Variation Function filter from the source (...
void dvfShelfCoeffs(float g0, float gInf, float fc, float fs, float *b0, float *b1, float *a1)
Calculate the DVF filter coefficients from shelving filter parameters.
void calcDVFCoeffs(float alpha, float rho, float fs, float *b, float *a)
Calculate the Distance Variation Function (DVF) filter coefficients, as described in [1].
void calcDVFShelfParams(int i, float rho, float *g0, float *gInf, float *fc)
Calculate the high shelf gains and cutoff parameters, given a azimuth index i and distance rho.