1 #ifndef DYSCO_AFTIME_BLOCK_ENCODER_H
2 #define DYSCO_AFTIME_BLOCK_ENCODER_H
22 float *metaBuffer,
symbol_t *symbolBuffer,
size_t antennaCount,
23 std::mt19937 &rnd)
final override {
24 encode<true>(gausEncoder, buffer, metaBuffer, symbolBuffer, antennaCount,
30 float *metaBuffer,
symbol_t *symbolBuffer,
31 size_t antennaCount)
final override {
32 encode<false>(gausEncoder, buffer, metaBuffer, symbolBuffer, antennaCount,
37 size_t nAntennae)
final override;
41 size_t blockRow,
size_t antenna1,
42 size_t antenna2)
final override;
45 size_t nChannels)
const final override {
46 return nRow * nChannels * nPol * 2 ;
49 virtual size_t SymbolCount(
size_t nRow)
const final override {
58 size_t nAntennae)
const final override {
59 return nPol * (nChannels + nAntennae);
68 size_t polIndex,
size_t antennaCount);
70 template <
bool UseDithering>
73 size_t antennaCount, std::mt19937 *rnd);
76 size_t antennaIndex,
size_t antennaCount,
77 size_t polIndex,
double factor);
79 size_t visIndex,
double factor);
81 void fitToMaximum(std::vector<DBufferRow> &data,
float *metaBuffer,
std::uniform_int_distribution< unsigned > _ditherDist
AFTimeBlockEncoder(size_t nPol, size_t nChannels, bool fitToMaximum)
ao::uvector< double > _rmsPerChannel
virtual ~AFTimeBlockEncoder() override
virtual void EncodeWithDithering(const dyscostman::StochasticEncoder< float > &gausEncoder, FBuffer &buffer, float *metaBuffer, symbol_t *symbolBuffer, size_t antennaCount, std::mt19937 &rnd) final override
virtual size_t SymbolCount(size_t nRow, size_t nPol, size_t nChannels) const final override
void encode(const dyscostman::StochasticEncoder< float > &gausEncoder, const FBuffer &buffer, float *metaBuffer, symbol_t *symbolBuffer, size_t antennaCount, std::mt19937 *rnd)
virtual size_t SymbolsPerRow() const final override
virtual size_t MetaDataCount(size_t, size_t nPol, size_t nChannels, size_t nAntennae) const final override
ao::uvector< double > _rmsPerAntenna
virtual size_t SymbolCount(size_t nRow) const final override
void fitToMaximum(std::vector< DBufferRow > &data, float *metaBuffer, const dyscostman::StochasticEncoder< float > &gausEncoder, size_t antennaCount)
void changeAntennaFactor(std::vector< DBufferRow > &data, float *metaBuffer, size_t antennaIndex, size_t antennaCount, size_t polIndex, double factor)
void Normalize(const dyscostman::StochasticEncoder< float > &gausEncoder, TimeBlockBuffer< std::complex< float >> &buffer, size_t antennaCount)
void calculateAntennaeRMS(const std::vector< DBufferRow > &data, size_t polIndex, size_t antennaCount)
void changeChannelFactor(std::vector< DBufferRow > &data, float *metaBuffer, size_t visIndex, double factor)
virtual void InitializeDecode(const float *metaBuffer, size_t nRow, size_t nAntennae) final override
virtual void EncodeWithoutDithering(const dyscostman::StochasticEncoder< float > &gausEncoder, FBuffer &buffer, float *metaBuffer, symbol_t *symbolBuffer, size_t antennaCount) final override
virtual void Decode(const dyscostman::StochasticEncoder< float > &gausEncoder, FBuffer &buffer, const symbol_t *symbolBuffer, size_t blockRow, size_t antenna1, size_t antenna2) final override
Lossy encoder for stochastic values.
Header file for uvector and its relational and swap functions.