FFTFilter.h
Go to the documentation of this file.
/***************************************************************************
File : FFTFilter.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2007 by Ion Vasilief
Email (use @ for *) : ion_vasilief*yahoo.fr
Description : Numerical FFT filtering of data sets
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
***************************************************************************/
#ifndef FFTFILTER_H
#define FFTFILTER_H
#include "Filter.h"
class FFTFilter : public Filter
{
Q_OBJECT
public:
FFTFilter(ApplicationWindow *parent, QwtPlotCurve *c, int m = 1);
FFTFilter(ApplicationWindow *parent, QwtPlotCurve *c, double start, double end, int m = 1);
FFTFilter(ApplicationWindow *parent, Graph *g, const QString& curveTitle, int m = 1);
FFTFilter(ApplicationWindow *parent, Graph *g, const QString& curveTitle, double start, double end, int m = 1);
FFTFilter(ApplicationWindow *parent, Table *t, const QString& xCol, const QString& yCol, int start = 0, int end = -1, int m = 1);
enum FilterType{LowPass = 1, HighPass = 2, BandPass = 3, BandBlock = 4};
void setFilterType(int type);
void setCutoff(double f);
void setBand(double lowFreq, double highFreq);
void enableOffset(bool offset = true){d_offset = offset;};
private:
void init(int m);
void calculateOutputData(double *x, double *y);
FilterType d_filter_type;
double d_low_freq;
double d_high_freq;
bool d_offset;
};
#endif
FFTFilter::d_filter_type
FilterType d_filter_type
The filter type.
Definition: FFTFilter.h:63
Graph
A 2D-plotting widget.
Definition: Graph.h:123
FFTFilter::setCutoff
void setCutoff(double f)
Sets the cutoff frequency. To be used only for Low Pass and High Pass filters.
Definition: FFTFilter.cpp:95
FFTFilter::BandPass
Definition: FFTFilter.h:45
FFTFilter::d_offset
bool d_offset
Flag telling if the DC offset must be added/substracted when applying a Band Pass/Band block filter r...
Definition: FFTFilter.h:72
FFTFilter::calculateOutputData
void calculateOutputData(double *x, double *y)
Calculates the data for the output curve and store it in the X an Y vectors.
Definition: FFTFilter.cpp:127
Filter
Abstract base class for data analysis operations.
Definition: Filter.h:43
Filter.h
FFTFilter::d_high_freq
double d_high_freq
Upper edge of the band for Band Pass and Band block filters.
Definition: FFTFilter.h:69
FFTFilter::HighPass
Definition: FFTFilter.h:45
Filter::init
void init()
Definition: Filter.cpp:79
FFTFilter::FFTFilter
FFTFilter(ApplicationWindow *parent, QwtPlotCurve *c, int m=1)
Definition: FFTFilter.cpp:36
FFTFilter::FilterType
FilterType
Definition: FFTFilter.h:45
ApplicationWindow
QtiPlot&#39;s main window.
Definition: ApplicationWindow.h:133
FFTFilter::setFilterType
void setFilterType(int type)
Definition: FFTFilter.cpp:83
FFTFilter::setBand
void setBand(double lowFreq, double highFreq)
Sets the cutoff frequencies. To be used only for the Band Pass and Band block filters.
Definition: FFTFilter.cpp:103
FFTFilter::BandBlock
Definition: FFTFilter.h:45
FFTFilter::enableOffset
void enableOffset(bool offset=true)
Enables/Disables the DC offset when applying a Band Pass/Band block filter.
Definition: FFTFilter.h:56
FFTFilter::d_low_freq
double d_low_freq
Cutoff frequency for Low Pass and High Pass filters. Lower edge of the band for Band Pass and Band bl...
Definition: FFTFilter.h:66
FFTFilter
Definition: FFTFilter.h:34
Filter::x
double * x()
Returns the x values of the input data set.
Definition: Filter.h:98
Filter::y
double * y()
Returns the y values of the input data set.
Definition: Filter.h:100
Table
MDI window providing a spreadsheet table with column logic.
Definition: Table.h:57
FFTFilter::LowPass
Definition: FFTFilter.h:45