[4e81ae]: examples / ffft.h  Maximize  Restore  History

Download this file

93 lines (68 with data), 2.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
Copyright (C) 2001-2003 Motorola Inc
Copyright (C) 2001-2003 Laurent Mazet
Copyright (C) 2003 David Bateman
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, 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; see the file COPYING. If not, see
<http://www.gnu.org/licenses/>.
In addition to the terms of the GPL, you are permitted to link
this program with any Open Source program, as defined by the
Open Source Initiative (www.opensource.org)
*/
#if !defined (ffft_h)
#define ffft_h 1
#include "fixed.h"
template <class S, class C, class CV>
class Fft
{
private :
int size;
S output_gain;
int output_gain_fp;
S inv_sqrt_2;
Complex j_complex;
Array<int> sort;
CV twiddle;
C apc, amc, bpd, bmd;
void computetemplatevalues (const unsigned int &is = 0,
const unsigned int &ds = 0);
void generatetwiddle (const unsigned int &is = 0,
const unsigned int &ds = 0);
S reshape (S t);
C reshape (C t);
void normalize (CV &x);
void generatesort ();
void corebutterfly (C &u, C &x, C &y, C &z);
void r4butterfly0 (C &u, C &x, C &y, C &z);
void r4butterfly1 (C &u, C &x, C &y, C &z, int n);
void r4butterfly2 (C &u, C &x, C &y, C &z);
void r4butterfly3 (C &u, C &x, C &y, C &z, int n);
void r4butterfly4 (C &u, C &x, C &y, C &z, int n);
void radix4fft (CV &x);
CV sortingfft (CV &x);
public :
Fft (const int &n = 64, const unsigned int &is = 0,
const unsigned int &ds = 0);
CV process (CV &x);
};
template <class S, class C, class CV>
class Ifft : Fft<S,C,CV> {
public :
Ifft (const int &n = 64, const unsigned int &is = 0,
const unsigned int &ds = 0) : Fft<S, C, CV> (n, is, ds) {};
CV process (CV &x);
};
#endif
/*
;;; Local Variables: ***
;;; mode: C++ ***
;;; End: ***
*/

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks