Encode a message into FT8 audio samples.
Encode a message into FT8 audio samplesEncodes a text message into FT8 audio samples at 12 kHz sample rate. The output is a float array suitable for conversion to int16 PCM audio.
- Parameters
-
| message | Input message string (max 37 chars, null-terminated) |
| samples | Output buffer for audio samples (must be at least 151680 elements) |
| nsamples | Output parameter - number of samples generated (typically 151680) |
- Returns
- TEGMEN_SUCCESS on success, error code on failure
- Note
- The message must be a valid FT8 message format (e.g., "CQ W4HO DN70")
-
Generated samples are at baseband (0-3000 Hz range)
-
Sample rate is always TEGMEN_SAMPLE_RATE (12000 Hz)
float samples[151680];
int nsamples = 0;
printf("Encoded %d samples\n", nsamples);
}
int tegmen_ft8_encode(const char *message, float *samples, int *nsamples)
Definition tegmen.c:44
#define TEGMEN_SUCCESS
Success return code.
Definition tegmen.h:58
#ifndef TEGMEN_H
#define TEGMEN_H
#include <stdint.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
#define TEGMEN_SUCCESS 0
#define TEGMEN_ERROR_INVALID_MESSAGE -1
#define TEGMEN_ERROR_ENCODING_FAILED -2
#define TEGMEN_ERROR_DECODING_FAILED -3
#define TEGMEN_ERROR_INVALID_PARAMETERS -4
#define TEGMEN_SAMPLE_RATE 12000
#define TEGMEN_FT8_MESSAGE_LEN 37
#define TEGMEN_FT4_MESSAGE_LEN 37
float sync,
int snr,
float dt,
float freq,
const char* decoded,
int nap,
float qual,
void* user_data
);
#ifdef __cplusplus
}
#endif
#endif
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
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