11 #ifndef SAL_DELAYFILTER_H
12 #define SAL_DELAYFILTER_H
14 #define DEFAULT_MAX_LATENCY 3276800
17 #include "digitalfilter.h"
44 virtual void Reset() noexcept;
56 mcl::Logger::GetInstance().
57 LogError(
"Trying to read at a delay tap (%d) larger than the maximum latency "
58 "of the delay line (%d). Giving back the value at the maximum "
72 void Read(
const Int num_samples,
Sample* output_data)
const noexcept;
77 mcl::Logger::GetInstance().
78 LogError(
"Trying to read at a delay tap (%f) larger than the maximum latency "
79 "of the delay line (%d). Giving back the value at the maximum "
81 fractional_delay_tap, max_latency_);
85 Time sanitised_delay_tap = std::min(fractional_delay_tap, (
Time) max_latency_);
86 Int x_a = (
Int) sanitised_delay_tap;
90 return (f_x_b-f_x_a)/(x_b-x_a)*(sanitised_delay_tap-x_a)+f_x_a;
94 inline void Tick() noexcept {
101 void Tick(
const Int num_samples) noexcept;
110 Int latency() const noexcept;
113 Int max_latency() const noexcept;
116 DelayFilter (const DelayFilter&);
118 virtual mcl::Real
Filter(const mcl::Real input) noexcept;