Hello all, A quick query regarding fft and wavenumber calculations. I am looking to do an upward contuation of a gravity data grid using fft and the basic equation:
fft_Grav_up = fft2(gravity_input) * e^(-kz) // think it also needs fftshif to centre Zero? ... Upward_continued_gravity=ifft(fft_out_Grav_up) Where z = upward continuation distance and k = wavenumber k =sqrt(kx^2 + ky^2) Is there an easy way to get the wavenumber from the input? Before doing the fft, the grid would need padding on all edges, so I think this works unless there is a better method: dimx=size(xt) dimy=size(yt) // For FFT pad X,Y to 2*ncols, 2*nrows (large enough to avoid boundary effects) addedRows = dimy(1); addedCols = dimx(1); tmp = [Boug_corr; Boug_corr($, :).*.ones(addedRows, 1)]; tmp = [tmp tmp(:, $).*.ones(1,addedCols)]; tmp = [repmat(tmp(1, :), addedRows, 1) ; tmp]; Boug_corr_padded = [repmat(tmp(:,1), 1, addedCols) tmp] After running fft, the grid would then be clipped back to the correct size. If there is a simple code for doing this great! Thanks Lester -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html _______________________________________________ users mailing list [email protected] http://lists.scilab.org/mailman/listinfo/users
