QtiPlot  0.9.8.2
FFT.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : FFT.h
3  Project : QtiPlot
4  --------------------------------------------------------------------
5  Copyright : (C) 2007 - 2010 by Ion Vasilief
6  Email (use @ for *) : ion_vasilief*yahoo.fr
7  Description : Numerical FFT of data sets
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the Free Software *
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26  * Boston, MA 02110-1301 USA *
27  * *
28  ***************************************************************************/
29 #ifndef FFT_H
30 #define FFT_H
31 
32 #include "Filter.h"
33 
34 class FFT : public Filter
35 {
36 Q_OBJECT
37 
38 public:
39  FFT(ApplicationWindow *parent, Table *t, const QString& realColName, const QString& imagColName = QString(), int from = 1, int to = -1);
40  FFT(ApplicationWindow *parent, QwtPlotCurve *c);
41  FFT(ApplicationWindow *parent, QwtPlotCurve *c, double start, double end);
42  FFT(ApplicationWindow *parent, Graph *g, const QString& curveTitle);
43  FFT(ApplicationWindow *parent, Graph *g, const QString& curveTitle, double start, double end);
44  FFT(ApplicationWindow *parent, Matrix *re, Matrix *im = NULL, bool inverse = false, bool shift = true, bool norm = false, bool outputPower2Sizes = true);
45 
46  void setInverseFFT(bool inverse = true){d_inverse = inverse;};
47  void setSampling(double sampling){d_sampling = sampling;};
48  void normalizeAmplitudes(bool norm = true){d_normalize = norm;};
49  void shiftFrequencies(bool shift = true){d_shift_order = shift;};
50 
54 
55  bool setDataFromTable(Table *t, const QString& realColName, const QString& imagColName = QString(), int from = 0, int to = -1, bool unused = false);
56 
57 private:
58  void init();
59  void output();
60  void outputGraphs();
61  void fftCurve();
62  void fftTable();
63  void fftMatrix();
64 
65  double d_sampling;
67  bool d_inverse;
72 
74 
79  bool d_power2;
80 };
81 
82 #endif
void fftTable()
Definition: FFT.cpp:191
void output()
Performs the data analysis and takes care of the output.
Definition: FFT.cpp:251
Matrix * d_im_out_matrix
Definition: FFT.h:77
A 2D-plotting widget.
Definition: Graph.h:123
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
Abstract base class for data analysis operations.
Definition: Filter.h:43
void setInverseFFT(bool inverse=true)
Definition: FFT.h:46
Matrix * imaginaryOutputMatrix()
Definition: FFT.h:53
QtiPlot's main window.
Definition: ApplicationWindow.h:133
Definition: FFT.h:34
bool d_power2
Definition: FFT.h:79
void outputGraphs()
Definition: FFT.cpp:288
int d_real_col
Definition: FFT.h:73
Matrix worksheet class.
Definition: Matrix.h:57
Matrix * d_re_out_matrix
Definition: FFT.h:76
Matrix * d_im_matrix
Definition: FFT.h:75
void shiftFrequencies(bool shift=true)
Definition: FFT.h:49
void fftCurve()
Definition: FFT.cpp:108
void setSampling(double sampling)
Definition: FFT.h:47
Matrix * d_amp_matrix
Definition: FFT.h:78
bool setDataFromTable(Table *t, const QString &realColName, const QString &imagColName=QString(), int from=0, int to=-1, bool unused=false)
Definition: FFT.cpp:356
bool d_normalize
Flag telling if the amplitudes in the output spectrum must be normalized.
Definition: FFT.h:69
FFT(ApplicationWindow *parent, Table *t, const QString &realColName, const QString &imagColName=QString(), int from=1, int to=-1)
Definition: FFT.cpp:42
bool d_inverse
Flag telling if an inverse FFT must be performed.
Definition: FFT.h:67
Matrix * realOutputMatrix()
Definition: FFT.h:52
int d_imag_col
Definition: FFT.h:73
Matrix * amplitudesMatrix()
Definition: FFT.h:51
MDI window providing a spreadsheet table with column logic.
Definition: Table.h:57
void fftMatrix()
Definition: FFT.cpp:420
void init()
Definition: FFT.cpp:92
void normalizeAmplitudes(bool norm=true)
Definition: FFT.h:48
double d_sampling
Definition: FFT.h:65