sablib
Loading...
Searching...
No Matches
convolve.h File Reference

Python's NumPy-like convolve() function. More...

#include <algorithm>
#include <Eigen/Eigen>

Go to the source code of this file.

Enumerations

enum class  sablib::ConvolveMode { Full , Same , Valid }
 Mode of Convolve() function. More...

Functions

template<typename Derived1, typename Derived2>
const Derived1::PlainObject sablib::Convolve (const Eigen::MatrixBase< Derived1 > &v1, const Eigen::MatrixBase< Derived2 > &v2, const ConvolveMode mode=ConvolveMode::Full)
 Returns the discrete, linear convolution of two one-dimensional sequences.

Detailed Description

Python's NumPy-like convolve() function.

Author
Izadori

Definition in file convolve.h.

Enumeration Type Documentation

◆ ConvolveMode

enum class sablib::ConvolveMode
strong

Mode of Convolve() function.

Enumerator
Full 

This returns the convolution at each point of overlap, with an output shape of N + M - 1.

Same 

This returns output of length max(M, N).

Valid 

This returns output of length max(M, N) - min(M, N) + 1. The convolution product is only given for points where the signals overlap completely.

Definition at line 18 of file convolve.h.

Function Documentation

◆ Convolve()

template<typename Derived1, typename Derived2>
const Derived1::PlainObject sablib::Convolve ( const Eigen::MatrixBase< Derived1 > & v1,
const Eigen::MatrixBase< Derived2 > & v2,
const ConvolveMode mode = ConvolveMode::Full )

Returns the discrete, linear convolution of two one-dimensional sequences.

Parameters
v1First one-dimensional input array.
v2Second one-dimensional input array.
modeThe mode of the convolution (default is Full).
Returns
The convolved one-dimensional sequence.

Definition at line 35 of file convolve.h.