Keywords: front-page

## Lab: DFT: Pulse Width and Zero-crossings (Bandwidth)

[Exercises] [Workspace]

Purpose: The purpose of this experiment is to obtain a "visual feeling" of the relationship between pulse width in one domain and zero-crossings in the other. These concepts are intimately related to another very important concept known as "bandwidth".

Activities:

1. Create two square (NxN) images where each has a centered band of constant value 1 on a background of constant value zero. Use the Constant and Pad operators. Display the images using Display Image. Let one of the images contain a vertical band of width A, and the other a horizontal band of height B, where A and B are not equal.

   1. Generate the constant images (the vertical and horizontal bands).

      1. Glyphs:Input/Output:Generate Data:Constant
      2. Constant parameters for the vertical band image: Width=A, Height=N, Real Constant Level = 1
      3. Constant parameters for the horizontal band image: Width=N, Height=B, Real Constant Level = 1

   2. Pad the band images to be square.

      1. Glyphs:Data Manip:Size & Region Operators:Pad
      2. Pad parameters for the vertical band image: Padded Width = Padded Height = N, Width Offset = (N-A)/2, Height Offset = 0
      3. Pad parameters for the horizontal band image: Padded Width = Padded Height = N, Width Offset = 0, Height Offset = (N-B)/2

   3. Display the images

      1. Glyphs:Visualization:Non-Interactive Display:Display Image

2. Compute the forward discrete Fourier transform of both images using FFT and display the results.

   1. Glyphs:Arithmetic:Linear Transforms:FFT
   2. Glyphs:Visualization:Non-Interactive Display:Display Image

3. Extract from each frequency domain image the portions containing meaningful information using the Extract operators. Perform the magnitude operation [sqrt(real**2 + imaginary**2)] on them using the Magnitudes operator. Plot your results using Display 2D Plot.

   1. Glyphs:Data Manip:Size & Region Operators:Extract
   2. Glyphs:Arithmetic:Complex Operators:Magnitudes
   3. Glyphs:Visualization:Plot Display:Display 2D Plot
   4. For the vertical band image, only the line at Height = N/2 is meaningful, so set the Extract operator to extract that line (Width = N, Height = 1, Width Offset = 0, Height offset = N/2)
   5. For the horizontal band image, only the line at Height = N/2 is meaningful, so set the Extract operator to extract that line (Width = 1, Height = N, Width Offset = N/2, Height offset = 0)

4. Determine the statistics and print the data to the display by using the following operators: Statistics, Print Data", and File Viewer.

   1. Glyphs:Data Manip:Analysis & Information:Statistics
   2. Glyphs:Input/Output:Information:Print Data
   3. Glyphs:Input/Output:Information:File Viewer

Exercises

1. Therefore, what is bandwidth?
2. Perform a similar experiment by modifying the width, height or both dimensions of the rectangle in the image.
3. Instead of a box, create your own image and perform a similar experiment.

Khoros Workspace
Execute the visual program c5s5F-sine-x-over-x.wk