labplot  2.8.2
About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.
  Fossies Dox: labplot-2.8.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

nsl_dft.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : nsl_dft.h
3  Project : LabPlot
4  Description : NSL discrete Fourier transform functions
5  --------------------------------------------------------------------
6  Copyright : (C) 2016 by Stefan Gerlach (stefan.gerlach@uni.kn)
7 
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  * This program is distributed in the hope that it will be useful, *
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
20  * GNU General Public License for more details. *
21  * *
22  * You should have received a copy of the GNU General Public License *
23  * along with this program; if not, write to the Free Software *
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
25  * Boston, MA 02110-1301 USA *
26  * *
27  ***************************************************************************/
28 
29 #ifndef NSL_DFT_H
30 #define NSL_DFT_H
31 
32 #include <stdlib.h>
33 #include "nsl_sf_window.h"
34 
35 /* DFT result type:
36  real = x
37  imag = y
38  magnitude = sqrt(x^2+y^2)
39  amplitude = magnitude/n
40  power = (x^2+y^2)/n aka periodigram, SSA
41  phase = atan(y/x)
42  dB = 20.*log_10(amplitude)
43  normdB = dB - max(dB)
44  squaremagnitude = magnitude^2
45  squareamplitude = amplitude^2 aka MSA
46  raw = halfcomplex GSL output (TODO: FFTW)
47  TODO: PSD (aka TISA), normdB
48  */
49 #define NSL_DFT_RESULT_TYPE_COUNT 11
53 extern const char* nsl_dft_result_type_name[];
54 /* x axis scaling */
55 #define NSL_DFT_XSCALE_COUNT 3
57 extern const char* nsl_dft_xscale_name[];
58 
59 /* transform data of size n. result in data
60  calculates the two-sided DFT
61 */
62 int nsl_dft_transform(double data[], size_t stride, size_t n, int two_sided, nsl_dft_result_type type);
63 /* windowed version */
64 int nsl_dft_transform_window(double data[], size_t stride, size_t n, int two_sided, nsl_dft_result_type type, nsl_sf_window_type window);
65 
66 #endif /* NSL_DFT_H */
const char * nsl_dft_xscale_name[]
Definition: nsl_dft.c:39
nsl_dft_result_type
Definition: nsl_dft.h:50
@ nsl_dft_result_squareamplitude
Definition: nsl_dft.h:51
@ nsl_dft_result_raw
Definition: nsl_dft.h:52
@ nsl_dft_result_real
Definition: nsl_dft.h:50
@ nsl_dft_result_phase
Definition: nsl_dft.h:51
@ nsl_dft_result_normdB
Definition: nsl_dft.h:51
@ nsl_dft_result_imag
Definition: nsl_dft.h:50
@ nsl_dft_result_dB
Definition: nsl_dft.h:51
@ nsl_dft_result_magnitude
Definition: nsl_dft.h:50
@ nsl_dft_result_power
Definition: nsl_dft.h:50
@ nsl_dft_result_amplitude
Definition: nsl_dft.h:50
@ nsl_dft_result_squaremagnitude
Definition: nsl_dft.h:51
const char * nsl_dft_result_type_name[]
Definition: nsl_dft.c:37
nsl_dft_xscale
Definition: nsl_dft.h:56
@ nsl_dft_xscale_index
Definition: nsl_dft.h:56
@ nsl_dft_xscale_frequency
Definition: nsl_dft.h:56
@ nsl_dft_xscale_period
Definition: nsl_dft.h:56
int nsl_dft_transform(double data[], size_t stride, size_t n, int two_sided, nsl_dft_result_type type)
Definition: nsl_dft.c:52
int nsl_dft_transform_window(double data[], size_t stride, size_t n, int two_sided, nsl_dft_result_type type, nsl_sf_window_type window)
Definition: nsl_dft.c:41
nsl_sf_window_type
Definition: nsl_sf_window.h:35