Generation of Sinusoidal Data


Generation of 1D and 2D sinusoidal waves are essential for the creation of test patterns, color maps, filter kernels, etc, used either in the spatial or frequency domains.

1D Sinusoid Signals

A discrete sinusoidal signal is defined by its length (W), amplitude (A), its period (T) or frequency (f) and phase (phi). We can measure the period in number of pixels (samples), and the frequency in number of cycles per pixel (or cycles per sample). You can also specify the period by n (number of cycles within the signal length W).

--
Sinusoid and its equation
parameters used: A=1, W=50, n=3 (or T=50/3 pixels), phi=0)

The maximum period we have to fill the entire signal is the signal length (T=W). Recall the sampling theorem, the minimum period we can sample a sinusoid wave is 2 pixels.

--
left: maximum period wave: T=W=50, right: minimum period wave: T=2, phi=90 degrees.


2D Sinusoids

For 2D images, a sinusoid wave can also be generated. The image represents a 2D sinusoid which can run in any direction. We can specify this image by specifying frequency and phase parameters in each direction. Below is a 2D wave. Its effective period is 14.14 pixels and the wave direction is 45 degrees.

--
Sinusoid image and its equation
parameters used: A=1, W=200, nw=10 (or Tw=20), phi_w=45, H=100, nh=5 (or Th=20), phi_h=90.

--
left: first line of the 2D sinusoid wave, right: first column of the 2D sinusoid wave

The maximum period and minimum period waves we can generate with the above image dimensions are T=200 in the width direction and T=1.41 in 45 degrees direction. It is important to remember that the minimum period is independent of the image dimensions.

--
left: maximum period 2D-wave: Tw=200, Th=0, right: minimum period 2D-wave: Tw=Th=2, phiw=phiw=45 degrees.
Note: in the high frequency image, a small portion of it is zoomed and displayed over it.



DIP Feedback Form

Copyright © 1995 KRI, ISTEC, Ramiro Jordán, Roberto Lotufo. All Rights Reserved.