Commit 0ee2bd84 authored by Leon Merten Lohse's avatar Leon Merten Lohse
Browse files

update references to fftfreq

parent 04443de4
Pipeline #103281 passed with stage
in 3 minutes and 16 seconds
......@@ -138,7 +138,7 @@ function kernel = fresnelPropagationKernel_fourier(N, fresnelNumbers, gpuFlag)
ndim = numel(N);
xi = cell([ndim,1]);
[xi{:}] = fftfreq(N, 1, false);
[xi{:}] = fftfreq(N, 1);
kernel = 1;
for dim = 1:ndim
xi{dim} = gpuArrayIf(xi{dim}, gpuFlag);
......@@ -154,7 +154,7 @@ function kernel = fresnelPropagationKernel_chirp(N, fresnelNumbers, gpuFlag)
ndim = numel(N);
x = cell([ndim,1]);
[x{:}] = fftfreq(N, 2*pi./N, false); % fft-shifted grid with spacing 1
[x{:}] = fftfreq(N, 2*pi./N); % fft-shifted grid with spacing 1
kernel = prod(sqrt(abs(fresnelNumbers)) .* exp((-1i*pi/4) .* sign(fresnelNumbers)));
for dim = 1:ndim
x{dim} = gpuArrayIf(x{dim}, gpuFlag);
......@@ -170,7 +170,7 @@ function kernel = fresnelPropagationKernel_chirpLimited(N, fresnelNumbers, gpuFl
ndim = numel(N);
x = cell([ndim,1]);
[x{:}] = fftfreq(N, 2*pi./N, false); % fft-shifted grid with spacing 1
[x{:}] = fftfreq(N, 2*pi./N); % fft-shifted grid with spacing 1
kernel = prod(sqrt(abs(fresnelNumbers)) .* exp((-1i*pi/4) .* sign(fresnelNumbers)));
for dim = 1:ndim
x{dim} = gpuArrayIf(x{dim}, gpuFlag);
......@@ -196,7 +196,7 @@ function kernel = fresnelPropagationKernel_pixel2pixel(N, fresnelNumbers, gpuFla
ndim = numel(N);
x = cell([ndim,1]);
[x{:}] = fftfreq(N, 2*pi./N, false); % fft-shifted grid with spacing 1
[x{:}] = fftfreq(N, 2*pi./N); % fft-shifted grid with spacing 1
kernel = 1;
for dim = 1:ndim
x{dim} = gpuArrayIf(x{dim}, gpuFlag);
......
......@@ -28,8 +28,8 @@ function [averages, radii] = angularAverage(im)
%
% N = [1024,1024];
% fresnel = 1e-2;
% [xi_1,xi_2] = fftfreq(N, 1, true);
% ctf = fftshift(sin((xi_1.^2 + xi_2.^2)/(4*pi*fresnel)));
% xi2 = fftfreqNormSq(N, 1);
% ctf = fftshift(sin(xi2/(4*pi*fresnel)));
% [ctfAveraged, radii] = angularAverage(ctf);
%
% figure('name', 'image'); imagesc(ctf); colorbar;
......
......@@ -29,7 +29,7 @@ end
ndim = numel(sizeHolo);
xi = cell([ndim,1]);
[xi{:}] = fftfreq(sizeHolo, 1, false);
[xi{:}] = fftfreq(sizeHolo, 1);
XiSqDivFresnel = 0;
for jj = 1:ndim
XiSqDivFresnel = XiSqDivFresnel + gpuArrayIf(xi{jj}, gpuFlag).^2 ./ (2*pi^2*fresnelNumbers(jj));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment