SHOW:
|
|
- or go back to the newest paste.
1 | gauss = zeros(10,10); | |
2 | ||
3 | sigma = 3; | |
4 | ||
5 | for x=1:10 | |
6 | for y=1:10 | |
7 | ||
8 | ||
9 | gauss(x,y) = exp(-((x-6)*(x-6)+(y-6)*(y-6))/(2*sigma)); | |
10 | ||
11 | end | |
12 | end | |
13 | ||
14 | ||
15 | somagauss = sum(gauss); | |
16 | gauss = gauss/somagauss; | |
17 | ||
18 | // surf(gauss); | |
19 | ||
20 | gs=fftshift(gauss) | |
21 | gf=fft2(gs) | |
22 | ||
23 | ||
24 | m1=[0 0 0 0 0 0 0 0 0 0; | |
25 | 0 0 0 0 0 0 0 0 0 0; | |
26 | 0 1 1 1 1 1 1 1 0 0; | |
27 | 0 1 1 1 1 1 1 1 0 0; | |
28 | 0 1 1 0 0 0 1 1 0 0; | |
29 | 0 1 1 0 0 0 1 1 0 0; | |
30 | 0 1 1 1 1 1 1 1 0 0; | |
31 | 0 1 1 1 1 0 0 0 0 0; | |
32 | 0 1 1 1 1 0 0 0 0 0; | |
33 | 0 1 1 1 1 0 0 0 0 0]; | |
34 | ||
35 | ||
36 | m1f=fft2(m1) | |
37 | ||
38 | multi=gf.*m1f | |
39 | ||
40 | mfinal=mfft(multi,1,[10;10]) | |
41 | ||
42 | mreal = real(mfinal) |