Rev | Line | |
---|
[37] | 1 | clc;clear; |
---|
| 2 | |
---|
| 3 | |
---|
| 4 | Lmax = 2048; |
---|
| 5 | Lmin = 3; |
---|
| 6 | |
---|
| 7 | FFTrv = zeros(Lmax,1); |
---|
| 8 | FFTiv = zeros(Lmax,1); |
---|
| 9 | IFFTiv = zeros(Lmax,1); |
---|
| 10 | |
---|
| 11 | % If you want to modify/add new data simply comment/decomment the |
---|
| 12 | % corresponding lines. |
---|
| 13 | % load fftexecutiontimes |
---|
| 14 | |
---|
| 15 | tempomin = 3; |
---|
| 16 | incremento = 10; |
---|
| 17 | tsoglia = 1; |
---|
| 18 | volte0 = 1000000; |
---|
| 19 | aggiunta = 5000; |
---|
| 20 | for 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 |
---|
| 116 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.