1
/***************************************************************************
2
rttydemodulator.h - description
5
copyright : (C) 2001 by Volker Schroer
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
***************************************************************************/
17
#ifndef RTTYDEMODULATOR_H
18
#define RTTYDEMODULATOR_H
20
#include <cdemodulator.h>
24
*@author Volker Schroer
26
enum StateOfReception { WaitingForMark,WaitingForSpace, CheckingStartBit,SkipRestOfStartBit,CollectingByte,
27
CheckingParity, WaitingForStopBits,ThrowHalfBit};
28
/** Number of tones used in fsk (2 for Rtty) but we use 7 for doing some afc */
30
#define NumberofTones 7
32
class RTTYDemodulator : public CDemodulator {
37
/** Prozess the input */
38
void ProcessInput(double * input);
40
bool Init(double,int);
42
public slots: // Public slots
43
/** Set RxFrequencies for RTTY */
44
void setRxFrequency(double);
46
private: //Private Variables
48
/** coeficients for slidding fft */
49
float_complex *twiddles;
51
/** result of slidding fft for the different tones */
53
/** history of sampled values for fft */
55
/** Mapping of Frequency to integer number (index) */
58
/** Number of samples to process */
60
/** Actuell Sample , just to be processed */
68
/** Status of Shift */
73
/** Number of Stopbits */
75
unsigned int NumberOfStopBits;
82
/** Samples per bit */
83
unsigned int SamplesPerBit;
84
/** Number of Bits per Character */
85
unsigned int NumberOfBits;
89
/** Status of reception*/
90
StateOfReception Status;
92
/** Pointer to history */
95
/** Counts the number of bits in act. Character ( for parity) */
96
unsigned int BitsInData;
97
/** Number of Bits to be processed */
99
/** Bitpattern of actual processed byte */
101
/** has detected Frequency changed ? */
102
bool FrequencyChanged;
103
/** How to correct the Rxfrequency */
105
/** previous sample */
107
/** Sample position in bit */
109
/** Variables for Squelch computing */
113
private: // Private methods
114
/** returns the asci char coresponding to the baudot code */
115
char baudot_code(char);
116
/** Processes the next sample */
117
int ProcessNextSample();
118
/** gets the next bit */
122
/** Calc the quality of the signal for squelch */
124
/** Reset the values of sliding of fft */