In MATLAB, define a zero-filled 256x256 matrix named Bars by using the command "zeros". Create 2 vertical bars, centered on the image, of width 3 and height 40, separated from each other by 8 pixels, by setting the appropriate matrix elements to the value 1.
Display the image Bars. Your matrix can be displayed as a 2D grayscale image by using the commands "imagesc" and "colormap". Make the image square by using the command "axis square".
Pick a horizontal line through the center of the test pattern. Plot the intensity profile of this line. Label the x and y axes appropriately.
To accurately reconstruct this image by sampling—ignoring edge effects—how often (for every how many pixels) must you sample (hint: ∆x = 3 pixels)? What is the fundamental principle behind sampling?