Good day,
I'm trying to run a 3D example whose dimensions are non-equal. I'm trying 64x32x16 but during sound-speed/density smoothing the following term fails (in smooth.m):
f_sm = abs(ifftn(fftshift(fftshift(fftn(f)).*Hann_filt)));
The issue is Hann_filt
is 16x64x32 whereas f
is 64x32x16 and thus the .*
fails.
I might be setting up my data wrong and I'd like assurance from the developers that smooth.m is correct for the 3D case. This is how I'm setting up my data:
% physical dimensions
X = 1e-2; % m
Y = X;
Z = X;
% resolution
Nx = 64; % points
Ny = 32;
Nz = 16;
% dimensions per pixel
dx = X/Nx;
dy = Y/Ny;
dz = Z/Nz;
kgrid = makeGrid(Nx, dx, Ny, dy, Nz, dz);
and my c, rho, etc. are made to be 64x32x16 (e.g. 1500*ones(64,32,16)
).
Any ideas?
Thanks in advance!
EDIT: I re-visited the provided examples for 3D (which I originally dismissed because they were equal dimensions) and the c, rho, etc. are made with Nz x Nx x Ny
and not Nx x Ny x Nz
. I've done the same and it remedied the situation. Thanks.