From 3a55d358f05305896624aec717ee8d11d7113026 Mon Sep 17 00:00:00 2001 From: David Forrest Date: Fri, 8 Nov 2019 21:01:01 -0500 Subject: [PATCH 1/2] gen_ft8.cpp: add FREQUENCY option Allow generation of FT8 files at other frequencies than 1000Hz. --- gen_ft8.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gen_ft8.cpp b/gen_ft8.cpp index 8eb4922..6adc3de 100644 --- a/gen_ft8.cpp +++ b/gen_ft8.cpp @@ -40,7 +40,7 @@ void usage() { printf("Generate a 15-second WAV file encoding a given message.\n"); printf("Usage:\n"); printf("\n"); - printf("gen_ft8 MESSAGE WAV_FILE\n"); + printf("gen_ft8 MESSAGE WAV_FILE [FREQUENCY]\n"); printf("\n"); printf("(Note that you might have to enclose your message in quote marks if it contains spaces)\n"); } @@ -55,6 +55,10 @@ int main(int argc, char **argv) { const char *message = argv[1]; const char *wav_path = argv[2]; + int frequency = 1000; + if (argc > 3) { + frequency = atoi(argv[3]); + } // First, pack the text data into binary message uint8_t packed[ft8::K_BYTES]; @@ -93,7 +97,7 @@ int main(int argc, char **argv) { signal[i] = 0; } - synth_fsk(tones, ft8::NN, 1000, symbol_rate, symbol_rate, sample_rate, signal + num_silence); + synth_fsk(tones, ft8::NN, frequency, symbol_rate, symbol_rate, sample_rate, signal + num_silence); save_wav(signal, num_silence + num_samples + num_silence, sample_rate, wav_path); return 0; From 3ff0e4ef7425e17ab2ac2543e0de74f101beb209 Mon Sep 17 00:00:00 2001 From: David R Forrest Date: Sat, 9 Nov 2019 09:09:58 -0500 Subject: [PATCH 2/2] gen_ft8.cpp: switch frequency to float --- gen_ft8.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gen_ft8.cpp b/gen_ft8.cpp index 6adc3de..f030731 100644 --- a/gen_ft8.cpp +++ b/gen_ft8.cpp @@ -55,9 +55,9 @@ int main(int argc, char **argv) { const char *message = argv[1]; const char *wav_path = argv[2]; - int frequency = 1000; + float frequency = 1000.0; if (argc > 3) { - frequency = atoi(argv[3]); + frequency = atof(argv[3]); } // First, pack the text data into binary message