diff options
| author | Author Name <[email protected]> | 2023-07-07 12:20:59 +0930 |
|---|---|---|
| committer | David Rowe <[email protected]> | 2023-07-07 12:29:06 +0930 |
| commit | ac7c48b4dee99d4c772f133d70d8d1b38262fcd2 (patch) | |
| tree | a2d0ace57a9c0e2e5b611c4987f6fed1b38b81e7 /src/codec2_fm.h | |
shallow zip-file copy from codec2 e9d726bf20
Diffstat (limited to 'src/codec2_fm.h')
| -rw-r--r-- | src/codec2_fm.h | 53 |
1 files changed, 53 insertions, 0 deletions
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 <http://www.gnu.org/licenses/>. +*/ + +#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 + |
