/**************************************************************************** * MODEM for the Real-time BBC Codec/Modem * **************************************************************************** * William L. Bahn * * Academy Center for Information Security * * Department of Computer Science * * United States Air Force Academy * * USAFA, CO 80840 * **************************************************************************** * FILE:............ modem.h * * DATE CREATED:.... 06 SEP 07 * * DATE MODIFIED:... 06 SEP 07 * **************************************************************************** * * REVISION HISTORY * **************************************************************************** * * DESCRIPTION * * The modem converts baseband signal data to/from packet data. * */ #ifndef MODEMdotH #define MODEMdotH //------------------------------------------------------------------------ // REQUIRED INCLUDES //------------------------------------------------------------------------ #include // clock_t #include "config.h" #include "source.h" #include "buffer.h" #include "sink.h" #include "dirtyd.h" //------------------------------------------------------------------------ // STRUCTURE DECLARATIONS //------------------------------------------------------------------------ typedef struct MODEM MODEM; //------------------------------------------------------------------------ // STRUCTURE DEFINITIONS //------------------------------------------------------------------------ // NOTE: Normally the structure definition would be in the *.c file to make // the structure members inaccessible to outside functions except through // public function calls. But for the real-time code it has been decided // to make the structure members directly visible to the functions that // manipulate them. struct MODEM { // Derived quantities DWORD jitter_samples; double alpha; double t_hi, t_lo; // State information DWORD state; double integrator; SDWORD stamp; }; //------------------------------------------------------------------------ // PUBLIC FUNCTION PROTOTYPES //------------------------------------------------------------------------ MODEM *MODEM_Del(MODEM *p); MODEM *MODEM_New(CONFIG *c, DWORD *errcode); void Modulate(CONFIG *c, BUFFER *buffer, MODEM *modem, SINK *sink); void Demodulate(CONFIG *c, SOURCE *source, MODEM *modem, BUFFER *buf); //------------------------------------------------------------------------ #endif