source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/ffw/provatempo2.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 2.8 KB
Line 
1clc;clear;
2
3
4Lmax    = 2048;
5Lmin    = 3;
6
7FFTrv  = zeros(Lmax,1);
8FFTiv  = zeros(Lmax,1);
9IFFTiv = zeros(Lmax,1);
10
11% If you want to modify/add new data simply comment/decomment the
12% corresponding lines.
13% load fftexecutiontimes
14
15tempomin   = 3;
16incremento = 10;
17tsoglia    = 1;
18volte0     = 1000000;
19aggiunta   = 5000;
20for L=Lmin:Lmax
21    disp('---');
22    disp('Volte0');
23    disp(volte0);
24    disp('---');
25    a = rand(L,1);
26    b = rand(L,1)+i*rand(L,1);
27    disp('**************************************************************');
28    %----------------------------------------------------------------------
29    volte = volte0;
30    tempo = 0;
31    while tempo<tempomin
32        disp('C');
33        tic;
34        for ii=1:volte
35            fft(a);
36        end
37        tempo = toc;
38        volteeffettive = volte;
39        % volte updating
40        if tempo<tsoglia
41            volte = volte*incremento;
42        else
43            volte = round(volte*tempomin/tempo)+aggiunta;
44        end
45    end
46    tmedio               = tempo/volteeffettive;
47    FFTrv(L) = tmedio;
48    disp('Length FFT real');
49    disp(L);
50    disp('Avg time');
51    disp(tmedio);
52    disp('Total time');
53    disp(tempo);
54    %--------------
55    voltesalva = round(volteeffettive*tempomin/tempo);
56    %----------------------------------------------------------------------
57    volte = volte0;
58    tempo = 0;
59    while tempo<tempomin
60        disp('C');
61        tic;
62        for ii=1:volte
63            fft(b);
64        end
65        tempo = toc;
66        volteeffettive = volte;
67        % volte updating
68        if tempo<tsoglia
69            volte = volte*incremento;
70        else
71            volte = round(volte*tempomin/tempo)+aggiunta;
72        end
73    end
74    tmedio                   = tempo/volteeffettive;
75    FFTiv(L) = tmedio;
76    disp('Length FFT complex');
77    disp(L);
78    disp('Avg time');
79    disp(tmedio);
80    disp('Total time');
81    disp(tempo);
82    %----------------------------------------------------------------------
83    volte = volte0;
84    tempo = 0;
85    while tempo<tempomin
86        disp('C');
87        tic;
88        for ii=1:volte
89            ifft(b);
90        end
91        tempo = toc;
92        volteeffettive = volte;
93        % volte updating
94        if tempo<tsoglia
95            volte = volte*incremento;
96        else
97            volte = round(volte*tempomin/tempo)+aggiunta;
98        end
99    end
100    tmedio                    = tempo/volteeffettive;
101    IFFTiv(L) = tmedio;
102    disp('Length IFFT complex');
103    disp(L);
104    disp('Avg time');
105    disp(tmedio);
106    disp('Total time');
107    disp(tempo);
108    %----------------------------------------------------------------------
109    if (mod(L,100)==0) ||(L==Lmax)
110        save fftexecutiontimes FFTrv FFTiv IFFTiv
111    end
112    volte0 = round(voltesalva*1.25);
113    if volte0<2000
114        volte0 = 2000;
115    end
116end
Note: See TracBrowser for help on using the repository browser.