From 53a3be97d2ccdac43482206f05128960a1f7f387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C4=81rlis=20Goba?= Date: Thu, 18 Oct 2018 11:43:51 +0300 Subject: [PATCH] Added explanatory comments --- gen_ft8.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gen_ft8.cpp b/gen_ft8.cpp index 66b3106..3903006 100644 --- a/gen_ft8.cpp +++ b/gen_ft8.cpp @@ -165,10 +165,10 @@ int main(int argc, char **argv) { return -1; } - //const char *message = "G0UPL YL3JG 73"; const char *message = argv[1]; const char *wav_path = argv[2]; + // First, pack the text data into 72-bit binary message uint8_t packed[9]; int rc = packmsg(message, packed); if (rc < 0) { @@ -183,7 +183,8 @@ int main(int argc, char **argv) { } printf("\n"); - uint8_t tones[NN]; + // Second, encode the binary message as a sequence of FSK tones + uint8_t tones[NN]; // NN = 79, lack of better name at the moment genft8(packed, 0, tones); printf("FSK tones: "); @@ -192,6 +193,7 @@ int main(int argc, char **argv) { } printf("\n"); + // Third, convert the FSK tones into an audio signal const int num_samples = (int)(0.5 + NN / 6.25 * 12000); const int num_silence = (15 * 12000 - num_samples) / 2; float signal[num_silence + num_samples + num_silence]; @@ -203,4 +205,4 @@ int main(int argc, char **argv) { save_wav(signal, num_silence + num_samples + num_silence, 12000, wav_path); return 0; -} \ No newline at end of file +}