Keywords: front-page

## Lab: DFT: A Pulse Example

[Exercises] [Workspace]

Purpose: The purpose of this lab is to gain an understanding of the 2D discrete Fourier transform by applying it to a pulse image.

Activities:

1. Create a vertical binary image by thresholding at level 0 a sinusoidal signal (128x128) in the width direction. User the operators Sinusoid and the greater than or equal operator >=. Display the image with the Display Image operator.

   1. Glyphs:Input/Output:Generate Data:Sinusoid
   2. Glyphs:Arithmetic:Comparison Operators:>=
   3. Glyphs:Visualization:Non-Interactive Display:Display Image

2. Take the forward Fourier transform and display the result. Use the FFT operator. Set the "Scaling Option" to "Unity Scaling".

   1. Glyphs:Arithmetic:Linear Transforms:FFT

3. Extract the center horizontal line of the DFT. Determine the magnitude and phase components and plot the results. Use operators Complex to Real, Extract and Display 2D Plot.

   1. Glyphs:Data Manip:Size & Region Operators:Extract
   2. Glyphs:Arithmetic:Complex Operators:Complex to Real
   3. Glyphs:Visualization:Plot Display:Display 2D Plot
   4. View the plots with "Plot Type" "Discrete".

4. Print the DFT values of the extracted line, use operator Print Data.

   1. Glyphs:Input/Output:Information:Print Data
   2. Glyphs:Input/Output:Information:File Viewer

Exercises

1. Perform the same experiment but with different images.
2. Create a sinusoidal signal in the height direction and repeat the experiment.
3. Perform the same experiments but with two sinusoidal signals, one in the horizontal direction and the other in the vertical direction.
4. Perform the same experiment but with piece-wise functions.

Khoros Workspace
Execute the visual program c5s1fourier-square.wk