ggwave : compute Tx amplitudes always

This commit is contained in:
Georgi Gerganov
2022-05-29 17:55:29 +03:00
parent 9d9189f081
commit f6378c7b09
2 changed files with 23 additions and 39 deletions

View File

@@ -333,16 +333,6 @@ public:
int bytesPerTx; // number of bytes in a chunk of data
int nDataBitsPerTx() const { return 8*bytesPerTx; }
bool operator==(const TxProtocol & other) const {
return freqStart == other.freqStart &&
framesPerTx == other.framesPerTx &&
bytesPerTx == other.bytesPerTx;
}
bool operator!=(const TxProtocol & other) const {
return !(*this == other);
}
};
using RxProtocol = TxProtocol;

View File

@@ -410,7 +410,6 @@ struct GGWave::Tx {
TxRxData txData;
TxProtocol txProtocol;
TxProtocol txProtocolLast;
AmplitudeData outputBlock;
AmplitudeData outputBlockResampled;
@@ -543,8 +542,6 @@ GGWave::GGWave(const Parameters & parameters) :
if (m_isTxEnabled) {
m_tx = std::unique_ptr<Tx>(new Tx());
m_tx->txProtocolLast = {};
{
const int maxDataBits = 2*16*maxBytesPerTx();
@@ -703,7 +700,6 @@ bool GGWave::encode(const CBWaveformOut & cbWaveformOut) {
m_resampler->reset();
}
if (m_tx->txProtocol != m_tx->txProtocolLast) {
for (int k = 0; k < (int) m_tx->phaseOffsets.size(); ++k) {
m_tx->phaseOffsets[k] = (M_PI*k)/(m_tx->txProtocol.nDataBitsPerTx());
}
@@ -731,8 +727,6 @@ bool GGWave::encode(const CBWaveformOut & cbWaveformOut) {
m_tx->bit0Amplitude[k][i] = std::sin((2.0*M_PI)*(curi*m_isamplesPerFrame)*((freq + m_hzPerSample*m_freqDelta_bin)*curIHzPerSample) + phaseOffset);
}
}
}
m_tx->txProtocolLast = m_tx->txProtocol;
const int nECCBytesPerTx = getECCBytesForLength(m_tx->txDataLength);
const int sendDataLength = m_tx->txDataLength + m_encodedDataOffset;