nk
1.0.0
C++ Numerical Computing Runtime
Toggle main menu visibility
Loading...
Searching...
No Matches
signal/include/nk/signal/convolution/extras.hpp
Go to the documentation of this file.
1
3
// toolboxes/signal/include/nk/signal/convolution/extras.hpp
4
//
5
// Convolution / correlation extras (E1):
6
// cconv(x, y[, n]) — circular convolution
7
// convmtx(h, n) — convolution matrix
8
// xcorr2(A, B) — 2-D cross-correlation
9
// finddelay(x, y[, max]) — lag of max(xcorr(x, y))
10
// alignsignals(x, y[, max]) — align two signals by zero-padding
11
12
#pragma once
13
14
#include <memory_resource>
15
#include <nk/value/value.hpp>
16
17
#include <tuple>
18
19
namespace
nk::signal {
20
23
24
42
Value
cconv
(
const
Value
& x,
43
const
Value
& y,
44
size_t
n = 0,
45
std::pmr::memory_resource * mr =
nullptr
);
46
62
Value
convmtx
(
const
Value
& h,
63
size_t
n,
64
std::pmr::memory_resource * mr =
nullptr
);
65
77
Value
xcorr2
(
const
Value
& A,
78
const
Value
& B,
79
std::pmr::memory_resource * mr =
nullptr
);
80
93
long
finddelay
(
const
Value
& x,
94
const
Value
& y,
95
long
max_lag = 0,
96
std::pmr::memory_resource * mr =
nullptr
);
97
109
std::tuple<Value, Value>
110
alignsignals
(
const
Value
& x,
111
const
Value
& y,
112
long
max_lag = 0,
113
std::pmr::memory_resource * mr =
nullptr
);
114
115
117
}
// namespace nk::signal
nk::Value
Core MATLAB-compatible multidimensional array and scalar value type.
Definition
value.hpp:61
nk::signal::alignsignals
std::tuple< Value, Value > alignsignals(const Value &x, const Value &y, long max_lag=0, std::pmr::memory_resource *mr=nullptr)
Align two signals by zero-padding the leading one.
nk::signal::cconv
Value cconv(const Value &x, const Value &y, size_t n=0, std::pmr::memory_resource *mr=nullptr)
Circular (cyclic) convolution of two real vectors.
nk::signal::convmtx
Value convmtx(const Value &h, size_t n, std::pmr::memory_resource *mr=nullptr)
Convolution matrix for an impulse response.
nk::signal::finddelay
long finddelay(const Value &x, const Value &y, long max_lag=0, std::pmr::memory_resource *mr=nullptr)
Estimate the integer delay between two signals.
nk::signal::xcorr2
Value xcorr2(const Value &A, const Value &B, std::pmr::memory_resource *mr=nullptr)
2-D cross-correlation of two real matrices.
src
toolboxes
signal
include
nk
signal
convolution
extras.hpp
Generated by
1.17.0