Keywords: front-page

## Lab: 2D DFT from 1D DFT

[Exercises] [Workspace]

Purpose: The purpose of this lab is to demonstrate the separability of the DFT.

Activities:

1. Create a small white box 4 x 16 centered in a 128 square black background using the operators Constant and Pad. Display it.

   1. Glyphs:Input/Output:Generate Data:Constant
   2. Constant parameters:

               Width: 4,
               Height: 16,
               Real Constant Level: 1

   3. Glyphs:Data Manip:Size & Region Operators:Pad
   4. Pad parameters:

               Padded Width : 128,
               Padded Height: 128,
               Width Offset :  62,
               Height Offset:  56

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

2. First take the DFT of the lines of the image, using the FFT operator set up to operate only in the width dimension. Display it.

   1. Glyphs:Arithmetic:Linear Transforms:FFT
   2. FFT Parameters:

               Direction           : Forward,
               Shifting            : Centered (DC at N/2),
               Scaling             : Unity Scaling,
               Transform Dimensions: Width

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

3. Take the DFT of the columns of the previous DFT, using the FFT operator set up to operate only in the height dimension. Display it.

   1. Glyphs:Arithmetic:Linear Transforms:FFT
   2. FFT Parameters:

               Direction           : Forward,
               Shifting            : Centered (DC at N/2),
               Scaling             : Unity Scaling,
               Transform Dimensions: Height

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

4. Compute a 2D DFT on the original image, this time with both the width and height dimensions on the FFT operator selected.

   1. Glyphs:Arithmetic:Linear Transforms:FFT
   2. FFT Parameters:

               Direction           : Forward,
               Shifting            : Centered (DC at N/2),
               Scaling             : Unity Scaling,
               Transform Dimensions: Width and Height

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

5. Compare the results from the two-step DFT, performed in Steps B and C, with the result from Step D. Use operator Compare Objects to compare the data.

   1. Glyphs:Data Manip:Analysis & Information:Compare Objects
   2. Open the Compare Objects pane and unselect the "Run Silently" option. When the face appears under the Compare Objects glyph, click on it to open the information window.

Exercises

1. Perform the inverse DFT using the principle of the separable transform.

Khoros Workspace
Execute the visual program c5s2dft-2d-from-1d.wk