3 #include "frequency_domain/buffer.h" 22 template <
typename T,
typename U>
23 auto convolve(
const T& a,
const U& b) {
26 return convolve(begin(a), end(a), begin(b), end(b));
29 template <
typename It,
typename Jt>
30 auto convolve(It a_begin, It a_end, Jt b_begin, Jt b_end) {
31 const auto d0 = std::distance(a_begin, a_end);
32 const auto d1 = std::distance(b_begin, b_end);
33 if (d0 + d1 - 1 != get_fft_length()) {
34 throw std::runtime_error{
"Inputs must sum to FFT_LENGTH + 1."};
38 std::copy(a_begin, a_end, r2c_i_.begin());
42 std::copy(b_begin, b_end, r2c_i_.begin());
45 return convolve_impl();
48 size_t get_fft_length()
const;
53 std::vector<float> convolve_impl();
58 std::unique_ptr<impl> pimpl_;
Definition: convolver.h:11
Definition: convolver.cpp:7