Add support for faster contestia modes

main-solar-only
Richard Meadows 2015-12-13 12:23:51 +00:00
rodzic 2acd6e5f83
commit c99ac62ee5
3 zmienionych plików z 26 dodań i 7 usunięć

Wyświetl plik

@ -25,6 +25,21 @@
#ifndef CONTESTIA_H
#define CONTESTIA_H
/* /\** */
/* * Contestia 8/1000 */
/* *\/ */
/* #define CONTESTIA_NUMBER_OF_TONES 8 */
/* #define CONTESTIA_CHARACTERS_PER_BLOCK 3 */
/* #define CONTESTIA_CHANNEL_SPACING 16 // Corresponds to 124.88 Hz */
/* #define CONTESTIA_SYMBOL_RATE 125 */
/* /\** */
/* * Contestia 16/1000 */
/* *\/ */
/* #define CONTESTIA_NUMBER_OF_TONES 16 */
/* #define CONTESTIA_CHARACTERS_PER_BLOCK 4 */
/* #define CONTESTIA_CHANNEL_SPACING 8 // Corresponds to 62.44 Hz */
/* #define CONTESTIA_SYMBOL_RATE 62.5 */
/**
* Contestia 32/1000
*/

Wyświetl plik

@ -35,7 +35,7 @@
/**
* Current output tones
*/
int8_t contestia_tones[CONTESTIA_NUMBER_OF_TONES];
int8_t contestia_tones[32];
/**
* Where we are in the current output tones
*/
@ -80,7 +80,7 @@ uint8_t contestia_tick(void) {
return 1;
}
if (contestia_tone_index < CONTESTIA_NUMBER_OF_TONES) {
if (contestia_tone_index < 32) {
uint8_t binary_code;
uint8_t grey_code;
@ -97,7 +97,7 @@ uint8_t contestia_tick(void) {
contestia_tone_index++;
if (contestia_tone_index < CONTESTIA_NUMBER_OF_TONES) {
if (contestia_tone_index < 32) {
return 1;
}

Wyświetl plik

@ -27,10 +27,12 @@
#include "samd20.h"
#include "mfsk.h"
#include "math/fwht.h"
#include "contestia.h"
static const uint64_t scrambler_olivia = 0xE257E6D0291574ECLL;
static const uint64_t scrambler_contestia = 0xEDB88320LL;
static const uint16_t shift_olivia = 13;
static const uint16_t shift_contestia = 5;
/**
* USEFUL RESOURES =============================================================
*
@ -110,7 +112,8 @@ void olivia_mfsk_encode_block(char* block, int8_t* tones)
{
size_t bits_per_symbol = 5; /* That is, there are 2^5=32 tones */
mfsk_encode_block(block, tones, 64, bits_per_symbol, scrambler_olivia, 13);
mfsk_encode_block(block, tones, 64, bits_per_symbol,
scrambler_olivia, shift_olivia);
}
/**
* This function encodes a single block of Contestia MFSK
@ -120,7 +123,7 @@ void olivia_mfsk_encode_block(char* block, int8_t* tones)
*/
void contestia_mfsk_encode_block(char* block, int8_t* tones)
{
size_t bits_per_symbol = 5; /* That is, there are 2^5=32 tones */
size_t bits_per_symbol = CONTESTIA_CHARACTERS_PER_BLOCK; /* That is, there are 2^x tones */
for (uint8_t c_index = 0; c_index < bits_per_symbol; c_index++) {
char character = block[c_index];
@ -151,5 +154,6 @@ void contestia_mfsk_encode_block(char* block, int8_t* tones)
}
mfsk_encode_block(block, tones, 32, bits_per_symbol, scrambler_contestia, 5);
mfsk_encode_block(block, tones, 32, bits_per_symbol,
scrambler_contestia, shift_contestia);
}