-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
srsampson
committed
Feb 22, 2019
1 parent
072eb54
commit 8d590ac
Showing
38 changed files
with
794 additions
and
1,050 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* Copyright (C) January 2016 David Rowe, Brady O'Brien | ||
* | ||
* All rights reserved. | ||
* | ||
* Modified by Steve Sampson for C99 complex math | ||
* | ||
* Licensed under GNU LGPL V2.1 | ||
* See LICENSE file for information | ||
*/ | ||
|
||
#ifndef FSK_H | ||
#define FSK_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <stdint.h> | ||
#include <stdbool.h> | ||
#include <complex.h> | ||
|
||
#include "fft.h" | ||
#include "statistics.h" | ||
|
||
#define MODE_2FSK 2 | ||
#define MODE_4FSK 4 | ||
#define MAX_TONES 4 | ||
#define FFT_SIZE 1024 | ||
#define FSK_SCALE 16383 | ||
|
||
#define OVERSAMPLE_RATE 8 | ||
#define MIN_FREQUENCY 300 | ||
#define MAX_FREQUENCY 2200 | ||
#define MIN_SPACING 100 | ||
|
||
#define cmplx(value) (cosf(value) + sinf(value) * I) | ||
#define cmplxconj(value) (cosf(value) + sinf(value) * -I) | ||
|
||
struct FSK { | ||
struct STATS *stats; | ||
complex float phase[MAX_TONES]; | ||
float f_est[MAX_TONES]; | ||
float norm_rx_timing; | ||
float EbNodB; | ||
float ppm; | ||
int Ndft; | ||
int Fs; | ||
int N; | ||
int Rs; | ||
int Ts; | ||
int Nmem; | ||
int P; | ||
int Nsym; | ||
int Nbits; | ||
int f1; | ||
int shift; | ||
int mode; | ||
int est_min; | ||
int est_max; | ||
int est_space; | ||
int nstash; | ||
int nin; | ||
bool burst_mode; | ||
fft_cfg fftcfg; | ||
float *hann_table; | ||
float *fft_est; | ||
complex float *samp_old; | ||
}; | ||
|
||
struct FSK *fsk_create(int, int, int, int); | ||
struct FSK *fsk_create_hbr(int, int, int, int, int, int); | ||
void fsk_destroy(struct FSK *); | ||
|
||
/* Getters/Setters */ | ||
|
||
int fsk_get_nin(struct FSK *); | ||
int fsk_get_N(struct FSK *); | ||
int fsk_get_Nmem(struct FSK *); | ||
int fsk_get_Nbits(struct FSK *); | ||
int fsk_get_Ts(struct FSK *); | ||
float fsk_get_f_est(struct FSK *, int); | ||
void fsk_set_nsym(struct FSK *, int); | ||
void fsk_set_est_limits(struct FSK *, int, int); | ||
void fsk_set_estimators(struct FSK *); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* FSK_H */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Empty file.
Oops, something went wrong.