Rename NfcFilterUpdate* to NfcFilterProcess* for consistency
[openal-soft.git] / Alc / filters / nfc.h
blob8c6cc6aebcb3a0fc552124976bcf1cbca814f05f
1 #ifndef FILTER_NFC_H
2 #define FILTER_NFC_H
4 struct NfcFilter1 {
5 float g;
6 float coeffs[1*2 + 1];
7 float history[1];
8 };
9 struct NfcFilter2 {
10 float g;
11 float coeffs[2*2 + 1];
12 float history[2];
14 struct NfcFilter3 {
15 float g;
16 float coeffs[3*2 + 1];
17 float history[3];
20 typedef struct NfcFilter {
21 struct NfcFilter1 first;
22 struct NfcFilter2 second;
23 struct NfcFilter3 third;
24 } NfcFilter;
27 /* NOTE:
28 * w0 = speed_of_sound / (source_distance * sample_rate);
29 * w1 = speed_of_sound / (control_distance * sample_rate);
31 * Generally speaking, the control distance should be approximately the average
32 * speaker distance, or based on the reference delay if outputing NFC-HOA. It
33 * must not be negative, 0, or infinite. The source distance should not be too
34 * small relative to the control distance.
37 void NfcFilterCreate(NfcFilter *nfc, const float w0, const float w1);
38 void NfcFilterAdjust(NfcFilter *nfc, const float w0);
40 /* Near-field control filter for first-order ambisonic channels (1-3). */
41 void NfcFilterProcess1(NfcFilter *nfc, float *restrict dst, const float *restrict src, const int count);
43 /* Near-field control filter for second-order ambisonic channels (4-8). */
44 void NfcFilterProcess2(NfcFilter *nfc, float *restrict dst, const float *restrict src, const int count);
46 /* Near-field control filter for third-order ambisonic channels (9-15). */
47 void NfcFilterProcess3(NfcFilter *nfc, float *restrict dst, const float *restrict src, const int count);
49 #endif /* FILTER_NFC_H */