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

TDSPFastBpsk.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 TDSPFASTBPSK_H
00019 #define TDSPFASTBPSK_H
00020 
00021 #include <TDSPPsk.h>
00022 
00027 class TDSPFastBpsk : 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   TDSPFastBpsk(char *name = NULL);
00036   ~TDSPFastBpsk();
00037 
00038   ClassDef(TDSPFastBpsk,1)
00039 
00040 };
00041 
00042 
00043 // Generate a lot of symbols
00044 //
00045 inline void TDSPFastBpsk::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 TDSPFastBpsk::GenerateSymbol(TComplex *c) {
00053   if (gRandom->Rndm()<.5) {
00054     *c      = *fSymbols;
00055     return 0;
00056   }
00057 
00058   *c = *(fSymbols+1);
00059   return 1;
00060 }
00061 
00062 inline Int_t TDSPFastBpsk::DetectSymbol(TComplex& s) {
00063   if (s.fRe<0) return 1;
00064   if (s.fRe>0) return 0;
00065   return NOT_DETECTED;
00066 }
00067 
00068 #endif

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