mirror of
https://github.com/aicodix/modem.git
synced 2026-04-27 14:30:34 +00:00
added clamp lambda
This commit is contained in:
parent
68e0e81593
commit
02c7e6d3f2
1 changed files with 2 additions and 1 deletions
|
|
@ -117,8 +117,9 @@ struct Encoder
|
|||
clipping_and_filtering(scale, oper_mode > 25 && papr_reduction);
|
||||
if (oper_mode > 25 && papr_reduction)
|
||||
tone_reservation();
|
||||
auto clamp = [](value v){ return v < value(-1) ? value(-1) : v > value(1) ? value(1) : v; };
|
||||
for (int i = 0; i < symbol_len; ++i)
|
||||
tdom[i] = cmplx(std::min(value(1), tdom[i].real()), std::min(value(1), tdom[i].imag()));
|
||||
tdom[i] = cmplx(clamp(tdom[i].real()), clamp(tdom[i].imag()));
|
||||
for (int i = 0; i < guard_len; ++i) {
|
||||
value x = value(i) / value(guard_len - 1);
|
||||
value ratio(0.5);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue