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 #ifndef TDSPNOFDM_H 00018 #define TDSPNOFDM_H 00019 00020 00021 #include <TH1F.h> 00022 #include <TDSPSignal.h> 00023 #include <TDSPBlockMap.h> 00024 00031 class TDSPNofdm : public TDSPBlockMap { 00032 00033 private: 00034 00035 // Some more signal-processing typical 00036 // slot-names (implemented as Delegation to the 00037 // original slots) 00038 00039 TString Delegation_Transmit; 00040 TString Delegation_Receive; 00041 00042 TString Delegation_Transmitted; 00043 TString Delegation_Received; 00044 00045 TString& _build_pulse_param_string(TString& start); 00046 00047 protected: 00048 00049 00050 Int_t fMode; // Mode BFDM/CORR etc. 00051 Bool_t fDual; // Use Dual system ? 00052 Bool_t fTight; // Make system tight ? 00053 UInt_t fOptions; // Some Options 00054 Int_t fNumCarriers; // Number of Carriers / or equivalents 00055 Int_t fNumTime; // Number of Time-steps / or equivalents 00056 00057 Int_t fTimePad; 00058 Int_t fFreqPad; 00059 Int_t fLength; 00060 00061 TString fPulseName; // The Name of pulse 00062 Int_t fPulseNumParams; // Number of Parameters to put into the pulse 00063 Double_t fPulseParams[4]; // The Pulse-Parameters 00064 TString fPulseFile; // The Name of the last used pulse file 00065 00066 TDSPMatrix *fMapping; 00067 TDSPMatrix *fMappingPart1; 00068 TDSPMatrix *fCorrelation; // the input<->output correlation 00069 TDSPMatrix *fNoiseCorrelation; // the input<->output correlation for Noise between transmitter and receiver 00070 TDSPMatrix *fTransmitMatrix; // The Transmit Filter 00071 TDSPMatrix *fReceiverMatrix; // The Receiver Filter 00072 TDSPMatrix *fChannel; // A Channel Model 00073 00074 TDSPMatrix *f_PseudoInverseMatrix; // if the class allocs itself the pseudo-inv. matrix we need a copy of the pointer 00075 void _free_mode(Int_t); // Clean up a mode 00076 void _new_mode(Int_t); // Set a new mode 00077 00078 // Some flags 00079 00080 Bool_t _recalc_correlations; 00081 Bool_t _recalc_mapping; 00082 00083 // Some Helper Functions 00084 00085 void _calc_correlations(); 00086 void _calc_mapping(); 00087 00088 public: 00089 00090 TH1F *fHistogram_all; 00091 TH1F *fHistogram_diag; 00092 TH1F *fHistogram_nondiag; 00093 00094 TH1F *fHistogram_corr_all; 00095 TH1F *fHistogram_corr_diag; 00096 TH1F *fHistogram_corr_nondiag; 00097 00098 // Constructor / Destructor 00099 // 00100 TDSPNofdm(char *name = NULL); 00101 virtual ~TDSPNofdm(); 00102 00103 // Set/Get Parameters 00104 // 00105 Int_t GetNumCarriers() const { return fNumCarriers; }; 00106 void SetNumCarriers(Int_t n) { Error("SetNumCarriers","Not yet implemented!"); }; 00107 Int_t GetLength() const { return fLength;}; 00108 void SetLength(Int_t l) { fLength = l;}; 00109 Int_t GetTimePad() const { return fTimePad;}; 00110 void SetTimePad(Int_t t) { fTimePad = t;fNumTime=fLength/fTimePad;}; 00111 Int_t GetFreqPad() const { return fFreqPad;}; 00112 void SetFreqPad(Int_t t) { fFreqPad = t;fNumCarriers=fLength/fFreqPad;}; 00113 void SetPads(Int_t time, Int_t freq) { SetTimePad(time);SetFreqPad(freq);}; 00114 00115 void SetTransmitMatrix(TDSPMatrix *h); 00116 void SetReceiverMatrix(TDSPMatrix *h); 00117 00118 TDSPVector* GetTransmitPulse(TDSPVector *p=NULL); 00119 TDSPVector* GetReceiverPulse(TDSPVector *p=NULL); 00120 00121 TDSPMatrix* GetTransmitMatrix() const { return fTransmitMatrix;}; 00122 TDSPMatrix* GetReceiverMatrix() const { return fReceiverMatrix;}; 00123 00124 void SetPulseName(TString n) { fPulseName = n;}; 00125 void SetPulseParam(Int_t num, Double_t v); 00126 Double_t GetPulseParam(Int_t num); 00127 char* GetPulseFile() { return (char*)fPulseFile.Data();}; 00128 00129 virtual void Print(); 00130 virtual void Draw(); 00131 00132 void SetChannel(TDSPMatrix*); 00133 TDSPMatrix* GetChannel() const { return fChannel;}; 00134 void SetMode(Int_t mode); 00135 00136 // Setting Options 00137 // 00138 // opt = "bfdm" / "corr" 00139 // = "tight" / "nontight" 00140 // = "dual" / "nondual" 00141 // = "analysecorr" 00142 // = "analysemapping" 00143 // = "debugcorrelation" 00144 // = "showpulse" / "noshowpulse" 00145 // = "wilson" - Multiplying Wilson-Phases on Gamma and GStar 00146 00147 void SetOption(Option_t *opt); 00148 TDSPMatrix* GetMapping() { if (_recalc_mapping) _calc_mapping();return fMapping;}; 00149 TDSPMatrix* GetMappingPart1() { if (_recalc_mapping) _calc_mapping();return fMappingPart1;}; 00150 TDSPMatrix* GetCorrelation() { if (_recalc_correlations) _calc_correlations();return fCorrelation;}; 00151 TDSPMatrix* GetNoiseCorrelation() { if (_recalc_correlations) _calc_correlations(); return fNoiseCorrelation;}; 00152 00153 TDSPSignal* GetTransmitSignal() { return GetSignal(); }; 00154 TDSPSignal* GetReceivedSignal() { return GetInverseSignal(); }; 00155 Double_t GetBandWidthEfficiency() { return Double_t(fNumCarriers*fNumTime)/Double_t(fLength); }; 00156 00157 void CreatePulses(); 00158 void LoadPulses(char *fname, char *transmitname="TransmitMatrix", char *receivername="ReceiverMatrix"); 00159 void SavePulses(char *fname, char *transmitname="TransmitMatrix", char *receivername="ReceiverMatrix"); 00160 00161 void CalcMappingFromChannel(TDSPMatrix* channel); 00162 void CalcCorrelationFromChannel(TDSPMatrix* channel); 00163 void Correlation(TDSPMatrix*c); 00164 void Mapping(TDSPMatrix*c); 00165 void MappingPart1(TDSPMatrix*c); 00166 00167 ClassDef(TDSPNofdm,1) 00168 00169 }; 00170 #endif
1.3.2