14 float base_gain
, gain
;
19 float base_gain
, gain
;
20 float b1
, b2
, b3
, a1
, a2
, a3
;
24 typedef struct NfcFilter
{
25 struct NfcFilter1 first
;
26 struct NfcFilter2 second
;
27 struct NfcFilter3 third
;
32 * w0 = speed_of_sound / (source_distance * sample_rate);
33 * w1 = speed_of_sound / (control_distance * sample_rate);
35 * Generally speaking, the control distance should be approximately the average
36 * speaker distance, or based on the reference delay if outputing NFC-HOA. It
37 * must not be negative, 0, or infinite. The source distance should not be too
38 * small relative to the control distance.
41 void NfcFilterCreate(NfcFilter
*nfc
, const float w0
, const float w1
);
42 void NfcFilterAdjust(NfcFilter
*nfc
, const float w0
);
44 /* Near-field control filter for first-order ambisonic channels (1-3). */
45 void NfcFilterProcess1(NfcFilter
*nfc
, float *RESTRICT dst
, const float *RESTRICT src
, const int count
);
47 /* Near-field control filter for second-order ambisonic channels (4-8). */
48 void NfcFilterProcess2(NfcFilter
*nfc
, float *RESTRICT dst
, const float *RESTRICT src
, const int count
);
50 /* Near-field control filter for third-order ambisonic channels (9-15). */
51 void NfcFilterProcess3(NfcFilter
*nfc
, float *RESTRICT dst
, const float *RESTRICT src
, const int count
);
57 #endif /* FILTER_NFC_H */