Simplify the pre-emphasis code for AX.25.

This commit is contained in:
Jonathan Naylor 2020-06-29 15:59:46 +01:00
parent a73376671c
commit 43f84ae968
3 changed files with 12 additions and 13 deletions

View File

@ -49,7 +49,6 @@ const q15_t AUDIO_TABLE_DATA[] = {
};
CAX25TX::CAX25TX() :
m_twist(-6),
m_poBuffer(),
m_poLen(0U),
m_poPtr(0U),
@ -138,22 +137,25 @@ uint8_t CAX25TX::writeData(const uint8_t* data, uint16_t length)
void CAX25TX::writeBit(bool b)
{
q15_t in[AX25_RADIO_SYMBOL_LENGTH];
q15_t buffer[AX25_RADIO_SYMBOL_LENGTH];
for (uint8_t i = 0U; i < AX25_RADIO_SYMBOL_LENGTH; i++) {
in[i] = AUDIO_TABLE_DATA[m_tablePtr];
if (b)
q15_t value = AUDIO_TABLE_DATA[m_tablePtr];
if (b) {
m_tablePtr += 11U;
else
} else {
// De-emphasise the lower frequency by 6dB
value >>= 2;
m_tablePtr += 6U;
}
buffer[i] = value;
if (m_tablePtr >= AUDIO_TABLE_LEN)
m_tablePtr -= AUDIO_TABLE_LEN;
}
q15_t out[AX25_RADIO_SYMBOL_LENGTH];
m_twist.process(in, out, AX25_RADIO_SYMBOL_LENGTH);
io.write(STATE_AX25, out, AX25_RADIO_SYMBOL_LENGTH);
io.write(STATE_AX25, buffer, AX25_RADIO_SYMBOL_LENGTH);
}
void CAX25TX::setTXDelay(uint8_t delay)

View File

@ -21,8 +21,6 @@
#include "Config.h"
#include "AX25Twist.h"
class CAX25TX {
public:
CAX25TX();
@ -36,7 +34,6 @@ public:
uint8_t getSpace() const;
private:
CAX25Twist m_twist;
uint8_t m_poBuffer[600U];
uint16_t m_poLen;
uint16_t m_poPtr;

View File

@ -109,7 +109,7 @@ const uint8_t MMDVM_DEBUG5 = 0xF5U;
#define HW_TYPE "MMDVM"
#endif
#define DESCRIPTION "20200628 (D-Star/DMR/System Fusion/P25/NXDN/POCSAG/FM/AX.25)"
#define DESCRIPTION "20200629 (D-Star/DMR/System Fusion/P25/NXDN/POCSAG/FM/AX.25)"
#if defined(GITVERSION)
#define concat(h, a, b, c) h " " a " " b " GitID #" c ""