/* wfmd.h This file is part of a program that implements a Software-Defined Radio. Copyright (C) 2013 Warren Pratt, NR0V This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. The author can be reached by email at warren@wpratt.com */ #ifndef _wfmd_h #define _wfmd_h #include "firmin.h" #include "wcpAGC.h" typedef struct _wfmd { int run; int size; double* in; double* out; double rate; double f_low; // audio low cutoff double f_high; // audio high cutoff // quadrature discriminator double deviation; // peak deviation, Hz double again; // discriminator output gain double pre_i; // previous sample, I double pre_q; // previous sample, Q // for dc removal double tau; double mtau; double onem_mtau; double fmdc; // de-emphasis, single-pole RC int deemph_run; double tau_de; // 75.0e-6 (Americas) or 50.0e-6 (elsewhere) double mde; double onem_mde; double deemph_z; // for audio filter double* audio; FIRCORE paud; int nc_aud; int mp_aud; double afgain; // detector limiter WCPAGC plim; int lim_run; double lim_gain; double lim_pre_gain; } wfmd, *WFMD; extern WFMD create_wfmd ( int run, int size, double* in, double* out, int rate, double deviation, double f_low, double f_high, double tau, int deemph_run, double tau_de, double afgain, int nc_aud, int mp_aud); extern void destroy_wfmd (WFMD a); extern void flush_wfmd (WFMD a); extern void xwfmd (WFMD a); extern void setBuffers_wfmd (WFMD a, double* in, double* out); extern void setSamplerate_wfmd (WFMD a, int rate); extern void setSize_wfmd (WFMD a, int size); // RXA Properties extern __declspec (dllexport) void SetRXAWFMDeviation (int channel, double deviation); extern __declspec (dllexport) void SetRXAWFMNCaud (int channel, int nc); extern __declspec (dllexport) void SetRXAWFMMPaud (int channel, int mp); extern __declspec (dllexport) void SetRXAWFMAFFilter (int channel, double low, double high); extern __declspec (dllexport) void SetRXAWFMDeemphRun (int channel, int run); extern __declspec (dllexport) void SetRXAWFMDeemphTau (int channel, double tau); extern __declspec (dllexport) void SetRXAWFMLimRun (int channel, int run); extern __declspec (dllexport) void SetRXAWFMLimGain (int channel, double gaindB); #endif