GeopsyCore/FilterParameters.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of GeopsyCore.
00004 **
00005 **  This library is free software; you can redistribute it and/or
00006 **  modify it under the terms of the GNU Lesser General Public
00007 **  License as published by the Free Software Foundation; either
00008 **  version 2.1 of the License, or (at your option) any later version.
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 Lesser General Public
00013 **  License for more details.
00014 **
00015 **  You should have received a copy of the GNU Lesser General Public
00016 **  License along with this library; if not, write to the Free Software
00017 **  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018 **
00019 **  See http://www.geopsy.org for more information.
00020 **
00021 **  Created : 2007-05-15
00022 **  Authors :
00023 **    Marc Wathelet
00024 **    Marc Wathelet (LGIT, Grenoble, France)
00025 **
00026 ***************************************************************************/
00027 
00028 #ifndef FILTERPARAMETERS_H
00029 #define FILTERPARAMETERS_H
00030 
00031 #include <QtCore>
00032 
00033 #include "GeopsyCoreDLLExport.h"
00034 #include "TaperParameters.h"
00035 
00036 namespace GeopsyCore {
00037 
00038 class GEOPSYCORE_EXPORT FilterParameters: public AbstractParameters
00039 {
00040 public:
00041   FilterParameters();
00042   FilterParameters(const FilterParameters& o);
00043 
00044   enum Band {LowPass, HighPass, BandPass, BandReject};
00045   enum Method {Butterworth, Convolution};
00046 
00047   double minimumFrequency() const {return _fmin;}
00048   void setMinimumFrequency(double f) {_fmin=f;}
00049 
00050   double maximumFrequency() const {return _fmax;}
00051   void setMaximumFrequency(double f) {_fmax=f;}
00052 
00053   void sort();
00054 
00055   Band band() const {return _band;}
00056   QString bandString() const;
00057   void setBand(Band b) {_band=b;}
00058   void setBand(const QString& b);
00059 
00060   Method method() const {return _method;}
00061   QString methodString() const;
00062   void setMethod(Method m) {_method=m;}
00063   void setMethod(const QString& m);
00064 
00065   int order() const {return _order;}
00066   void setOrder(int o) {if(::abs(o)<16777216) _order=o;}
00067 
00068   bool causal() const {return _order>0;}
00069   void setCausal(bool s) {_order=(s ? ::abs(_order) : -::abs(_order));}
00070 
00071   const TaperParameters& convolutionWindow() const {return _window;}
00072   TaperParameters& convolutionWindow() {return _window;}
00073 
00074   double width() const {return _width;}
00075   void setWidth(double w) {_width=w;}
00076 
00077   virtual void collectKeywords(PARAMETERS_COLLECTKEYWORDS_ARGS);
00078   virtual int keywordCount(PARAMETERS_KEYWORDCOUNT_ARGS);
00079   virtual bool setValue(PARAMETERS_SETVALUE_ARGS);
00080   virtual QString toString(PARAMETERS_TOSTRING_ARGS_DECL) const;
00081 private:
00082   double _fmin, _fmax;
00083   Band _band:4;
00084   Method _method:4;
00085   int _order:24;           // for Butterworth
00086   TaperParameters _window; // for Convolution
00087   double _width;
00088 };
00089 
00090 } // namespace GeopsyCore
00091 
00092 #endif // FILTERPARAMETERS_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines