1 #ifndef CORE_FILTERS_NFC_H
2 #define CORE_FILTERS_NFC_H
10 float base_gain, gain;
15 float base_gain, gain;
20 float base_gain, gain;
21 float b1, b2, b3, a1, a2, a3;
25 float base_gain, gain;
26 float b1, b2, b3, b4, a1, a2, a3, a4;
38 * w0 = speed_of_sound / (source_distance * sample_rate);
39 * w1 = speed_of_sound / (control_distance * sample_rate);
41 * Generally speaking, the control distance should be approximately the
42 * average speaker distance, or based on the reference delay if outputing
43 * NFC-HOA. It must not be negative, 0, or infinite. The source distance
44 * should not be too small relative to the control distance.
47 void init(const float w1) noexcept;
48 void adjust(const float w0) noexcept;
50 /* Near-field control filter for first-order ambisonic channels (1-3). */
51 void process1(const al::span<const float> src, float *RESTRICT dst);
53 /* Near-field control filter for second-order ambisonic channels (4-8). */
54 void process2(const al::span<const float> src, float *RESTRICT dst);
56 /* Near-field control filter for third-order ambisonic channels (9-15). */
57 void process3(const al::span<const float> src, float *RESTRICT dst);
59 /* Near-field control filter for fourth-order ambisonic channels (16-24). */
60 void process4(const al::span<const float> src, float *RESTRICT dst);
63 #endif /* CORE_FILTERS_NFC_H */