Code covered by the BSD License  

Highlights from
Huygens-Fresnel integral approximation, free-form apertures and rough surfaces

image thumbnail

Huygens-Fresnel integral approximation, free-form apertures and rough surfaces

by

 

Simulate wave propagation through free-form apertures, or off rough surfaces.

scaleSurface(surface, nGrid, newRa)
function surface = scaleSurface(surface, nGrid, newRa)
% scale an existing surface to a new desired R_a, the frequency containt
% remains unchanged

% extract height
Z = surface(3,:);

% scale to new Ra
Z = Z - mean(Z(:));
Zra = 1 / (nGrid(1)*nGrid(2)) * sum(abs(Z(:)));		% actual Ra

if abs(Zra-newRa) > 1e-15
	Zn = Z / Zra * newRa;
else
	Zn = Z;
end

% fill in Z
surface(3,:) = Zn;

Contact us