Keywords: front-page

## Lab: DFT: Properties

[Exercises] [Workspace]

Purpose: The purpose of this lab is to illustrate the discrete Fourier transform properties of rotation, linear combination, translation, and expansion.

Activities:

1. Create a centered white rectangle on a black background using the operators Constant and Pad. Display it.

   1. Glyphs:Input/Output:Generate Data:Constant
   2. Glyphs:Data Manip:Size & Region Operators:Pad
   3. Glyphs:Visualization:Non-Interactive Display:Display Image
   4. Set the Constant glyph parameters to:

               Width: 4
               Height: 32
               Real Constant Level: 1

   5. Set the Pad glyph parameters to:

               Padded Width : 128
               Padded Height: 128
               Width  Offset: 64-(4/2)
               Height Offset: 64-(32/2)

2. Take the forward Fourier transform using the FFT operator and display it. Use the "Unity Scaling" option. Display both the magnitude and phase images (the Display Image operator displays the magnitude image by default). Use the Phase operator to calculate the phase image.

   1. Glyphs:Arithmetic:Linear Transforms:FFT
   2. Glyphs:Arithmetic:Complex Operators:Phase
   3. Glyphs:Visualization:Non-Interactive Display:Display Image

3. Rotate the object using the operator Rotate and display it. Take its DFT and display it. Set the rotation angle to 45 degrees.

   1. Glyphs:Image Proc:Geometric Operators:Rotate
   2. Glyphs:Arithmetic:Linear Transforms:FFT
   3. Glyphs:Visualization:Non-Interactive Display:Display Image

4. Combine the centered rectangle and the rotated rectangle using the operator Blend Data with a blending factor of 0.25. Display the combined image. Then take the forward DFT and display the result.

   1. Glyphs:Arithmetc:Two Operand Arithmetc:Blend Data
   2. Glyphs:Arithmetic:Linear Transforms:FFT
   3. Glyphs:Visualization:Non-Interactive Display:Display Image

5. Translate the original object 32 pixels to the right and 32 pixels down using the operator Translate, and display it. Take the DFT of the translated object, and display the phase component as well as the magnitude component.

   1. Glyphs:Data Manip:Reorganize Data:Translate
   2. Glyphs:Arithmetic:Linear Transforms:FFT
   3. Glyphs:Arithmetic:Complex Operators:Phase
   4. Glyphs:Visualization:Non-Interactive Display:Display Image (2)

6. Expand the original image by a factor of two using the operators Expand, Impulse, and Multiply, and display the image. The image needs to be expanded such that all empty new values are filled with zeros (instead of pixel replication). This can be accomplished by creating an impulse image (impulse value=1, background=0) that is the same size as the expanded image. This image should have an impulse spacing of 2 along each dimension, with the number of impulses being half the size of the image. Multiplying this impulse image with the expanded image will result in an expanded image where the new values are filled with zeros.

   1. Glyphs:Data Manip:Size & Region Operators:Resample
   2. Glyphs:Input/Output:Generate Data:Impulse
   3. Glyphs:Arithmetic:Two Operand Arithmetic:Multiply
   4. Glyphs:Visualization:Non-Interactive Display:Display Image

7. Calculate the DFT of the expanded image and display it.

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

Exercises

1. Translate the DFT by half of the image dimension using the translation property, by multiplying the image by (-1)**(x+y).

   Hint: use operators Piecewise Linear, Add, and And.

2. Create a small 8x8 pattern and replicate it to generate a 256x256 image using the expansion property.

Khoros Workspace
Execute the visual program c5s3dft-properties.wk