Keywords: front-page

# Generation of Trapezoidal Data

[Laboratory]

Generation of synthetic data sets, 1D signals and 2D images, are essential for the creation of test patterns, color maps, filter kernels, etc. In this experiment we want to create simple 1D signals and 2D images.

### The Digital Impulse

The digital impulse delta(i), also called digital delta function is defined as:

    delta(i) = 1, for i = 0
             = 0, for other values of i

### 1D Impulses

A sequence of impulses can be built from a summation of several impulses placed at different locations.

1D Impulses: Amplitude (A=5)

### 2D Impulses

The equation of a 2D impulses is given by

Depicted below is an image with size W=128 and H=100 consisting of 2D impulses. In the width direction there are (N=4) impulses separated by (k=32) pixels, and in the height direction (M=8) impulses separated by (l=10) pixels. The amplitude of each impulse is (A=255). The offsets for both width and height are (o=p=0).

Image with Impulses

### Trapezoidal Pulses

#### 1D Pulses

There are several parameters that define a 1D-trapezoidal pulse. min and max are the minimum and maximum values. Other parameters are Rise duration (r), pulse Width (w), Fall duration (f) and pulse Period (t), where each control the length of each part of the pulse. Sampling (sampl) controls the number of samples. For most applications, ilt is easier to use sampl=1.

A sequence of almost two trapezoidal pulses, p(x), is shown below:

1D-trapezoidal pulses: min=0, max=10, r=2, w=3, f=4, t=14, sampl=1, signal width (W=26)

A particular cases of this function are the square wave (r=f=0), triangular wave (r=f, w=0) and ramp (w=f=0, r=t).

#### 2D Trapezoidal Images

The images shown below correspond to a ramp, triangle and square waves in the width direction. The size of all three images is W=512, H=50 and sampl=1.

Ramp Image: r=512, w=f=0, t=W, min=0, max=256

Triangle Wave Image: r=f=256, w=0, t=W, mix=0, max=255

Square Wave Image: r=f=0, w=10, t=30, mix=100, max=200

- Lab: Generation of Trapezoidal Data