Keywords: front-page

## Lab: DFT: Sampling and Aliasing

[Exercises] [Workspace]

Purpose: The purpose of this experiment is to visualize the concepts of sampling and aliasing (overlap or wrap around effects).

Activities:

1. Create 4 (128x128) images with sinusoidal functions of different frequencies in the width direction, and display them. Use the operators Sinusoid and Display Image. Use an amplitude of 1 and a phase offset of 90 degrees for all images.

   1. Glyphs:Input/Output:Generate Data:Sinusoid (4)
   2. Glyphs:Visualization:Non-Interactive Display:Display Image (4)

   1. Image 1: T=128 (minimum frequency). Frequency = 1/128 cycles/sample
   2. Image 2: T=8 Frequency = 16/128 Cycles/sample
   3. Image 3: T=2 (maximum frequency) Frequency = 64/128 cycles/sample
   4. Image 4: T=1.88 (aliasing) Frequency = 68/128 cycles/sample

2. Take the forward Fourier transform of each image, calculate its log(mag+1) spectrum, and display the result. Use the FFT, Magnitudes, and Display Image operators.

   1. Glyphs:Arithmetic:Linear Transforms:FFT (4)
   2. Glyphs:Arithmetic:Complex Operators:Magnitudes (4)
   3. Glyphs:Visualization:Non-Interactive Display:Display Image (4)

3. Extract the center horizontal line of each spectrum and plot them all together. Use operators Extract and Interactive 2D/3D Plot.

   1. Glyphs:Data Manip:Size & Region Operators:Extract
   2. Glyphs:Visualization:Plot Display:Interactive 2D/3D Plot

Exercises

1. Perform the same experiment, but with different dimensions for the images.
2. Create a sinusoidal signal in the vertical 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.
4. Perform the same experiment but with piecewise linear functions.

Khoros Workspace
Execute the visual program c5s6F-sine-aliasing.wk