% shift_pixels = (-nshifts/2:nshifts/2 - 1)/nshifts;       % range approximately [-1/2, 1/2].
k_in = fftc(fin(:));
shift_pixels = -0.4;
k_in = k_in(:);
N = length(k_in);
vec = -N/2:N/2 - 1;
% vec = 0:N - 1;       % equivalent.
cexp_vec = exp(-2*pi*1i/N*vec(:)*shift_pixels);

ks = k_in.*cexp_vec;
fs = ifftc(ks);