Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals

TDSPFastQpsk.h

Go to the documentation of this file.
00001 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef TDSPFASTQPSK_H
00019 #define TDSPFASTQPSK_H
00020 
00021 #include <TDSPPsk.h>
00022 
00027 class TDSPFastQpsk : public TDSPPsk  {
00028  protected:
00029 
00030   void     GenerateSymbols(Int_t, TComplex*); // Generate a lot of symbols 
00031   Int_t    GenerateSymbol(TComplex *c);
00032   Int_t    DetectSymbol(TComplex& s);
00033 
00034  public: 
00035   TDSPFastQpsk(char *name = NULL);
00036   ~TDSPFastQpsk();
00037 
00038   ClassDef(TDSPFastQpsk,1)
00039 
00040 };
00041 
00042 
00043 // Generate a lot of symbols
00044 //
00045 inline void TDSPFastQpsk::GenerateSymbols(Int_t num,
00046                       TComplex *c) {
00047   Int_t *sym = fISymbols;
00048   for(register Int_t i=num;i;--i) 
00049     *(sym++) = GenerateSymbol(c++);
00050 }
00051 
00052 inline Int_t TDSPFastQpsk::GenerateSymbol(TComplex *c) {
00053   Int_t r = Int_t(gRandom->Rndm()*4.0);
00054   *c = *(fSymbols+r);
00055   return r;
00056 }
00057 
00058 inline Int_t TDSPFastQpsk::DetectSymbol(TComplex& s) {
00059 
00060 
00061   // rotiere um 45 grad entgegen Uhrzeiger
00062   
00063   //    1
00064   //  2   0
00065   //    3
00066 
00067   Double_t x = s.fRe-s.fIm;
00068   Double_t y = s.fRe+s.fIm;
00069   
00070   // 1   0
00071   // 2   3
00072 
00073   if (x<0) {
00074     if (y>0) return 1; 
00075     if (y<0) return 2;
00076   } 
00077   if (x>0) {
00078     if (y>0) return 0;
00079     if (y<0) return 3;
00080   } 
00081   return NOT_DETECTED;
00082 }
00083 
00084 #endif

Generated on Fri Apr 23 16:23:43 2004 by doxygen 1.3.2