nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
multilevel.hpp
Go to the documentation of this file.
1
3// toolboxes/wavelet/include/nk/wavelet/dwt/multilevel.hpp
4//
5// Multi-level discrete wavelet transform: wavedec / waverec, plus the
6// appcoef / detcoef extractors that index into the (C, L) bookkeeping
7// vectors.
8
9#pragma once
10
11#include <memory_resource>
12#include <nk/value/value.hpp>
13#include <string>
14#include <utility>
15
16namespace nk::wavelet {
17
20
21
45std::pair<Value, Value>
46wavedec(const Value &x, int n, const std::string &wname,
47 std::pmr::memory_resource *mr = nullptr);
48
62Value waverec(const Value &C, const Value &L, const std::string &wname,
63 std::pmr::memory_resource *mr = nullptr);
64
82Value appcoef(const Value &C, const Value &L, const std::string &wname,
83 int level,
84 std::pmr::memory_resource *mr = nullptr);
85
103 const std::vector<double> &Lo_R,
104 const std::vector<double> &Hi_R,
105 int level,
106 std::pmr::memory_resource *mr = nullptr);
107
125Value detcoef(const Value &C, const Value &L, int level,
126 std::pmr::memory_resource *mr = nullptr);
127
153Value wrcoef(const std::string &type, const Value &c, const Value &l,
154 const std::string &wname, int n,
155 std::pmr::memory_resource *mr = nullptr);
156
162
178WenergyResult wenergy(const Value &C, const Value &L,
179 std::pmr::memory_resource *mr = nullptr);
180
201Value upcoef(const std::string &type, const Value &X, const std::string &wname,
202 int n, long long len = -1, std::pmr::memory_resource *mr = nullptr);
203
204
206} // namespace nk::wavelet
Core MATLAB-compatible multidimensional array and scalar value type.
Definition value.hpp:61
Value appcoef(const Value &C, const Value &L, const std::string &wname, int level, std::pmr::memory_resource *mr=nullptr)
Extract approximation coefficients at a given level (appcoef).
Value wrcoef(const std::string &type, const Value &c, const Value &l, const std::string &wname, int n, std::pmr::memory_resource *mr=nullptr)
Single-band reconstruction (wrcoef(type, c, l, wname, n)).
WenergyResult wenergy(const Value &C, const Value &L, std::pmr::memory_resource *mr=nullptr)
Percentage of energy in the approximation and detail bands ([Ea, Ed] = wenergy(C, L)).
Value waverec(const Value &C, const Value &L, const std::string &wname, std::pmr::memory_resource *mr=nullptr)
Inverse of wavedec.
Value appcoef_with_filters_pub(const Value &C, const Value &L, const std::vector< double > &Lo_R, const std::vector< double > &Hi_R, int level, std::pmr::memory_resource *mr=nullptr)
Internal entry: appcoef with explicit synthesis filters.
Value detcoef(const Value &C, const Value &L, int level, std::pmr::memory_resource *mr=nullptr)
Extract detail coefficients at a given level (detcoef(C, L, level)).
Value upcoef(const std::string &type, const Value &X, const std::string &wname, int n, long long len=-1, std::pmr::memory_resource *mr=nullptr)
Direct reconstruction of a single coefficient branch (Y = upcoef(O, X,wname, N[, L])).
std::pair< Value, Value > wavedec(const Value &x, int n, const std::string &wname, std::pmr::memory_resource *mr=nullptr)
Multi-level 1-D DWT ([C, L] = wavedec(x, n, wname)).
Energy distribution of a wavelet decomposition.
Value Ea
Percent of energy in the approximation (scalar).
Value Ed
Percent of energy in each detail band (row, level N→1).