ArrayCore/FKStationSignals.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of ArrayCore.
00004 **
00005 **  This file may be distributed and/or modified under the terms of the
00006 **  GNU General Public License version 2 or 3 as published by the Free
00007 **  Software Foundation and appearing in the file LICENSE.GPL included
00008 **  in the packaging of this file.
00009 **
00010 **  This file is distributed in the hope that it will be useful, but WITHOUT
00011 **  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 **  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
00013 **  more details.
00014 **
00015 **  You should have received a copy of the GNU General Public License
00016 **  along with this program. If not, see <http://www.gnu.org/licenses/>.
00017 **
00018 **  See http://www.geopsy.org for more information.
00019 **
00020 **  Created : 2004-06-21
00021 **  Authors:
00022 **    Marc Wathelet
00023 **    Marc Wathelet (ULg, Liège, Belgium)
00024 **    Marc Wathelet (LGIT, Grenoble, France)
00025 **
00026 ***************************************************************************/
00027 
00028 #ifndef FKStationSignals_H
00029 #define FKStationSignals_H
00030 
00031 #include <GeopsyCore.h>
00032 
00033 #include "ArrayCoreDLLExport.h"
00034 
00035 namespace ArrayCore {
00036 
00037 class ARRAYCORE_EXPORT FKStationSignals : public StationProcessSignals
00038 {
00039 public:
00040   FKStationSignals(const StationSignals * originalSignals);
00041   ~FKStationSignals();
00042 
00043   virtual void setProcessed(const TimeRange& tw, AbstractParameters * param);
00044 
00045   void setRelativeCoordinates(const Point2D& p) {_relativeCoordinates=p;}
00046   void initPhaseShifts(int n);
00047   void setPhaseShift(int index, double kx, double ky);
00048 
00049   double absolutePower(int iComp, int iFreqMin, int iFreqMax, double * taperingFunction);
00050   inline void setCurrentShift(double kx, double ky);
00051 
00052   inline Complex getShiftedSignal(int component, int iFreq, int offset);
00053   inline Complex getShiftedSignal(int component, int iFreq);
00054   inline Complex getSignalSpectrum(int component, int iFreq);
00055   inline Complex& getShift(int offset) {return _shift[ offset ];}
00056   inline Complex& getShift() {return _currentShift;}
00057 
00058   bool isSelected() const {return _selected;}
00059   void select(bool s) {_selected=s;}
00060 protected:
00061   Complex * _shift;
00062   Complex _currentShift;
00063   Point2D _relativeCoordinates;
00064   bool _selected;
00065 };
00066 
00067 inline Complex FKStationSignals::getShiftedSignal(int component, int iFreq, int offset)
00068 {
00069   Complex spec(processed(component)->complex(processedSamples(component), iFreq) );
00070   spec *= _shift[ offset ];
00071   return spec;
00072 }
00073 
00074 inline Complex FKStationSignals::getShiftedSignal(int component, int iFreq)
00075 {
00076   Complex spec(processed(component)->complex(processedSamples(component), iFreq) );
00077   spec *= _currentShift;
00078   return spec;
00079 }
00080 
00081 inline Complex FKStationSignals::getSignalSpectrum(int component, int iFreq)
00082 {
00083   return Complex(processed(component)->complex(processedSamples(component), iFreq) );
00084 }
00085 
00086 inline void FKStationSignals::setCurrentShift(double kx, double ky)
00087 {
00088   _currentShift.setUnitExp(kx * _relativeCoordinates.x() + ky * _relativeCoordinates.y());
00089 }
00090 
00091 } // namespace ArrayCore
00092 
00093 #endif // FKSTATIONSIGNALS_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines