FFT.h
Go to the documentation of this file.
/***************************************************************************
File : FFT.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2007 - 2010 by Ion Vasilief
Email (use @ for *) : ion_vasilief*yahoo.fr
Description : Numerical FFT 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 FFT_H
#define FFT_H
#include "Filter.h"
class FFT : public Filter
{
Q_OBJECT
public:
FFT(ApplicationWindow *parent, Table *t, const QString& realColName, const QString& imagColName = QString(), int from = 1, int to = -1);
FFT(ApplicationWindow *parent, QwtPlotCurve *c);
FFT(ApplicationWindow *parent, QwtPlotCurve *c, double start, double end);
FFT(ApplicationWindow *parent, Graph *g, const QString& curveTitle);
FFT(ApplicationWindow *parent, Graph *g, const QString& curveTitle, double start, double end);
FFT(ApplicationWindow *parent, Matrix *re, Matrix *im = NULL, bool inverse = false, bool shift = true, bool norm = false, bool outputPower2Sizes = true);
void setInverseFFT(bool inverse = true){d_inverse = inverse;};
void setSampling(double sampling){d_sampling = sampling;};
void normalizeAmplitudes(bool norm = true){d_normalize = norm;};
void shiftFrequencies(bool shift = true){d_shift_order = shift;};
Matrix *amplitudesMatrix(){return d_amp_matrix;}
Matrix *realOutputMatrix(){return d_re_out_matrix;}
Matrix *imaginaryOutputMatrix(){return d_im_out_matrix;}
bool setDataFromTable(Table *t, const QString& realColName, const QString& imagColName = QString(), int from = 0, int to = -1, bool unused = false);
private:
void init();
void output();
void outputGraphs();
void fftCurve();
void fftTable();
void fftMatrix();
double d_sampling;
bool d_inverse;
bool d_normalize;
bool d_shift_order;
int d_real_col, d_imag_col;
Matrix *d_im_matrix;
Matrix *d_re_out_matrix;
Matrix *d_im_out_matrix;
Matrix *d_amp_matrix;
bool d_power2;
};
#endif
FFT::fftTable
void fftTable()
Definition: FFT.cpp:191
FFT::output
void output()
Performs the data analysis and takes care of the output.
Definition: FFT.cpp:251
FFT::d_im_out_matrix
Matrix * d_im_out_matrix
Definition: FFT.h:77
Graph
A 2D-plotting widget.
Definition: Graph.h:123
FFT::d_shift_order
bool d_shift_order
Flag telling if the output frequencies must be shifted in order to have a zero-centered spectrum...
Definition: FFT.h:71
Filter
Abstract base class for data analysis operations.
Definition: Filter.h:43
Filter.h
FFT::setInverseFFT
void setInverseFFT(bool inverse=true)
Definition: FFT.h:46
FFT::imaginaryOutputMatrix
Matrix * imaginaryOutputMatrix()
Definition: FFT.h:53
ApplicationWindow
QtiPlot's main window.
Definition: ApplicationWindow.h:133
FFT
Definition: FFT.h:34
FFT::d_power2
bool d_power2
Definition: FFT.h:79
FFT::outputGraphs
void outputGraphs()
Definition: FFT.cpp:288
FFT::d_real_col
int d_real_col
Definition: FFT.h:73
Matrix
Matrix worksheet class.
Definition: Matrix.h:57
FFT::d_re_out_matrix
Matrix * d_re_out_matrix
Definition: FFT.h:76
FFT::d_im_matrix
Matrix * d_im_matrix
Definition: FFT.h:75
FFT::shiftFrequencies
void shiftFrequencies(bool shift=true)
Definition: FFT.h:49
FFT::fftCurve
void fftCurve()
Definition: FFT.cpp:108
FFT::setSampling
void setSampling(double sampling)
Definition: FFT.h:47
FFT::d_amp_matrix
Matrix * d_amp_matrix
Definition: FFT.h:78
FFT::setDataFromTable
bool setDataFromTable(Table *t, const QString &realColName, const QString &imagColName=QString(), int from=0, int to=-1, bool unused=false)
Definition: FFT.cpp:356
FFT::d_normalize
bool d_normalize
Flag telling if the amplitudes in the output spectrum must be normalized.
Definition: FFT.h:69
FFT::FFT
FFT(ApplicationWindow *parent, Table *t, const QString &realColName, const QString &imagColName=QString(), int from=1, int to=-1)
Definition: FFT.cpp:42
FFT::d_inverse
bool d_inverse
Flag telling if an inverse FFT must be performed.
Definition: FFT.h:67
FFT::realOutputMatrix
Matrix * realOutputMatrix()
Definition: FFT.h:52
FFT::d_imag_col
int d_imag_col
Definition: FFT.h:73
FFT::amplitudesMatrix
Matrix * amplitudesMatrix()
Definition: FFT.h:51
Table
MDI window providing a spreadsheet table with column logic.
Definition: Table.h:57
FFT::fftMatrix
void fftMatrix()
Definition: FFT.cpp:420
FFT::init
void init()
Definition: FFT.cpp:92
FFT::normalizeAmplitudes
void normalizeAmplitudes(bool norm=true)
Definition: FFT.h:48
FFT::d_sampling
double d_sampling
Definition: FFT.h:65