Tegmen 0.1.0
Lightweight C library for FT8/FT4 encoding and decoding
Loading...
Searching...
No Matches
tegmen.h
Go to the documentation of this file.
1
42
43#ifndef TEGMEN_H
44#define TEGMEN_H
45
46#include <stdint.h>
47#include <stddef.h>
48
49#ifdef __cplusplus
50extern "C" {
51#endif
52
56
58#define TEGMEN_SUCCESS 0
60#define TEGMEN_ERROR_INVALID_MESSAGE -1
62#define TEGMEN_ERROR_ENCODING_FAILED -2
64#define TEGMEN_ERROR_DECODING_FAILED -3
66#define TEGMEN_ERROR_INVALID_PARAMETERS -4
67
69
73
75#define TEGMEN_SAMPLE_RATE 12000
76
78#define TEGMEN_FT8_MESSAGE_LEN 37
79
81#define TEGMEN_FT4_MESSAGE_LEN 37
82
84
88
103 float sync,
104 int snr,
105 float dt,
106 float freq,
107 const char* decoded,
108 int nap,
109 float qual,
110 void* user_data
111);
112
114
118
143int tegmen_ft8_encode(const char* message, float* samples, int* nsamples);
144
173int tegmen_ft8_decode(const int16_t* samples, int nsamples,
174 tegmen_decode_callback_t callback, void* user_data);
175
181int tegmen_ft4_encode(const char* message, float* samples, int* nsamples);
182
188int tegmen_ft4_decode(const int16_t* samples, int nsamples,
189 tegmen_decode_callback_t callback, void* user_data);
190
192
193#ifdef __cplusplus
194}
195#endif
196
197#endif /* TEGMEN_H */
198
int tegmen_ft8_decode(const int16_t *samples, int nsamples, tegmen_decode_callback_t callback, void *user_data)
Definition tegmen.c:64
int tegmen_ft4_decode(const int16_t *samples, int nsamples, tegmen_decode_callback_t callback, void *user_data)
Decode FT4 signals from audio samples.
Definition tegmen.c:108
int tegmen_ft4_encode(const char *message, float *samples, int *nsamples)
Encode a message into FT4 audio samples.
Definition tegmen.c:100
int tegmen_ft8_encode(const char *message, float *samples, int *nsamples)
Definition tegmen.c:44
void(* tegmen_decode_callback_t)(float sync, int snr, float dt, float freq, const char *decoded, int nap, float qual, void *user_data)
Decode callback function type.
Definition tegmen.h:102