Brief description of class still missing. More...
#include <FilterParameters.h>
Brief description of class still missing.
Full description of class still missing
{LowPass, HighPass, BandPass, BandReject};
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; }
Band GeopsyCore::FilterParameters::band | ( | ) | const [inline] |
Referenced by GeopsyCore::DoubleSignal::filter(), and GeopsyGui::FilterParameterWidget::setParameters().
{return _band;}
QString GeopsyCore::FilterParameters::bandString | ( | ) | const |
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;}
void GeopsyCore::FilterParameters::collectKeywords | ( | PARAMETERS_COLLECTKEYWORDS_ARGS | ) | [virtual] |
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); }
const TaperParameters& GeopsyCore::FilterParameters::convolutionWindow | ( | ) | const [inline] |
Referenced by GeopsyCore::DoubleSignal::decimateTime(), GeopsyCore::DoubleSignal::filter(), GeopsyGui::FilterParameterWidget::getParameters(), Process::run(), GeopsyCore::StationProcessSignals::setHighPassFilter(), GeopsyGui::FilterParameterWidget::setParameters(), and ArrayCore::SPACStationSignals::setProcessed().
{return _window;}
{return _window;}
int GeopsyCore::FilterParameters::keywordCount | ( | PARAMETERS_KEYWORDCOUNT_ARGS | ) | [virtual] |
Reimplemented from QGpCoreTools::AbstractParameters.
{
return 7;
}
double GeopsyCore::FilterParameters::maximumFrequency | ( | ) | const [inline] |
Referenced by GeopsyCore::SignalProcess::filter(), GeopsyCore::DoubleSignal::filter(), and GeopsyGui::FilterParameterWidget::setParameters().
{return _fmax;}
Method GeopsyCore::FilterParameters::method | ( | ) | const [inline] |
Referenced by GeopsyCore::SignalProcess::filter(), GeopsyCore::DoubleSignal::filter(), and GeopsyGui::FilterParameterWidget::setParameters().
{return _method;}
QString GeopsyCore::FilterParameters::methodString | ( | ) | const |
References Butterworth.
Referenced by GeopsyCore::SignalProcess::filter(), and toString().
{ switch(_method) { case Butterworth: break; case Convolution: return "Convolution"; } return "Butterworth"; }
double GeopsyCore::FilterParameters::minimumFrequency | ( | ) | const [inline] |
Referenced by GeopsyCore::SignalProcess::filter(), GeopsyCore::DoubleSignal::filter(), and GeopsyGui::FilterParameterWidget::setParameters().
{return _fmin;}
int GeopsyCore::FilterParameters::order | ( | ) | const [inline] |
Referenced by GeopsyCore::SignalProcess::filter(), GeopsyCore::DoubleSignal::filter(), and GeopsyGui::FilterParameterWidget::setParameters().
{return _order;}
void GeopsyCore::FilterParameters::setBand | ( | Band | b | ) | [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] |
References QGpCoreTools::abs().
Referenced by Station::filter1(), Station::filter2(), GeopsyGui::FilterParameterWidget::getParameters(), and setValue().
void GeopsyCore::FilterParameters::setMaximumFrequency | ( | double | f | ) | [inline] |
void GeopsyCore::FilterParameters::setMethod | ( | Method | m | ) | [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::setMinimumFrequency | ( | double | f | ) | [inline] |
void GeopsyCore::FilterParameters::setOrder | ( | int | o | ) | [inline] |
References QGpCoreTools::abs().
Referenced by Station::filter1(), Station::filter2(), GeopsyGui::FilterParameterWidget::getParameters(), and setValue().
{if(::abs(o)<16777216) _order=o;}
bool GeopsyCore::FilterParameters::setValue | ( | PARAMETERS_SETVALUE_ARGS | ) | [virtual] |
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 GeopsyCore::DoubleSignal::decimateTime(), Process::run(), and GeopsyCore::StationProcessSignals::setHighPassFilter().
{_width=w;}
void GeopsyCore::FilterParameters::sort | ( | ) |
Referenced by GeopsyGui::FilterParameterWidget::getParameters().
{
if(_fmin > _fmax) {
qSwap(_fmin, _fmax);
}
}
QString GeopsyCore::FilterParameters::toString | ( | PARAMETERS_TOSTRING_ARGS_DECL | ) | const [virtual] |
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] |
Referenced by GeopsyCore::SignalProcess::filter(), and GeopsyCore::DoubleSignal::filter().
{return _width;}