From: drowe67 Date: Tue, 20 Mar 2018 08:54:01 +0000 (+0000) Subject: first pass at ofdm_mod, command line OFDM modulator program X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=d6cb56204952da92a943fa3ecb2373d84e674858;p=freetel-svn-tracking.git first pass at ofdm_mod, command line OFDM modulator program git-svn-id: https://svn.code.sf.net/p/freetel/code@3419 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/src/CMakeLists.txt b/codec2-dev/src/CMakeLists.txt index 3822b816..f7f15666 100644 --- a/codec2-dev/src/CMakeLists.txt +++ b/codec2-dev/src/CMakeLists.txt @@ -318,7 +318,7 @@ add_executable(fsk_demod fsk_demod.c modem_probe.c octave.c) target_link_libraries(fsk_demod ${CMAKE_REQUIRED_LIBRARIES} codec2) add_executable(fsk_get_test_bits fsk_get_test_bits.c) -target_link_libraries(fsk_get_test_bits ${CMAKE_REQUIRED_LIBRARIES} codec2) +target_link_libraries(fsk_get_test_bits) add_executable(fsk_put_test_bits fsk_put_test_bits.c) target_link_libraries(fsk_put_test_bits ${CMAKE_REQUIRED_LIBRARIES} codec2) @@ -329,6 +329,9 @@ target_link_libraries(fm_demod ${CMAKE_REQUIRED_LIBRARIES}) add_executable(cohpsk_mod cohpsk_mod.c) target_link_libraries(cohpsk_mod ${CMAKE_REQUIRED_LIBRARIES} codec2) +add_executable(ofdm_mod ofdm_mod.c ../src/ofdm.c) +target_link_libraries(ofdm_mod ${CMAKE_REQUIRED_LIBRARIES} codec2) + add_executable(fmfsk_mod fmfsk_mod.c) target_link_libraries(fmfsk_mod ${CMAKE_REQUIRED_LIBRARIES} codec2) diff --git a/codec2-dev/src/ofdm_mod.c b/codec2-dev/src/ofdm_mod.c new file mode 100644 index 00000000..67735c98 --- /dev/null +++ b/codec2-dev/src/ofdm_mod.c @@ -0,0 +1,117 @@ +/*---------------------------------------------------------------------------*\ + + FILE........: ofdm_mod.c + AUTHOR......: David Rowe + DATE CREATED: March 2018 + + Given an input file of bits (note one bit per char format), outputs + a raw file (8kHz, 16 bit shorts) of OFDM modem samples ready to send + over a HF radio channel. + +\*---------------------------------------------------------------------------*/ + +/* + Copyright (C) 2018 David Rowe + + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License version 2, as + published by the Free Software Foundation. This program is + distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; if not, see . +*/ + +#include +#include +#include +#include +#include +#include + +#include "codec2_ofdm.h" + +#define ASCALE (2E5*1.1491) + +int opt_exists(char *argv[], int argc, char opt[]) { + int i; + for (i=0; i