nk
1.0.0
C++ Numerical Computing Runtime
Toggle main menu visibility
Loading...
Searching...
No Matches
quantizers.hpp
Go to the documentation of this file.
1
3
// toolboxes/signal/include/nk/signal/digital_filtering/quantizers.hpp
4
//
5
// Uniform-quantization helpers (Phase 4.2):
6
// uencode — float → integer (signed/unsigned, N bits, peak V)
7
// udecode — integer → float (saturate/wrap on overflow)
8
9
#pragma once
10
11
#include <memory_resource>
12
#include <nk/value/value.hpp>
13
14
namespace
nk::signal {
15
18
19
31
Value
uencode
(
const
Value
&u,
int
N,
double
V = 1.0,
32
bool
signedOutput =
false
,
33
std::pmr::memory_resource *mr =
nullptr
);
34
45
Value
udecode
(
const
Value
&u,
int
N,
double
V = 1.0,
46
bool
wrapOnOverflow =
false
,
47
std::pmr::memory_resource *mr =
nullptr
);
48
49
51
}
// namespace nk::signal
nk::Value
Core MATLAB-compatible multidimensional array and scalar value type.
Definition
value.hpp:61
nk::signal::udecode
Value udecode(const Value &u, int N, double V=1.0, bool wrapOnOverflow=false, std::pmr::memory_resource *mr=nullptr)
Decode integer data back to double with peak ±V (y = udecode(u, N, V, overflow)).
nk::signal::uencode
Value uencode(const Value &u, int N, double V=1.0, bool signedOutput=false, std::pmr::memory_resource *mr=nullptr)
Quantise and encode u as N-bit integers (y = uencode(u, N, V, type)).
src
toolboxes
signal
include
nk
signal
digital_filtering
quantizers.hpp
Generated by
1.17.0