Last change
on this file since 460 was 460, checked in by ansari, 26 years ago |
Importation de programme test FFT - A. Kim, G. Le Meur 12/10/99
|
File size:
1.2 KB
|
Line | |
---|
1 | #include <math.h>
|
---|
2 | #include <iostream.h>
|
---|
3 |
|
---|
4 | #include "fftserver.h"
|
---|
5 | #include "nobjmgr.h"
|
---|
6 |
|
---|
7 | extern "C" {
|
---|
8 | void tfft(vector<string>& args);
|
---|
9 | }
|
---|
10 |
|
---|
11 | int main(int narg, char* arg)
|
---|
12 | {
|
---|
13 | vector<string> a;
|
---|
14 | string str = "nopiapp";
|
---|
15 | a.push_back(str);
|
---|
16 |
|
---|
17 | cout << "Appel de tfft ( " << a[0] << " ) " << endl;
|
---|
18 | tfft(a);
|
---|
19 | exit(0);
|
---|
20 | }
|
---|
21 |
|
---|
22 | void tfft(vector<string>& args)
|
---|
23 | {
|
---|
24 |
|
---|
25 | int num=30;
|
---|
26 | double tper = 2./num;
|
---|
27 | /* Vector* inp = new Vector(num);
|
---|
28 | Vector* outp = new Vector(num);
|
---|
29 |
|
---|
30 | Vector& in = (*inp);
|
---|
31 | Vector& out = (*outp);*/
|
---|
32 |
|
---|
33 | complex<double>* in = new complex<double>[num];
|
---|
34 |
|
---|
35 |
|
---|
36 | for (int i=0; i<num ; i++){ in[i] = complex<double> (cos(i*3.141596*tper),cos(3.*i*3.141596*tper));}
|
---|
37 | cout << "Input / L = " << num << endl;
|
---|
38 | for (int i=0; i<num ; i++){
|
---|
39 | if (i%8 == 0) cout << "\n" << i << "-" << i+7 << " : " ;
|
---|
40 | cout << in[i] << " " ;
|
---|
41 | }
|
---|
42 | cout << endl;
|
---|
43 |
|
---|
44 | FFTServer ffts;
|
---|
45 | ffts.fftf(num,in);
|
---|
46 |
|
---|
47 | cout << "Output / L = " << num << endl;
|
---|
48 | for (int i=0; i<num ; i++){
|
---|
49 | if (i%8 == 0) cout << "\n" << i << "-" << i+7 << " : " ;
|
---|
50 | cout << in[i] << " " ;
|
---|
51 | }
|
---|
52 | cout << endl;
|
---|
53 |
|
---|
54 | /* if (args[0] == "nopiapp") return;
|
---|
55 | NamedObjMgr omg;
|
---|
56 | string nom;
|
---|
57 | nom = "vin";
|
---|
58 | omg.AddObj(&in, nom);
|
---|
59 | nom = "vout";
|
---|
60 | omg.AddObj(&out, nom);*/
|
---|
61 |
|
---|
62 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.