diff --git a/src/projOp.m b/src/projOp.m index c4d3d01a5ab9dd192d13d5d637360eaa8dda480a..6db1dfb643d5ca824735537745bc2228a66ced99 100644 --- a/src/projOp.m +++ b/src/projOp.m @@ -1,19 +1,28 @@ -function [F] = projOp(F, sampling, kappa, c1, c2, N1, N2) -% Projection of F onto the subspace $T_{c_1,c_2}^\astV_{N_1,N_2}$ -% c_1 indicates shift in row direction, c_2 in column direction -% N_1 is cutting parameter in row direction, N_2 in column direction - -F = translOp(F, sampling, c1, c2, kappa); % shift the origin - -Ffft = fft2(F); -% Ffft = fft(F.'); % columnwise 1D FT - -Ffft(:,(N1+2) : (end-N1)) = 0; -Ffft((N2+2) : (end-N2),:) = 0; - -F = ifft2(Ffft); -% F = ifft(Ffft).'; % columnwise 1d IFT - -F = translOp(F, sampling, -c1, -c2, kappa); % shift back the origin - -end \ No newline at end of file +function [Ft] = projOp(F, sampling, kappa, c1, c2, N1, N2) + +% Simulates projection operator on generalized subspace of non-evanescent far field operators. +% Projects of F onto the subspace $T_{c_1,c_2}^\astV_{N_1,N_2}$. +% +% INPUT: F Far field matrix, nxhat*nd-array. +% sampling Structure containing information about the discretization. +% kappa Wave number, >0. +% c1 Determines translation in row direction, vector of length 2. +% c2 Determines translation in column direction, vector of length 2. +% N1 Cutting index in row direction, natural number. +% N2 Cutting index in column direction, natural number. +% OUTPUT: Fp Projected far field matrix, nxhat*nd-array. +% +% ********************************************************************************************* + +F = translOp(F, sampling, c1, c2, kappa); % shift the origin + +Ffft = fft2(F); + +Ffft(:,(N1+2) : (end-N1)) = 0; +Ffft((N2+2) : (end-N2),:) = 0; + +F = ifft2(Ffft); + +Fp = translOp(F, sampling, -c1, -c2, kappa); % shift back the origin + +end