Skip to content

convolution

autocorrelate function

template <typename T, univector_tag Tag1>
univector<T> autocorrelate(const univector<T, Tag1> &src)

Auto-correlation

Source code
template <typename T, univector_tag Tag1>
univector<T> autocorrelate(const univector<T, Tag1>& src)
{
    return intrinsics::autocorrelate(src.slice());
}

https://github.com/kfrlib/kfr/blob//include/kfr/dft/convolution.hpp#L74

convolve function

template <typename T, univector_tag Tag1,
          univector_tag Tag2>
univector<T> convolve(const univector<T, Tag1> &src1,
                      const univector<T, Tag2> &src2)

Convolution

Source code
template <typename T, univector_tag Tag1, univector_tag Tag2>
univector<T> convolve(const univector<T, Tag1>& src1, const univector<T, Tag2>& src2)
{
    return intrinsics::convolve(src1.slice(), src2.slice());
}

https://github.com/kfrlib/kfr/blob//include/kfr/dft/convolution.hpp#L60

convolve_filter

convolve_filter class

template <typename T> convolve_filter

Convolution using Filter API

Source code
template <typename T>
class convolve_filter : public filter<T>
{
public:
    explicit convolve_filter(size_t size, size_t block_size = 1024);
    explicit convolve_filter(const univector<T>& data, size_t block_size = 1024);
    void set_data(const univector<T>& data);

protected:
    void process_expression(T* dest, const expression_pointer<T>& src, size_t size) final
    {
        univector<T> input = truncate(src, size);
        process_buffer(dest, input.data(), input.size());
    }
    void process_buffer(T* output, const T* input, size_t size) final;

    const size_t size;
    const size_t block_size;
    const dft_plan_real<T> fft;
    univector<u8> temp;
    std::vector<univector<complex<T>>> segments;
    std::vector<univector<complex<T>>> ir_segments;
    size_t input_position;
    univector<T> saved_input;
    univector<complex<T>> premul;
    univector<complex<T>> cscratch;
    univector<T> scratch;
    univector<T> overlap;
    size_t position;
}

https://github.com/kfrlib/kfr/blob//include/kfr/dft/convolution.hpp#L81

correlate function

template <typename T, univector_tag Tag1,
          univector_tag Tag2>
univector<T> correlate(const univector<T, Tag1> &src1,
                       const univector<T, Tag2> &src2)

Correlation

Source code
template <typename T, univector_tag Tag1, univector_tag Tag2>
univector<T> correlate(const univector<T, Tag1>& src1, const univector<T, Tag2>& src2)
{
    return intrinsics::correlate(src1.slice(), src2.slice());
}

https://github.com/kfrlib/kfr/blob//include/kfr/dft/convolution.hpp#L67


Auto-generated from sources, Revision , https://github.com/kfrlib/kfr/blob//include/kfr/