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 private:
56  void init();
57  void output();
58  void outputGraphs();
59  void fftCurve();
60  void fftTable();
61  void fftMatrix();
62 
63  bool setDataFromTable(Table *t, const QString& realColName, const QString& imagColName = QString(), int from = 0, int to = -1);
64 
65  double d_sampling;
67  bool d_inverse;
72 
74 
79  bool d_power2;
80 };
81 
82 #endif