/*
 *
 *
 *    localtypes.h
 *
 *    Configuration of types and certain values.
 *
 *    Copyright (C) 2018 by Matt Roberts.
 *    License: GNU GPL3 (www.gnu.org)
 *
 *
 */


#ifndef __NWS_LOCALTYPES_H
#define __NWS_LOCALTYPES_H

#include <stdint.h>

using namespace std;

// simple definitions
typedef int16_t sample_t;
typedef int32_t accum_t;
typedef double filter_t;

// the header string (four bytes out of 16 required by NWS)
const uint32_t header = 0xABABABAB;

// define the sampling rate of the sound card and the modem algorithm
#define CARD_FS 44100
#define MODEM_FS 44100

// the length of the FIR decimation and interpolation filters
#define FILTER_LEN 95

// the filter cutoff (in Hz)
#define FILTER_COF 2800

// the point at which clipping detection will fire
#define CLIP_LIMIT (0.90)

// more complex types
#include "tpfdisc.h"
#include "FirFilter.h"

// the FIR filter type
typedef KK5JY::DSP::FirFilter<float> fir_filter_t;

// the discriminator type
typedef KK5JY::DSP::TwinPassbandDiscriminator<sample_t, accum_t, filter_t> detector_t;

// define this to get lots of DSP output data
//#define DEMOD_DEBUG

// define this to get lots of clock recovery output data
//#define CLOCK_DEBUG

// define this to get a more raw output of the data stream
//#define RAW_OUTPUT

#endif // __NWS_LOCALTYPES_H

