11 #ifndef SAL_PROPAGATIONLINE_H
12 #define SAL_PROPAGATIONLINE_H
15 #include "iirfilter.h"
17 #include "firfilter.h"
48 const bool air_filters_active =
false,
49 const bool allow_attenuation_larger_than_one =
false,
59 const sal::Time ramp_time = 0.0) noexcept;
75 if (interpolation_type_ == sal::InterpolationType::kLinear) {
76 return delay_filter_.
FractionalReadAt(current_latency_) * current_attenuation_;
78 return delay_filter_.
ReadAt(mcl::RoundToInt(current_latency_)) * current_attenuation_;
85 void Read(
const Int num_samples,
Sample* output_data)
const noexcept;
90 void Tick(const
Int num_samples) noexcept;
99 const sal::
Time ramp_time = 0.0) noexcept;
102 void Reset() noexcept;
108 sal::
Time sampling_frequency_;
110 sal::
Length reference_distance_;
113 sal::
Sample current_attenuation_;
114 sal::
Time current_latency_;
115 bool air_filters_active_;
116 mcl::FirFilter air_filter_;
121 void Update() noexcept;
122 sal::
Time ComputeLatency(const sal::
Length) noexcept;
123 sal::
Sample ComputeAttenuation(const sal::
Length) noexcept;
125 static std::vector<sal::
Sample> GetAirFilter(sal::
Length distance) noexcept;