Last active
October 6, 2016 09:00
-
-
Save kphilipp/141f26594a37a0f0ae572c922cb9bab0 to your computer and use it in GitHub Desktop.
simulation of fully developed speckle pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
L = 400; | |
D = 80; | |
speckleSize = L/D | |
img = zeros(L, L); | |
pad = L/2; % padding | |
for k=pad-D:D+pad | |
for l=pad-D:D+pad | |
if abs((pad-k)^2+(pad-l)^2) < D^2/4 | |
img(k,l) = exp(unifrnd(-pi,pi)); | |
end | |
end | |
end | |
mfft = fft2(img); | |
img = mfft.*conj(mfft); | |
subimg = img(20:380, 20:380); | |
figure; imshow(subimg, []); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment