Make wider TX and RX C4FSK filters optional from Config.h

48kHz
Jonathan Naylor 2016-07-18 17:39:31 +01:00
parent f92587dbbf
commit f7cae15aba
5 changed files with 36 additions and 3 deletions

View File

@ -43,5 +43,10 @@
// For the SP8NTH board
// #define ARDUINO_DUE_NTH
// To use wider C4FSK filters for DMR and System Fusion on transmit
// #define WIDE_C4FSK_FILTERS_TX
// To use wider C4FSK filters for DMR and System Fusion on receive
// #define WIDE_C4FSK_FILTERS_RX
#endif

View File

@ -23,10 +23,18 @@
#include "Globals.h"
#include "DMRSlotType.h"
#if defined(WIDE_C4FSK_FILTERS_TX)
// Generated using rcosdesign(0.2, 4, 5, 'sqrt') in MATLAB
static q15_t DMR_C4FSK_FILTER[] = {688, -680, -2158, -3060, -2724, -775, 2684, 7041, 11310, 14425, 15565, 14425,
11310, 7041, 2684, -775, -2724, -3060, -2158, -680, 688, 0};
const uint16_t DMR_C4FSK_FILTER_LEN = 22U;
#else
// Generated using rcosdesign(0.2, 8, 5, 'sqrt') in MATLAB
static q15_t DMR_C4FSK_FILTER[] = {401, 104, -340, -731, -847, -553, 112, 909, 1472, 1450, 683, -675, -2144, -3040, -2706, -770, 2667, 6995,
11237, 14331, 15464, 14331, 11237, 6995, 2667, -770, -2706, -3040, -2144, -675, 683, 1450, 1472, 909, 112,
-553, -847, -731, -340, 104, 401, 0};
const uint16_t DMR_C4FSK_FILTER_LEN = 42U;
#endif
const q15_t DMR_LEVELA[] = { 640, 640 , 640, 640, 640};
const q15_t DMR_LEVELB[] = { 213, 213, 213, 213, 213};

View File

@ -289,8 +289,10 @@ uint8_t CDStarTX::writeHeader(const uint8_t* header, uint8_t length)
return 4U;
uint16_t space = m_buffer.getSpace();
if (space < (DSTAR_HEADER_LENGTH_BYTES + 1U))
if (space < (DSTAR_HEADER_LENGTH_BYTES + 1U)) {
DEBUG2("D-Star, header space available", space);
return 5U;
}
m_buffer.put(DSTAR_HEADER);
@ -307,7 +309,7 @@ uint8_t CDStarTX::writeData(const uint8_t* data, uint8_t length)
uint16_t space = m_buffer.getSpace();
if (space < (DSTAR_DATA_LENGTH_BYTES + 1U)) {
DEBUG2("D-Star, space available", space);
DEBUG2("D-Star, data space available", space);
return 5U;
}
@ -322,8 +324,10 @@ uint8_t CDStarTX::writeData(const uint8_t* data, uint8_t length)
uint8_t CDStarTX::writeEOT()
{
uint16_t space = m_buffer.getSpace();
if (space < 1U)
if (space < 1U) {
DEBUG2("D-Star, EOT space available", space);
return 5U;
}
m_buffer.put(DSTAR_EOT);

8
IO.cpp
View File

@ -24,10 +24,18 @@
#include "Globals.h"
#include "IO.h"
#if defined(WIDE_C4FSK_FILTERS_RX)
// Generated using rcosdesign(0.2, 4, 5, 'sqrt') in MATLAB
static q15_t C4FSK_FILTER[] = {688, -680, -2158, -3060, -2724, -775, 2684, 7041, 11310, 14425, 15565, 14425,
11310, 7041, 2684, -775, -2724, -3060, -2158, -680, 688, 0};
const uint16_t C4FSK_FILTER_LEN = 22U;
#else
// Generated using rcosdesign(0.2, 8, 5, 'sqrt') in MATLAB
static q15_t C4FSK_FILTER[] = {401, 104, -340, -731, -847, -553, 112, 909, 1472, 1450, 683, -675, -2144, -3040, -2706, -770, 2667, 6995,
11237, 14331, 15464, 14331, 11237, 6995, 2667, -770, -2706, -3040, -2144, -675, 683, 1450, 1472, 909, 112,
-553, -847, -731, -340, 104, 401, 0};
const uint16_t C4FSK_FILTER_LEN = 42U;
#endif
// Generated using gaussfir(0.5, 4, 5) in MATLAB
static q15_t GMSK_FILTER[] = {8, 104, 760, 3158, 7421, 9866, 7421, 3158, 760, 104, 8, 0};

View File

@ -24,10 +24,18 @@
#include "YSFDefines.h"
#if defined(WIDE_C4FSK_FILTERS_TX)
// Generated using rcosdesign(0.2, 4, 5, 'sqrt') in MATLAB
static q15_t YSF_C4FSK_FILTER[] = {688, -680, -2158, -3060, -2724, -775, 2684, 7041, 11310, 14425, 15565, 14425,
11310, 7041, 2684, -775, -2724, -3060, -2158, -680, 688, 0};
const uint16_t YSF_C4FSK_FILTER_LEN = 22U;
#else
// Generated using rcosdesign(0.2, 8, 5, 'sqrt') in MATLAB
static q15_t YSF_C4FSK_FILTER[] = {401, 104, -340, -731, -847, -553, 112, 909, 1472, 1450, 683, -675, -2144, -3040, -2706, -770, 2667, 6995,
11237, 14331, 15464, 14331, 11237, 6995, 2667, -770, -2706, -3040, -2144, -675, 683, 1450, 1472, 909, 112,
-553, -847, -731, -340, 104, 401, 0};
const uint16_t YSF_C4FSK_FILTER_LEN = 42U;
#endif
const q15_t YSF_LEVELA[] = { 809, 809, 809, 809, 809};
const q15_t YSF_LEVELB[] = { 269, 269, 269, 269, 269};