mirror of
https://github.com/aicodix/modem.git
synced 2026-04-27 14:30:34 +00:00
use bitman.hh
This commit is contained in:
parent
aa28a2e58d
commit
361779211c
2 changed files with 4 additions and 4 deletions
|
|
@ -15,6 +15,7 @@ namespace DSP { using std::abs; using std::min; using std::cos; using std::sin;
|
|||
#include "blockdc.hh"
|
||||
#include "hilbert.hh"
|
||||
#include "phasor.hh"
|
||||
#include "bitman.hh"
|
||||
#include "delay.hh"
|
||||
#include "sma.hh"
|
||||
#include "wav.hh"
|
||||
|
|
@ -334,9 +335,7 @@ struct Decoder
|
|||
Mod::hard(tmp, fdom[bin(i+data_off)] / head[bin(i+data_off)]);
|
||||
for (int k = 0; k < Mod::BITS; ++k) {
|
||||
int l = Mod::BITS * (data_cols * j + i) + k;
|
||||
if (l % 8 == 0)
|
||||
out[l/8] = 0;
|
||||
out[l/8] |= (tmp[k] < 0) << (l % 8);
|
||||
CODE::set_le_bit(out, l, tmp[k] < 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ Copyright 2021 Ahmet Inan <inan@aicodix.de>
|
|||
#include <cmath>
|
||||
#include "complex.hh"
|
||||
#include "utils.hh"
|
||||
#include "bitman.hh"
|
||||
#include "decibel.hh"
|
||||
#include "fft.hh"
|
||||
#include "wav.hh"
|
||||
|
|
@ -150,7 +151,7 @@ struct Encoder
|
|||
value tmp[Mod::BITS];
|
||||
for (int k = 0; k < Mod::BITS; ++k) {
|
||||
int l = Mod::BITS * (data_cols * j + i) + k;
|
||||
tmp[k] = 1 - 2 * ((inp[l/8] >> (l % 8)) & 1);
|
||||
tmp[k] = 1 - 2 * CODE::get_le_bit(inp, l);
|
||||
}
|
||||
fdom[bin(i+data_off)] *= Mod::map(tmp);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue