Activity 6-A - Familiarization with Fourier Transform of Different 2D Patterns
This first part is similar to Activity 5-A where the Fourier transform of some 2D patterns are obtained using Scilab. Physically, these represent the diffraction patterns in such apertures. In this case, other 2D patterns are used which are created in Paint. Recall that the output image displayed is the absolute or modulus fftshifted FT of the aperture.
The first one is a square aperture. Its FT is also shown as follows.
It can be observed that the FT image of a square aperture is similar to the FT image of the circular aperture in Activity 5-A. But instead of airy disks, the FT image above has bright central square maximum and decreasing intensity maxima at its edges.
A circular annular or "doughnut"aperture is shown below with its FT image.
The FT image above is comparable to the airy disks of a circular aperture except that some orders are missing. This is due to the central circular obstacle of the annulus which removes these orders.
The FT image of a square annular aperture is also examined.
As expected, the FT image of this aperture type resembles a regular square aperture except that there are also some missing orders like in the circular annular aperture.
Two horizontal slits which are symmetric with the central horizontal axis are made as the next aperture as follows.
It can be seen that the FT image above is vertical with alternating bright and dark fringes. This is due to the cancellation of FT from the left side and right side of the horizontal slits which in turn retains the central maxima in the center. The alternating fringes are effects of destructive interference coming from the 2 horizontal slits.
The last test aperture created contain 2-small dots symmetric and centered along the horizontal axis.
Its FT image is similar to airy disks but vertical alternating bright and dark fringes are observed. This is a consquence of destructive interference from the 2 spots and since they are arranged horizontally, vertical fringes are then produced.
The following Scilab code is utilized in this part.
// DFT Apertures 6-A
Isquare = gray_imread('square.bmp');
Fsquare = abs(fftshift(fft2(Isquare)));
//scf(0)
//imshow(Fsquare, []);
//imwrite(Fsquare/max(Fsquare), 'Fsquare.bmp');
Iannulus = gray_imread('annulus.bmp');
Fannulus = abs(fftshift(fft2(Iannulus)));
//scf(1)
//imshow(Fannulus, []);
//imwrite(Fannulus/max(Fannulus), 'Fannulus.bmp');
Isquare_annulus = gray_imread('square_annulus.bmp');
Fsquare_annulus = abs(fftshift(fft2(Isquare_annulus)));
//scf(2)
//imshow(Fsquare_annulus, []);
//imwrite(Fsquare_annulus/max(Fsquare_annulus), 'Fsquare_annulus.bmp');
I2slitshor = gray_imread('2slitshor.bmp');
F2slitshor = abs(fftshift(fft2(I2slitshor)));
//scf(3)
//imshow(F2slitshor, []);
//imwrite(F2slitshor/max(F2slitshor), 'F2slitshor.bmp');
I2dots = gray_imread('2dots.bmp');
F2dots = abs(fftshift(fft2(I2dots)));
//scf(4)
//imshow(F2dots, []);
//imwrite(F2dots/max(F2dots), 'F2dots.bmp');
Activity 6-B - Anamorphic Property of the Fourier Transform
This second part tackles the anamorphic properties of the FT for sinusoidal signals which include the ability to distribute the spatial frequency of the input signal, rotation effects, combined effects via multiplication of signals and its linearity.
A simple sinusoidal signal is initially generated. This is in the form
Different frequencies are tested for further examination. The leftmost image of the sinusoidal signal shown below has f = 2.
Recall that the FT of a sinusoidal wave signal following the equation above is composed of two dirac deltas which are located at the positive and negative frequency space of the transform. For this case, its frequency is 2 thus the dirac deltas are expected to be located at +2 and -2. The second image above illustrates the 2D FT image of the signal. However, it can be observed that the 3D plot using mesh in Scilab, they are to be found somewhere else. This is because its x and y axes do not contain negative values.
Next sinusoidal signal has f = 4.
Its dirac deltas are then to be found at +4 and -4. Hence, their spacing between each other increases.
And the following set of images has sinusoidal signal with f = 8.
Expectedly, the dirac deltas are farther from each other since they have frequency of 8.
The next thing done is adding a positive constant bias to the sinusoidal signal. For this case 2 is added and the 2D image of the input signal is shown as follows. Note that from here, the following signals have frequency equal to 8.
The 2D FT image can be observed having a central bright spot and two fainter ones symmetric to the center. The added positive constant bias is the cause of the additional central bright spot. This is because the FT of a constant is a dirac delta centered at the origin. Also, since the amplitude of the sinusoid is 1 which is less than the positive constant bias 2, then the intensities coming from the sinusoid are less than the intensity of the central spot. The 3D plot further illustrates the effect of the positive constant bias.
In real applications, like in getting interferogram which has sinusoidal signal, its actual frequencies can easily be extracted from applying FT to it. If the signal contains non-constant bias example having very low frequency sinusoid, the frequencies of the interferogram can be acquired by subtracting this non-constant bias from the signal before applying FT or based from the FT, the dirac deltas that are close to each other correspond to the non-constant bias since this has very low frequency and what remain are the frequency contents of the interferogram.
The sinusoidal signal is then made to have phase angles theta in the x and y coordinates. This is in the form
First, a 30-degree angle is used.
The leftmost image above is the 2D image of the rotated sinusoidal signal. The next two are the 2D and 3D FT images respectively. The dirac deltas are rotated by 60 degrees or 90-30 degrees clockwise with respect to the central vertical axis. This is because our reference axis is the central vertical one.
I tested for the angle of 60 degrees.
Indeed, the dirac deltas rotated by 30 degrees or 90-30 degrees with respect to the central vertical axis but now in the counterclockwise direction.
Another type of sinusoidal signal investigated is a combination of two sinusoids multiplied to each other. One is running along the x direction while the other in y. This is in the form
Based from the equation above, the sinusoids have frequencies equal to 4. The result is illustrated by the images as follows.
It can be observed that 4 dirac deltas are produced which are symmetric about the center. 2 dirac deltas come from the sinusoid running in the x direction and the other two from the sinusoid running in y.
Lastly, the combined sinusoids are added with rotated sinusoidal signal. I have added the rotated sinusoid with 30 degrees and the images below are obtained.
Before plotting the FT image, I have anticipated that the dirac deltas coming from the rotated sinusoid will just add to the 4 dirac deltas from the combined sinusoids. Based from the 2D and 3D images, my prediction is indeed correct.
I have added another rotated sinusoid with an angle of 60 degrees which results to the following images.
Based from the images above, it can be concluded that FT has the property of linearity, that is the superposition of signals correspond to the superposition of their transforms.
The Scilab code below is utilized in the second part.
// DFT Anamorphic F 6-B
nx = 100; ny = 100;
x = linspace(-1,1,nx);
y = linspace(-1,1,ny);
[X,Y] = ndgrid(x,y);
f = 8
z = sin(2*%pi*f*X);
//scf(0);
//imshow(z, []);
//imwrite(z/max(z), 'sinef8.bmp');
sine = abs(fftshift(fft2(z)));
//scf(1);
//imshow(sine, []);
//mesh(sine);
//imwrite(sine/max(sine), 'Fsinef2.bmp');
//Constant Bias
c = 2
zbias = c + sin(2*%pi*f*X);
//scf(2);
//imshow(zbias, []);
//imwrite(zbias/max(zbias), 'zbias.bmp');
sinebias = abs(fftshift(fft2(zbias)));
//scf(3)
//imshow(sinebias, []);
//imwrite(sinebias/max(sinebias), 'sinebias.bmp');
//mesh(sinebias);
// Rotated Sinusoidal Signal
theta = 30;
zrot = sin(2*%pi*f*(Y*sin(theta) + X*cos(theta)));
//scf(4);
//imshow(zrot, []);
//imwrite(zrot/max(zrot), 'zrot30.bmp');
sinerot = abs(fftshift(fft2(zrot)));
//scf(5);
//imshow(sinerot, []);
//mesh(sinerot);
//imwrite(sinerot/max(sinerot), 'sinerot30.bmp');
// Multiplied Sinusoidal Signals
ztimes = sin(2*%pi*4*X).*sin(2*%pi*4*Y);
//scf(6);
//imshow(ztimes, []);
//imwrite(ztimes/max(ztimes), 'ztimes.bmp');
sinetimes = abs(fftshift(fft2(ztimes)));
//scf(7);
//imshow(sinetimes, []);
//mesh(sinetimes);
//imwrite(sinetimes/max(sinetimes), 'sinetimes.bmp');
// Multiplied Sinusoidal Signals Plus Rotated Sinusoidal Signal(s)
theta2 = 60;
ztimesplusrot = sin(2*%pi*4*X).*sin(2*%pi*4*Y) + sin(2*%pi*f*(Y*sin(theta) + X*cos(theta))) + sin(2*%pi*f*(Y*sin(theta2) + X*cos(theta2)));
//scf(8);
//imshow(ztimesplusrot, []);
//imwrite(ztimesplusrot/max(ztimesplusrot), 'ztimesplusrot.bmp');
sinetimesplusrot = abs(fftshift(fft2(ztimesplusrot)));
//scf(9);
//imshow(sinetimesplusrot, []);
//mesh(sinetimesplusrot);
//imwrite(sinetimesplusrot/max(sinetimesplusrot), 'sinetimesplusrot.bmp');
I give myself a grade of 10/10 since I have successfully accomplished all instructions of this activity and I have gained better understanding of the properties of the 2D Fourier transform.
Thanks to mesh, a special 3D plotting function in Scilab which is introduced to me by Raffy, makes better illustration of Fourier transforms of different sinusoidal signals. This activity is also made successful with collaborating with Gary.
Thanks to mesh, a special 3D plotting function in Scilab which is introduced to me by Raffy, makes better illustration of Fourier transforms of different sinusoidal signals. This activity is also made successful with collaborating with Gary.
No comments:
Post a Comment