1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-04 06:54:39 -04:00

M17 mod: implement BERT

This commit is contained in:
f4exb
2022-07-04 22:45:16 +02:00
parent 71c486310a
commit 242a5843d8
9 changed files with 216 additions and 3 deletions
@@ -28,6 +28,9 @@ MESSAGE_CLASS_DEFINITION(M17ModProcessor::MsgSendAPRS, Message)
MESSAGE_CLASS_DEFINITION(M17ModProcessor::MsgSendAudioFrame, Message)
MESSAGE_CLASS_DEFINITION(M17ModProcessor::MsgStartAudio, Message)
MESSAGE_CLASS_DEFINITION(M17ModProcessor::MsgStopAudio, Message)
MESSAGE_CLASS_DEFINITION(M17ModProcessor::MsgStartBERT, Message)
MESSAGE_CLASS_DEFINITION(M17ModProcessor::MsgSendBERTFrame, Message)
MESSAGE_CLASS_DEFINITION(M17ModProcessor::MsgStopBERT, Message)
M17ModProcessor::M17ModProcessor() :
m_m17Modulator("MYCALL", ""),
@@ -108,6 +111,24 @@ bool M17ModProcessor::handleMessage(const Message& cmd)
audioStop();
return true;
}
else if (MsgStartBERT::match(cmd))
{
qDebug("M17ModProcessor::handleMessage: MsgStartBERT");
m_prbs.reset();
send_preamble(); // preamble
return true;
}
else if (MsgSendBERTFrame::match(cmd))
{
processBERTFrame();
return true;
}
else if (MsgStopBERT::match(cmd))
{
qDebug("M17ModProcessor::handleMessage: MsgStopBERT");
send_eot(); // EOT
return true;
}
return false;
}
@@ -243,6 +264,13 @@ void M17ModProcessor::processAudioFrame()
output_baseband(mobilinkd::M17Modulator::STREAM_SYNC_WORD, temp);
}
void M17ModProcessor::processBERTFrame()
{
std::array<int8_t, 368> temp = mobilinkd::M17Modulator::make_bert_frame(m_prbs);
mobilinkd::M17Modulator::interleave_and_randomize(temp);
output_baseband(mobilinkd::M17Modulator::BERT_SYNC_WORD, temp);
}
std::array<uint8_t, 16> M17ModProcessor::encodeAudio(std::array<int16_t, 320*6>& audioFrame)
{
std::array<int16_t, 320> audioFrame8k;