1 ## Copyright (C) 2015 Loriane Weber
3 ## This program is free software; you can redistribute it and/or modify
4 ## it under the terms of the GNU General Public License as published by
5 ## the Free Software Foundation; either version 3 of the License, or
6 ## (at your option) any later version.
8 ## This program is distributed in the hope that it will be useful,
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ## GNU General Public License for more details.
13 ## You should have received a copy of the GNU General Public License
14 ## along with Octave; see the file COPYING. If not, see
15 ## <http://www.gnu.org/licenses/>.
19 ## Author: Loriane Weber <lweber@hpc2-0601>
20 ## Created: 2015-07-01
23 function Id = FresnelTransform_2D(ph, B, D, lambda, oversamp, ftot, gtot)
29 if (m_a != m || n_a != n)
30 disp('error in the dimensions !! Phi and B should have the same dimension')
34 u = exp(-B).*exp(+i.*ph);
36 % propagator for the distance D
37 Pd = exp(-i*pi*lambda*D*(ftot.^2+gtot.^2)); % ifftshift
53 Idd = conv2(Id,ipf,'same')./conv2(ones(size(Id)),ipf,'same');
54 Idd = Idd(oversamp:oversamp:end, oversamp:oversamp:end);
58 ipf = [0.25 0.5 0.5 0.5 0.25;
59 0.50 1.0 1.0 1.0 0.50;
60 0.50 1.0 1.0 1.0 0.50;
61 0.50 1.0 1.0 1.0 0.50;
62 0.25 0.5 0.5 0.5 0.25];
63 Idd = conv2(Id,ipf,'same')./conv2(ones(size(Id)),ipf,'same');
64 Idd = Idd(oversamp:oversamp:end, oversamp:oversamp:end);
66 end % end binning detector