mirror of
https://github.com/markqvist/OpenModem.git
synced 2025-05-30 03:44:26 -04:00
Variable bitrate experiment
This commit is contained in:
parent
095a558fcb
commit
8d9da446a4
2 changed files with 44 additions and 7 deletions
|
@ -45,17 +45,33 @@ inline static uint8_t sinSample(uint16_t i) {
|
|||
#define CONFIG_AFSK_PREAMBLE_LEN 150UL
|
||||
#define CONFIG_AFSK_TRAILER_LEN 50UL
|
||||
#define SAMPLERATE 9600
|
||||
#define BITRATE 1200
|
||||
#define BITRATE 1600
|
||||
|
||||
#if BITRATE == 960
|
||||
#define FILTER_CUTOFF 600
|
||||
#define MARK_FREQ 1300
|
||||
#define SPACE_FREQ 2100
|
||||
#define PHASE_BITS 8 // How much to increment phase counter each sample
|
||||
#if BITRATE == 1200
|
||||
#define FILTER_CUTOFF 600
|
||||
#define MARK_FREQ 1200
|
||||
#define SPACE_FREQ 2200
|
||||
#define PHASE_BITS 8
|
||||
#elif BITRATE == 1600
|
||||
#define FILTER_CUTOFF 800
|
||||
#define MARK_FREQ 1600
|
||||
#define SPACE_FREQ 2800
|
||||
#define PHASE_BITS 6
|
||||
#else
|
||||
#error Unsupported bitrate!
|
||||
#endif
|
||||
|
||||
#define SAMPLESPERBIT (SAMPLERATE / BITRATE)
|
||||
#define BIT_STUFF_LEN 5
|
||||
#define MARK_FREQ 1200
|
||||
#define SPACE_FREQ 2200
|
||||
#define PHASE_BITS 8 // How much to increment phase counter each sample
|
||||
#define PHASE_INC 1 // Nudge by an eigth of a sample each adjustment
|
||||
#define PHASE_MAX (SAMPLESPERBIT * PHASE_BITS) // Resolution of our phase counter = 64
|
||||
#define PHASE_THRESHOLD (PHASE_MAX / 2) // Target transition point of our phase window
|
||||
|
||||
|
||||
typedef struct Hdlc
|
||||
{
|
||||
uint8_t demodulatedBits;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue