From ac7c48b4dee99d4c772f133d70d8d1b38262fcd2 Mon Sep 17 00:00:00 2001 From: Author Name Date: Fri, 7 Jul 2023 12:20:59 +0930 Subject: shallow zip-file copy from codec2 e9d726bf20 --- src/codec2_fm.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/codec2_fm.h (limited to 'src/codec2_fm.h') diff --git a/src/codec2_fm.h b/src/codec2_fm.h new file mode 100644 index 0000000..36faece --- /dev/null +++ b/src/codec2_fm.h @@ -0,0 +1,53 @@ +/*---------------------------------------------------------------------------*\ + + FILE........: codec2_fm.h + AUTHOR......: David Rowe + DATE CREATED: February 2015 + + Functions that implement analog FM, see also octave/fm.m. + +\*---------------------------------------------------------------------------*/ + +/* + Copyright (C) 2015 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.1, 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 . +*/ + +#ifndef __CODEC2_FM__ +#define __CODEC2_FM__ + +#include "comp.h" + +struct FM { + float Fs; /* setme: sample rate */ + float fm_max; /* setme: maximum modulation frequency */ + float fd; /* setme: maximum deviation */ + float fc; /* setme: carrier frequency */ + COMP *rx_bb; + COMP rx_bb_filt_prev; + float *rx_dem_mem; + float tx_phase; + int nsam; + COMP lo_phase; +}; + +struct FM *fm_create(int nsam); +void fm_destroy(struct FM *fm_states); +void fm_demod(struct FM *fm, float rx_out[], float rx[]); +void fm_mod(struct FM *fm, float tx_in[], float tx_out[]); +void fm_mod_comp(struct FM *fm_states, float tx_in[], COMP tx_out[]); + +#endif + -- cgit v1.2.3