I guess -1 isn't allowed for the output
[openal-soft.git] / Alc / nfcfilter.h
blob199849fbbe7b4b357fcbbac2acb2529978f6cd60
1 #ifndef NFCFILTER_H
2 #define NFCFILTER_H
4 #include "alMain.h"
6 typedef struct NfcFilter {
7 float g;
8 float coeffs[MAX_AMBI_ORDER*2 + 1];
9 float history[MAX_AMBI_ORDER];
10 } NfcFilter;
12 /* NOTE:
13 * w0 = speed_of_sound / (source_distance * sample_rate);
14 * w1 = speed_of_sound / (control_distance * sample_rate);
16 * Generally speaking, the control distance should be approximately the average
17 * speaker distance, or based on the reference delay if outputing NFC-HOA. It
18 * must not be negative, 0, or infinite. The source distance should not be too
19 * small relative to the control distance.
22 /* Near-field control filter for first-order ambisonic channels (1-3). */
23 void NfcFilterCreate1(NfcFilter *nfc, const float w0, const float w1);
24 void NfcFilterAdjust1(NfcFilter *nfc, const float w0);
25 void NfcFilterUpdate1(NfcFilter *nfc, float *restrict dst, const float *restrict src, const int count);
27 /* Near-field control filter for second-order ambisonic channels (4-8). */
28 void NfcFilterCreate2(NfcFilter *nfc, const float w0, const float w1);
29 void NfcFilterAdjust2(NfcFilter *nfc, const float w0);
30 void NfcFilterUpdate2(NfcFilter *nfc, float *restrict dst, const float *restrict src, const int count);
32 /* Near-field control filter for third-order ambisonic channels (9-15). */
33 void NfcFilterCreate3(NfcFilter *nfc, const float w0, const float w1);
34 void NfcFilterAdjust3(NfcFilter *nfc, const float w0);
35 void NfcFilterUpdate3(NfcFilter *nfc, float *restrict dst, const float *restrict src, const int count);
37 #endif /* NFCFILTER_H */