Loading...
Searching...
No Matches
rowtimeblockencoder.h
Go to the documentation of this file.
#ifndef DYSCO_ROW_TIME_BLOCK_ENCODER_H
#define DYSCO_ROW_TIME_BLOCK_ENCODER_H
#include "stochasticencoder.h"
#include "timeblockbuffer.h"
#include "uvector.h"
#include <complex>
#include <random>
#include <vector>
#include "timeblockencoder.h"
class RowTimeBlockEncoder : public TimeBlockEncoder {
public:
RowTimeBlockEncoder(size_t nPol, size_t nChannels);
virtual ~RowTimeBlockEncoder() override {}
virtual void EncodeWithDithering(
const dyscostman::StochasticEncoder<float> &gausEncoder, FBuffer &buffer,
float *metaBuffer, symbol_t *symbolBuffer, size_t antennaCount,
std::mt19937 &rnd) final override {
encode<true>(gausEncoder, buffer, metaBuffer, symbolBuffer, antennaCount,
&rnd);
}
virtual void EncodeWithoutDithering(
const dyscostman::StochasticEncoder<float> &gausEncoder, FBuffer &buffer,
float *metaBuffer, symbol_t *symbolBuffer,
size_t antennaCount) final override {
encode<false>(gausEncoder, buffer, metaBuffer, symbolBuffer, antennaCount,
0);
}
virtual void InitializeDecode(const float *metaBuffer, size_t nRow,
size_t nAntennae) 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;
virtual size_t SymbolCount(size_t nRow, size_t nPol,
size_t nChannels) const final override {
return nRow * nChannels * nPol * 2 /*complex*/;
}
virtual size_t SymbolCount(size_t nRow) const final override {
return nRow * _nChannels * _nPol * 2 /*complex*/;
}
virtual size_t SymbolsPerRow() const final override {
return _nChannels * _nPol * 2 /*complex*/;
}
virtual size_t MetaDataCount(size_t nRow, size_t /*nPol*/,
size_t /*nChannels*/,
size_t /*nAntennae*/) const final override {
return nRow;
}
private:
template <bool UseDithering>
void encode(const dyscostman::StochasticEncoder<float> &gausEncoder,
const FBuffer &buffer, float *metaBuffer, symbol_t *symbolBuffer,
size_t antennaCount, std::mt19937 *rnd);
size_t _nPol, _nChannels;
std::uniform_int_distribution<unsigned> _ditherDist;
ao::uvector<double> _rowFactors;
};
#endif
RowTimeBlockEncoder::_nPol
size_t _nPol
Definition rowtimeblockencoder.h:69
RowTimeBlockEncoder::SymbolCount
virtual size_t SymbolCount(size_t nRow) const final override
Definition rowtimeblockencoder.h:49
RowTimeBlockEncoder::RowTimeBlockEncoder
RowTimeBlockEncoder(size_t nPol, size_t nChannels)
RowTimeBlockEncoder::Decode
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
RowTimeBlockEncoder::InitializeDecode
virtual void InitializeDecode(const float *metaBuffer, size_t nRow, size_t nAntennae) final override
RowTimeBlockEncoder::EncodeWithDithering
virtual void EncodeWithDithering(const dyscostman::StochasticEncoder< float > &gausEncoder, FBuffer &buffer, float *metaBuffer, symbol_t *symbolBuffer, size_t antennaCount, std::mt19937 &rnd) final override
Definition rowtimeblockencoder.h:20
RowTimeBlockEncoder::_rowFactors
ao::uvector< double > _rowFactors
Definition rowtimeblockencoder.h:72
RowTimeBlockEncoder::MetaDataCount
virtual size_t MetaDataCount(size_t nRow, size_t, size_t, size_t) const final override
Definition rowtimeblockencoder.h:57
RowTimeBlockEncoder::SymbolCount
virtual size_t SymbolCount(size_t nRow, size_t nPol, size_t nChannels) const final override
Definition rowtimeblockencoder.h:44
RowTimeBlockEncoder::EncodeWithoutDithering
virtual void EncodeWithoutDithering(const dyscostman::StochasticEncoder< float > &gausEncoder, FBuffer &buffer, float *metaBuffer, symbol_t *symbolBuffer, size_t antennaCount) final override
Definition rowtimeblockencoder.h:28
RowTimeBlockEncoder::~RowTimeBlockEncoder
virtual ~RowTimeBlockEncoder() override
Definition rowtimeblockencoder.h:18
RowTimeBlockEncoder::SymbolsPerRow
virtual size_t SymbolsPerRow() const final override
Definition rowtimeblockencoder.h:53
RowTimeBlockEncoder::encode
void encode(const dyscostman::StochasticEncoder< float > &gausEncoder, const FBuffer &buffer, float *metaBuffer, symbol_t *symbolBuffer, size_t antennaCount, std::mt19937 *rnd)
RowTimeBlockEncoder::_nChannels
size_t _nChannels
Definition rowtimeblockencoder.h:69
RowTimeBlockEncoder::_ditherDist
std::uniform_int_distribution< unsigned > _ditherDist
Definition rowtimeblockencoder.h:71
TimeBlockEncoder::FBuffer
TimeBlockBuffer< std::complex< float > > FBuffer
Definition timeblockencoder.h:36
TimeBlockEncoder::symbol_t
unsigned symbol_t
Definition timeblockencoder.h:41
TimeBlockEncoder::TimeBlockEncoder
TimeBlockEncoder()
Definition timeblockencoder.h:72
ao::uvector
A container similar to std::vector, but one that allows construction without initializing its element...
Definition uvector.h:74
dyscostman::StochasticEncoder
Lossy encoder for stochastic values.
Definition stochasticencoder.h:32
stochasticencoder.h
timeblockbuffer.h
timeblockencoder.h
uvector.h
Header file for uvector and its relational and swap functions.