~ubuntu-branches/debian/sid/linpsk/sid

« back to all changes in this revision

Viewing changes to src/cpskdemodulator.h

  • Committer: Bazaar Package Importer
  • Author(s): Hamish Moffatt
  • Date: 2005-04-10 18:17:27 UTC
  • mfrom: (1.1.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050410181727-3l9dnfg0sp7bhk13
Tags: 0.8.1-1
* New upstream release 0.8.1
  * Modified upstream configure.in to support FHS-compliant Qt
    installation! (ie /usr/include/qt3, not /usr/lib/qt3/include) :-(
  * Re-autotools with autoconf2.59 and automake-1.9
* linpsk is no longer a Debian-native package (dsc/tar.gz)
* Now maintained by the debian-hams group
* Switch to debhelper 4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                          cpskdemodulator.h  -  description
 
3
                             -------------------
 
4
    begin                : Sat Jun 2 2001
 
5
    copyright            : (C) 2001 by Volker Schroer
 
6
    email                : dl1ksv@gmx.de
 
7
 ***************************************************************************/
 
8
 
 
9
/***************************************************************************
 
10
 *                                                                         *
 
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
 *   based on the work of Moe Wheatley, AE4JY                              *
 
16
 ***************************************************************************/
 
17
 
 
18
 
 
19
#ifndef CPSKDEMODULATOR_H
 
20
#define CPSKDEMODULATOR_H
 
21
 
 
22
using namespace std;
 
23
#include "constants.h"
 
24
#include <math.h>
 
25
#include <complex>
 
26
#include <stdlib.h>
 
27
 
 
28
#include "cdemodulator.h"
 
29
 
 
30
 
 
31
class CPskDemodulator  : public CDemodulator
 
32
{
 
33
 Q_OBJECT
 
34
public:
 
35
 CPskDemodulator();
 
36
 virtual ~CPskDemodulator();
 
37
 bool Init(double Fs ,int BlockSize);
 
38
 int getSquelchValue();
 
39
 void ProcessInput( double *pIn, double *Spectrum);
 
40
 complex<float> * getPhasePointer();
 
41
 virtual float getIMD();
 
42
 AfcMode AfcProperties();
 
43
        
 
44
protected:
 
45
 
 
46
// Methods
 
47
/** Decodes the symbol depending on the PskModes */     
 
48
 virtual void DecodeSymbol( double) = 0;
 
49
/** Calculates the Cuality of the signal -- depends on the mode */      
 
50
        virtual void CalcQuality( double angle ) = 0;   
 
51
        
 
52
// Variables            
 
53
  complex<double> Prev_Sample;
 
54
  complex<double> Phase_Vector;
 
55
        int m_BitAcc;
 
56
        bool m_LastBitZero;
 
57
        unsigned char* m_VaricodeDecTbl;
 
58
        int m_OnCount;
 
59
        int m_OffCount; 
 
60
        double m_FreqError;
 
61
        double m_QFreqError;
 
62
 
 
63
  double m_DevAve;
 
64
 
 
65
  bool fastSquelch;
 
66
private:
 
67
        int m_ClkErrTimer;
 
68
        int m_ClkErrCounter;
 
69
        int m_ClkError;
 
70
 
 
71
//methods
 
72
 
 
73
 
 
74
        bool SymbSync(complex<double> sample);
 
75
        void CalcBitFilter(  complex<double> Samp);
 
76
        double CalcAGC( complex<double> Samp );
 
77
        double CalcFreqError();
 
78
  void calcIMD(double *Spectrum);  
 
79
//variables
 
80
        double m_QPSKprob[4];
 
81
        int m_LastPkPos;
 
82
        int m_SampCnt;
 
83
        bool m_DispTrig;
 
84
        float m_BitPhaseInc;
 
85
        float m_BitPhasePos;
 
86
        float m_SyncAve[21];
 
87
 
 
88
        float m_SignalLevel;
 
89
 
 
90
        complex<double>* m_pQue1;
 
91
        complex<double>* m_pQue2;
 
92
        complex<double>* m_pQue3;
 
93
        complex<double>* m_pInPtr1;
 
94
        complex<double>* m_pInPtr2;
 
95
        complex<double>* m_pInPtr3;
 
96
 
 
97
        complex<double> m_FreqSignal;
 
98
        complex<double> m_BitSignal;
 
99
// Phase Values
 
100
  complex<float> * Phase;
 
101
// Local variables for various functions that need to be saved between calls
 
102
        double m_AGCave;
 
103
///     complex<double> m_z1; //Old Version of Freqerror
 
104
///     complex<double> m_z2; // dito
 
105
///     double m_FerAve;
 
106
        double m_LastFreq;
 
107
        int     m_PkPos;
 
108
        int     m_NewPkPos;
 
109
        int m_BitPos;
 
110
float IMD;
 
111
 
 
112
/** Some Variable for CalcQuality */
 
113
 
 
114
double fe0,fe1,fe2;
 
115
 
 
116
 
 
117
public slots:
 
118
signals: // Signals
 
119
 
 
120
};
 
121
 
 
122
#endif