This commit is contained in:
Mark Qvist 2018-04-16 23:45:51 +02:00
parent 2bb3f0c256
commit 6fae03d927
2 changed files with 5 additions and 15 deletions

View File

@ -364,11 +364,11 @@ void AFSK_adc_isr(Afsk *afsk, int8_t currentSample) {
// afsk->iirY[1] = afsk->iirX[0] + afsk->iirX[1] + (afsk->iirY[0] * 0.3101172565);
#elif FILTER_CUTOFF == 1200
afsk->iirY[1] = afsk->iirX[0] + afsk->iirX[1] + (afsk->iirY[0] / 10);
// The above is a simplification of a first-order 800Hz chebyshev filter:
// The above is a simplification of a first-order 1200Hz chebyshev filter:
// afsk->iirY[1] = afsk->iirX[0] + afsk->iirX[1] + (afsk->iirY[0] * 0.1025215106);
#elif FILTER_CUTOFF == 1600
afsk->iirY[1] = afsk->iirX[0] + afsk->iirX[1] + -1*(afsk->iirY[0] / 17);
// The above is a simplification of a first-order 800Hz chebyshev filter:
// The above is a simplification of a first-order 1600Hz chebyshev filter:
// afsk->iirY[1] = afsk->iirX[0] + afsk->iirX[1] + (afsk->iirY[0] * -0.0630669239);
#else
#error Unsupported filter cutoff!

View File

@ -52,16 +52,11 @@ inline static uint8_t sinSample(uint16_t i) {
#define SAMPLESPERBIT (SAMPLERATE / BITRATE)
#define PHASE_INC 1 // Nudge by an eigth of a sample each adjustment
#if BITRATE == 300
#define FILTER_CUTOFF 600
#define MARK_FREQ 1600
#define SPACE_FREQ 1800
#define PHASE_BITS 10 // How much to increment phase counter each sample
#elif BITRATE == 960
#if BITRATE == 960
#define FILTER_CUTOFF 600
#define MARK_FREQ 960
#define SPACE_FREQ 1600
#define PHASE_BITS 10
#define PHASE_BITS 10 // How much to increment phase counter each sample
#elif BITRATE == 1200
#define FILTER_CUTOFF 600
#define MARK_FREQ 1200
@ -72,11 +67,6 @@ inline static uint8_t sinSample(uint16_t i) {
#define MARK_FREQ 1600
#define SPACE_FREQ 2600
#define PHASE_BITS 8
#elif BITRATE == 2400
#define FILTER_CUTOFF 1600
#define MARK_FREQ 2400
#define SPACE_FREQ 4200
#define PHASE_BITS 4
#else
#error Unsupported bitrate!
#endif