dl-fldigi/src/include/feld.h

118 wiersze
2.6 KiB
C

// ----------------------------------------------------------------------------
2007-06-22 22:04:50 +00:00
// feld.h -- FELDHELL modem
//
// Copyright (C) 2006-2010
2007-06-22 22:04:50 +00:00
// Dave Freese, W1HKJ
//
// This file is part of fldigi. Adapted from code contained in gmfsk source code
2007-06-22 22:04:50 +00:00
// distribution.
// gmfsk Copyright (C) 2001, 2002, 2003
// Tomi Manninen (oh2bns@sral.fi)
// Copyright (C) 2004
// Lawrence Glaister (ve7it@shaw.ca)
//
// Fldigi is free software: you can redistribute it and/or modify
2007-06-22 22:04:50 +00:00
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
2007-06-22 22:04:50 +00:00
// (at your option) any later version.
//
// Fldigi is distributed in the hope that it will be useful,
2007-06-22 22:04:50 +00:00
// 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 fldigi. If not, see <http://www.gnu.org/licenses/>.
2007-06-22 22:04:50 +00:00
// ----------------------------------------------------------------------------
#ifndef _FELD_H
#define _FELD_H
#include "modem.h"
#include "filters.h"
#include "fftfilt.h"
2007-10-06 15:04:10 +00:00
#include "mbuffer.h"
2007-06-22 22:04:50 +00:00
#define FeldSampleRate 8000
#define FeldMaxSymLen 1024
2008-02-25 16:39:29 +00:00
#define MAXLEN 512
2007-06-22 22:04:50 +00:00
#define FELD_RX_COLUMN_LEN 20
2007-06-22 22:04:50 +00:00
class feld : public modem {
enum FELD_STATE {PREAMBLE, POSTAMBLE, DATA};
public:
static int RxColumnLen;
static int TxColumnLen;
2007-06-22 22:04:50 +00:00
protected:
//rx
double rxphacc;
2009-02-14 19:46:51 +00:00
double rxdelta;
2007-06-22 22:04:50 +00:00
double rxcounter;
double agc;
double peakval;
2007-06-22 22:04:50 +00:00
double peakhold;
double minhold;
2008-02-22 18:30:58 +00:00
double rxpixrate;
double txpixrate;
double downsampleinc;
double upsampleinc;
2008-02-27 02:58:09 +00:00
double phi2freq;
2007-06-22 22:04:50 +00:00
C_FIR_filter *hilbert;
fftfilt *bpfilt;
Cmovavg *bbfilt;
Cmovavg *minmaxfilt;
Cmovavg *average;
2007-06-22 22:04:50 +00:00
//tx
FELD_STATE tx_state;
double txphacc;
double txcounter;
double hell_bandwidth;
2008-05-15 23:53:57 +00:00
double filter_bandwidth;
2007-06-22 22:04:50 +00:00
int depth;
int dxmode;
int halfwidth;
bool blackboard;
bool hardkeying;
2008-02-22 18:30:58 +00:00
double feldcolumnrate;
2007-06-22 22:04:50 +00:00
int preamble;
int postamble;
int prevsymb;
cmplx prev;
2007-06-22 22:04:50 +00:00
2008-02-25 16:39:29 +00:00
double OnShape[MAXLEN];
double OffShape[MAXLEN];
2007-06-22 22:04:50 +00:00
mbuffer<int, 2*FELD_RX_COLUMN_LEN> col_data;
2007-06-22 22:04:50 +00:00
int col_pointer;
int fntnbr;
cmplx mixer(cmplx);
2007-06-22 22:04:50 +00:00
double nco(double);
void rx(cmplx);
void FSKHELL_rx(cmplx);
2007-06-22 22:04:50 +00:00
void send_symbol(int currsymbol, int nextsymbol);
void send_null_column();
void tx_char(char);
void initKeyWaveform();
public:
feld(trx_mode);
~feld();
void init();
void rx_init();
2008-02-15 19:36:53 +00:00
void tx_init(SoundBase *sc);
2008-05-11 00:01:16 +00:00
void restart();
2007-09-19 00:45:42 +00:00
int rx_process(const double *buf, int len);
2007-06-22 22:04:50 +00:00
int tx_process();
int get_font_data(unsigned char c, int col);
};
#endif