1 // ----------------------------------------------------------------------------
2 // BLANK.h  --  BASIS FOR ALL MODEMS
3 //
4 // Copyright (C) 2006
5 //		Dave Freese, W1HKJ
6 //
7 // This file is part of fldigi.
8 //
9 // Fldigi is free software: you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation, either version 3 of the License, or
12 // (at your option) any later version.
13 //
14 // Fldigi is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with fldigi.  If not, see <http://www.gnu.org/licenses/>.
21 // ----------------------------------------------------------------------------
22 
23 #ifndef _BLANK_H
24 #define _BLANK_H
25 
26 #include "trx.h"
27 #include "modem.h"
28 #include "fft.h"
29 #include "filters.h"
30 #include "complex.h"
31 
32 #define	BLANKSampleRate	8000
33 #define	SYMLEN			512
34 #define BLANK_BW		100
35 
36 #define BUFFLEN			4096
37 #define SCOPE_DATA_LEN	1024
38 
39 // lp filter
40 //#define	DEC_1		8
41 //#define FIRLEN_1	256
42 //#define BW_1		10
43 
44 // NASA coefficients for viterbi encode/decode algorithms
45 //#define	K	7
46 //#define	POLY1	0x6d
47 //#define	POLY2	0x4f
48 
49 
50 class BLANK : public modem {
51 protected:
52 	double			phaseacc;
53 	double			phaseincr;
54 
55 	C_FIR_filter	*bandpass;
56 	C_FIR_filter	*lowpass;
57 	C_FIR_filter	*hilbert;
58 	Cmovavg			*moving_avg;
59 	sfft			*slidingfft;
60 
61 	int				symlen;
62 // receive
63 	double			*scope_data;
64 	double			*inbuf;
65 // transmit
66 	int txstate;
67 
68 	double			*outbuf;
69 	unsigned int	buffptr;
70 
71 public:
72 	BLANK();
73 	~BLANK();
74 	void	init();
75 	void	rx_init();
76 	void	tx_init(SoundBase *sc);
77 	void 	restart();
78 	int		rx_process(const double *buf, int len);
79 	int		tx_process();
80 	void	update_syncscope();
81 
82 };
83 
84 #endif
85