6 typedef struct NfcFilter
{
8 float coeffs
[MAX_AMBI_ORDER
*2 + 1];
9 float history
[MAX_AMBI_ORDER
];
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 */