All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Types | Public Member Functions
GeopsyCore::FilterParameters Class Reference

Brief description of class still missing. More...

#include <FilterParameters.h>

Inheritance diagram for GeopsyCore::FilterParameters:
QGpCoreTools::AbstractParameters

List of all members.

Public Types

enum  Band { LowPass, HighPass, BandPass, BandReject }
enum  Method { Butterworth, Convolution }

Public Member Functions

Band band () const
QString bandString () const
bool causal () const
virtual void collectKeywords (PARAMETERS_COLLECTKEYWORDS_ARGS)
const TaperParametersconvolutionWindow () const
TaperParametersconvolutionWindow ()
 FilterParameters ()
 FilterParameters (const FilterParameters &o)
virtual int keywordCount (PARAMETERS_KEYWORDCOUNT_ARGS)
double maximumFrequency () const
Method method () const
QString methodString () const
double minimumFrequency () const
int order () const
void setBand (Band b)
void setBand (const QString &b)
void setCausal (bool s)
void setMaximumFrequency (double f)
void setMethod (Method m)
void setMethod (const QString &m)
void setMinimumFrequency (double f)
void setOrder (int o)
virtual bool setValue (PARAMETERS_SETVALUE_ARGS)
void setWidth (double w)
void sort ()
virtual QString toString (PARAMETERS_TOSTRING_ARGS_DECL) const
double width () const

Detailed Description

Brief description of class still missing.

Full description of class still missing


Member Enumeration Documentation

Enumerator:
LowPass 
HighPass 
BandPass 
BandReject 
Enumerator:
Butterworth 
Convolution 

Constructor & Destructor Documentation

References Convolution, and LowPass.

  {
    _fmin=1.0;
    _fmax=1.0;
    _band=LowPass;
    _method=Convolution;
    _width=0.1;
  }
    : AbstractParameters()
  {
    _fmin=o._fmin;
    _fmax=o._fmax;
    _band=o._band;
    _method=o._method;
    _order=o._order;
    _window=o._window;
    _width=o._width;
  }

Member Function Documentation

References BandPass, BandReject, HighPass, and LowPass.

Referenced by GeopsyCore::SignalProcess::filter(), and toString().

  {
    switch(_band) {
    case LowPass:
      break;
    case HighPass:
      return "HighPass";
    case BandPass:
      return "BandPass";
    case BandReject:
      return "BandReject";
    }
    return "LowPass";
  }
bool GeopsyCore::FilterParameters::causal ( ) const [inline]

Referenced by GeopsyGui::FilterParameterWidget::setParameters(), and toString().

{return _order>0;}

Reimplemented from QGpCoreTools::AbstractParameters.

References GeopsyCore::TaperParameters::collectKeywords(), and TRACE.

Referenced by Parameters::collectKeywords(), and GeopsyCore::WindowingParameters::collectKeywords().

  {
    TRACE;
    keywords.add(prefix+"FILTER TYPE", this, 0);
    keywords.add(prefix+"FILTER METHOD", this, 1);
    keywords.add(prefix+"FILTER MIN FREQUENCY", this, 2);
    keywords.add(prefix+"FILTER MAX FREQUENCY", this, 3);
    keywords.add(prefix+"FILTER CAUSAL", this, 4);
    keywords.add(prefix+"FILTER ORDER", this, 5);
    keywords.add(prefix+"FILTER WIDTH", this, 6);
    _window.collectKeywords(keywords, prefix);
  }
{return _window;}

Reimplemented from QGpCoreTools::AbstractParameters.

  {
    return 7;
  }

References Butterworth.

Referenced by GeopsyCore::SignalProcess::filter(), and toString().

  {
    switch(_method) {
    case Butterworth:
      break;
    case Convolution:
      return "Convolution";
    }
    return "Butterworth";
  }
int GeopsyCore::FilterParameters::order ( ) const [inline]
void GeopsyCore::FilterParameters::setBand ( const QString &  b)

References BandPass, BandReject, HighPass, and LowPass.

  {
    if(!b.isEmpty()) {
      QString bl=b.toLower();
      switch(bl[0].unicode()) {
      case 'l':
        _band=LowPass ;
        break;
      case 'h':
        _band=HighPass;
        break;
      case 'b':
        if(bl=="bandpass" ||
           bl=="band pass") {   // For compatibility
          _band=BandPass;
        } else if(bl=="bandreject" ||
                  bl=="band reject") {   // For compatibility){
          _band=BandReject;
        }
        break;
      default:
        break;
      }
    }
  }
void GeopsyCore::FilterParameters::setCausal ( bool  s) [inline]
void GeopsyCore::FilterParameters::setMethod ( const QString &  m)

References Butterworth, Convolution, QGpCoreTools::endl(), and QGpCoreTools::tr().

  {
    if(!m.isEmpty()) {
      QString ml=m.toLower();
      switch(ml[0].unicode()) {
      case 'b':
        if(ml=="butterworth") {
          _method=Butterworth;
          return;
        }
        break;
      case 'c':
        if(ml=="convolution" ||
           ml=="cosineTaper") {    // For compatibility
          _method=Convolution;
          return;
        }
        break;
      default:
        break;
      }
    }
    App::stream() << tr("Bad filter method '%1'.").arg(m) << endl;
  }
void GeopsyCore::FilterParameters::setOrder ( int  o) [inline]

Reimplemented from QGpCoreTools::AbstractParameters.

References setBand(), setCausal(), setMethod(), setOrder(), and TRACE.

  {
    TRACE;
    switch(index) {
    case 0:
      setBand(value);
      return true;
    case 1:
      setMethod(value);
      return true;
    case 2:
      _fmin=value.toDouble();
      return true;
    case 3:
      _fmax=value.toDouble();
      return true;
    case 4:
      setCausal(value=="y");
      return true;
    case 5:
      setOrder(value.toInt());
      return true;
    default:
      return false;
    }
  }
void GeopsyCore::FilterParameters::setWidth ( double  w) [inline]

Referenced by GeopsyGui::FilterParameterWidget::getParameters().

  {
    if(_fmin > _fmax) {
      qSwap(_fmin, _fmax);
    }
  }

Reimplemented from QGpCoreTools::AbstractParameters.

References bandString(), Butterworth, causal(), QGpCoreTools::log(), methodString(), GeopsyCore::TaperParameters::toString(), and TRACE.

Referenced by Parameters::toString(), and GeopsyCore::WindowingParameters::toString().

  {
    TRACE;
    QString log;
    log+=prefix+"FILTER TYPE="+bandString()+"\n";
    log+=prefix+"FILTER METHOD="+methodString()+"\n";
    log+=prefix+"FILTER MIN FREQUENCY (Hz)="+QString::number(_fmin)+"\n";
    log+=prefix+"FILTER MAX FREQUENCY (Hz)="+QString::number(_fmax)+"\n";
    switch(_method) {
    case Butterworth:
      log+=prefix+"FILTER CAUSAL (y/n)="+(causal() ? "y" : "n")+"\n";
      log+=prefix+"FILTER ORDER="+QString::number(_order)+"\n";
      break;
    case Convolution:
      log+=_window.toString(prefix+"FILTER ");
      log+=prefix+"FILTER WIDTH="+QString::number(_width);
      break;
    }
    return log;
  }
double GeopsyCore::FilterParameters::width ( ) const [inline]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines