<<

Lecture 2. Special Functions and The Impulse Function

J. Scott Tyo OPTI 512R College of Optical Sciences University of Arizona Last Updated August 13, 2010

1. SPECIAL FUNCTIONS We will be working not just with functions, but with scaled and shifted versions of functions. Our general notation for a scaled and shifted function will look like x − x f x → f 0 , ( ) b (1) where the parameter x0 represents the shift, and the parameter b provides the scale. Figure 1 shows an example for a Gaussian function. We will look at the Gaussian function in a bit more detail later on in this lecture, but for now let’s take the expression 2 f(x)=e−πx . (2) This function is plotted on the left hand side of Fig. 1. On the right side of the figure we plot a family of shifted versions of the function specified by 2 −π(x−x0) f(x − x0)=e . (3) We note that each of the curves is essentially identical. However, the curves are shifted relative to each other by an amount x0. Also note that x0 can be positive (shift to the right) or negative (shift to the left). Likewise, we can scale an arbitrary function. Once again we consider the Gaussian, but now on the right side of Fig. 2, we see scaled versions −π x 2 f(x)=e ( b ) (4)

-p x2 Family of Shifted Gaussians f(x-x ) f(x) = e 0 1 1

0.9 0.9

0.8 0.8

0.7 0.7

0.6 0.6

0.5 0.5 f(x) f(x)

0.4 0.4 x =0 0 x = 1.5 0.3 0.3 0 x = .75 0 0.2 0.2 x = -.75 0 0.1 0.1 x = -1.5 0

0 0 -3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3 x x

Figure 1. Family of shifted Gaussian curves. Each curve has the identical features, only shifted by an amount given by x0.

1 2 f(x) = e-p x Family of Scaled Gaussians f(x/b) 1 1 b=1 0.9 0.9 b=2 b=1.5 0.8 0.8 b=.75 b=0.5 0.7 0.7

0.6 0.6

0.5 0.5 f(x) f(x)

0.4 0.4

0.3 0.3

0.2 0.2

0.1 0.1

0 0 -3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3 x x

Figure 2. Family of scaled Gaussians. Note that as b increases, the function widens,andasb decreases, the function narrows. with various values of b. In this case all of the functions are centered at x = 0, but now the width of the Guassians changes. We can think of it this way. The function has an identical shape if we plot x/b on the horizontal axis. However, the same value of x produces a larger value of x/b for a lower b, hence compressing the function along the x-axis. Likewise, when b>1, the x-axis is stretched. Notationally, we will largely use the notation of Gaskill. However, in a few circumstances we will use other notation that is far more common. Likewise, some of Gaskill’s function (like the double-δ function) are not in wide use, and hence will not be emphasized.

1.1. The Unit Step Function The step function is one that is used (usually) to turn other functions on or off. For example, we can write the illumination that passes a knife edge in a diffraction experiment as the product of the incident electromagnetic field with a step function that defines the edge. We can define the step function as ⎧ ⎨ 0 x<0 x 1 x step( )=⎩ 2 =0 (5) 1 x>0.

A family of functions step ((x − x0)/b) is plotted in Fig. 3. The unit step function is often used to make other function single-sided. For example, the function f(x) = cos(2πx)step((x − x0)/b) is plotted in Fig. 4. In a similar fashion, we can make a function left-sided by using step(−x). This concept is illustrated in Fig. 5.

1.2. Signum function 1 It should be noted that we have defined step(0) = 2 . This is commonly used, but not necessary. Many authors define step(0) = 0 or step(0) = 1. The specific choice is unimportant, as no physically realizable function can actually be discontinuous like this, and the step function is only an idealization that is convenient for analysis. However, by defining the function this way, we may write 1 step(x)= (1 + sgn(x)) , (6) 2

2 1.5

x = 0, b = 1 0 x = 2, b = 1 0 x = −0.5, b = 4 1 0

0.5 step(x)

0

−0.5 −3 −2 −1 0 1 2 3 x

Figure 3. Family of unit step functions.

cos(2π x)*step((x−x )/b 0 1.5

x = 0, b = 1 0 1 x = 2, b = 1 0 x = −0.5, b = 4 0

0.5

0 f(x)

−0.5

−1

−1.5 −3 −2 −1 0 1 2 3 x

Figure 4. Using the same three scaled, shifted step function as in Fig. 3 to turn the function cos(2πx)onatdifferent locations.

3 1.5 cos(2π x)step(x−1) cos(2π x)step(−(x+1))

1

0.5

0 f(x)

−0.5

−1

−1.5 −3 −2 −1 0 1 2 3 x

Figure 5. Making cos(2πx) right-sided or left-sided by using the negative argument in the step function. where sgn(x)isthesign or signum function ⎧ ⎨ −1 x<0 x x sgn( )=⎩ 0 =0 (7) 1 x>0, and yields the sign (positive or negative) of the argument. This representation will be important when we try to take the of step (x) later on this term.

1.3. The Ramp Function We can define the ramp function as the of the step function as

x 0 x<0 ramp (x)= step (α) dα = (8) −∞ xx≥ 0.

Several ramp functions are plotted with different values of scale and shift in Fig. 6. We note that the slope of the line in the ramp ((x − x0)/b) is equal to 1/b.

4 ramp((x−x )/b 0 6

x = 0, b = 1 0 x = −1, b = 2 5 0 x = 1, b = 1/3 0

4

3 f(x)

2

1

0 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 2.5 3 x

Figure 6. Scaled and shifted ramp functions.

rect((x−x )/b 0

x = 0, b = 1 1.4 0 x = 1, b = 0.5 0 x = −0.5, b = 3 0 1.2

1

0.8

f(x) 0.6

0.4

0.2

0

−0.2

−3 −2 −1 0 1 2 3 x

Figure 7. Scaled and shifted rectangular pulse functions. .

1.4. The Rectangular Pulse The rectangular pulse function is used to approximate a number of physical processes encountered in optics such as slits and rectangular apertures. We can define the rectangular pulse in terms of the unit step function as x x 1 − x − 1 rect ( )=step⎧ + 2 step 2 1 ⎨ 1 |x| < 2 1 1 (9) = 2 x = ± 2 ⎩ 1 0 |x| > 2 . Several scaled and shifted versions of the pulse function are shown in Fig. 7.

5 tri((x−x )/b 0 1

0.9

0.8

0.7

0.6

0.5 f(x)

0.4

0.3

x = 0, b = 1 0.2 0 x = 1, b = 2 0 0.1 x = −1.5, b = 1/2 0

0 −3 −2 −1 0 1 2 3 x

Figure 8. Family of shifted and scaled triangle functions.

Let’s consider the area under the rectangular pulse function. Define ∞ x − x |b|/2+x0 |b| |b| A 0 dx dx x − − x |b|. = rect b = = + 0 + 0 = (10) −∞ −|b|/2+x0 2 2

1.5. The Triangle Function The triangle function creates a pulse that, unlike the rect function, is continuous for all values of the argument. We define the triangle function as ⎧ ⎨ 0 |x| > 1 x x − ≤ x ≤ tri ( )=⎩ +1 1 0 (11) 1 − x 0 ≤ x ≤ 1. Figure 8 shows several scaled and shifted version of the triangle function. The integrated area of the triangle function with this normalization is ∞ x − x0 A = tri = |b|. (12) −∞ b

6 sinc((x−x )/b 0 1.6

x = 0, b = 1 1.4 0 x = 1.5, b = 2 0 x = −1.5, b = 1/2 1.2 0

1

0.8

f(x) 0.6

0.4

0.2

0

−0.2

−5 −4 −3 −2 −1 0 1 2 3 4 5 x

Figure 9. Scaled and shifted sinc functions.

1.6. The Sinc function The sinc function is closely related to the rect function through the Fourier transform, and this will be very important in both signal processing and in diffraction later on in the term. We can define the sinc function using Gaskill’s notation as πx x sin . sinc ( )= πx (13) The sinc function has a problem when x → 0. At this point, we have sinc (0) = 0/0, and we need to use to another method to evaluate the function at this point. We appeal to the expansion of sin(x)todo this and we have 1 1 πx − (πx)3 + (πx)5 + ... 1 1 lim sinc (x) = lim 3! 5! = lim 1 − x2 + x4 + ...=1. (14) x→0 x→0 πx x→0 3! 5! Several scaled and shifted sinc functions are plotted in Fig. 9. We should note that many authors use the definition sinc (x)=sin(x)/x (without the factor of π in the argument of ). We will use the notation of Gaskill as stated in Eq. 13 because of the normalization property

∞ x − x0 A = sinc dx = |b|. (15) −∞ b

This integral is a standard tabulated definite integral that can be looked up in most mathematical handbooks. We will actually learn how to evaluate it later on this semester using properties of Fourier transforms. The sinc function has some important properties that are worth committing to memory. The zeros of the sinc function can be located as sinc (x)=0atx = ±1, ±2, ±3,.... (16) and, of course, the maximum value of sinc (x) is unity at x =0.

7 Pulse functions

rect(x) tri(x) 1.2 sinc(x) Gaus(x) sinc2(x) 1

0.8

0.6 f(x)

0.4

0.2

0

−0.2

−3 −2 −1 0 1 2 3 x

Figure 10. Several different pulses. These all have different widths, but with our normalization all have the same total integrated area of |b|.

1.7. The Gaussian function The Gaussian function is defined in the notation of Gaskill as

2 Gaus (x)=e−πx . (17)

As with the sinc function, we use this particular definition with the factor of π in the argument because of the normalization properties that we will see below. We have already looked as the scaling and shifting properties of the Gaussian in Fig. 1 and Fig. 2. However, we note that the Gaussian has area

∞ x − x0 A = Gaus dx = |b|. (18) −∞ b

As with the integral of the sinc function, this integral is tabulated as well. However, it is possible to evaluate this integral using a simple change of variables and an algebraic trick (it’s on Wikipedia, give it a try).

2. THE IMPULSE FUNCTION We have considered several pulse functions, the rectangle, triangle, sinc, Gaussian, and even the sinc2 function (which we didn’t treat in the previous section). These functions are all plotted in Fig. 10. These functions all have different widths, different full-width half-maxes, different numbers of zeros, etc. One important feature of all of these functions is that they have a total integrated area of |b|. Consider now the case in Fig. 11. In this figure we plot x f x 1 . ( )=|b|sinc b (19) Each of these functions has an integrated area of unity due to the normalization to b. However, as we decrease the scaling parameter, the peak increases and the width decreases in order to keep the overall area at 1. We can consider what happens as we allow the scaling parameter to go to 0. We can define the impulse function, also known as the , as 1 x δ(x) = lim Gaus . (20) b→0 |b| b

8 sinc(x/b) 20 b = 1 b = .5 b = .1 b = .05

15

10 f(x)

5

0

−5 −3 −2 −1 0 1 2 3 x

Figure 11. Sinc function as we decrease the scaling parameter b. All of these functions have an integrated area of unity, but they have increasingly large peak values (1/b) and increasingly narrow widths.

1.2

δ(x+2) δ(x−0.5) 1

0.8

0.6

0.4

0.2

0

−0.2

−3 −2 −1 0 1 2 3

Figure 12. Graphical representation of δ(x).

We could have equivalently defined the δ(x) in terms of the rect function, tri function, sinc function, or any other pulse function with integrated area of unity. This function is what we refer to as a generalized function.Asb → 0, the width goes to zero and the peak goes to ∞. Graphically we will denote the function δ(x − x0) as an arrow at location x = x0 to indicate its infinite magnitude and zero width. This is depicted in Fig. 12. The δ-function is best described by its integral properties. Fundamentally we can state that x2 f x x

9 Now let’s look at some of the properties of the δ-function. First let’s consider its scaling properties. We can shift and scale the delta function just as we did earlier with other special functions. However, since the delta function is a genearlized function, the result is a bit different.

∞ ∞ x − x0 x0 f(x)δ dx = |b| f(bu)δ u − du (22) −∞ b −∞ b = |b|f(x0). (23)

This allows us to say that δ(x/b)=|b|δ(x). We can tabulate many of the important properties of the δ-function.

1. Definition

δ(x − x0)=0forx = x0 (24) ∞ f(x)δ(x − x0)dx = f(x0). (25) −∞

This is known as the “sifting” property of the δ-function.

2. Scaling Properties x − x δ 0 |b|δ x − x b = ( 0) (26) x δ ax − x 1 δ x − 0 ( 0)=|a| a (27)

δ(−x + x0)=δ(x − x0) (28) δ(−x)=δ(x). (29)

Note that Eq. 29 means that the δ-function is an even function.

3. Products with δ-functions.

f(x)δ(x − x0)=f(x0)δ(x − x0) (30) xδ(x − x0)=x0δ(x − x0) (31) δ(x)δ(x − x0)=0(x0 = 0) (32) δ(x − x0)δ(x − x0) → not defined. (33)

The properties in this section all tell us that when we multiply the delta function by any other function, the result is a single delta function weighted by the value of the function it is multiplied by. This property will be found to be very important both in the future sections on sampling theory and on diffraction.

4. Integral Properties ∞ Aδ(x − x0)dx = A (34) −∞ ∞ δ(x − x0)dx = 1 (35) −∞ ∞   δ(x − x0)δ(x − x )dx = δ(x − x0) (36) −∞

10 f(x)

x -2 -1 12

Figure 13. Graphical representation of the comb function.

5. Gaskill’s Double-Delta When Prof. Gaskill wrote his book, he developed a new notation that would have been extremely useful. Unfortunately, it never caught on, and it is not generally used. In fact, I have never seen it used anywhere other than in his text and with a few students that took the class from him. The double delta functions are related to the Fourier transforms of sine and cosine. You are free to use them, but I will not ever use them and will not require you to.

3. THE COMB FUNCTION In many applications we will find it useful to have an array of delta functions that are evenly spaced. This function is often referred to as the comb function comb (() x). We define the comb function as ∞ comb (x)= δ(x − n). (37) n=−∞

The conventional graphical representation of the comb function is shown in Fig. 13. If we want something other than integer spacing, we can use the scaling properties of the δ-function to write

x ∞ |b| δ x − nb . comb b = ( ) (38) n=−∞

These delta functions are separated by b, each with an integrated area of |b|. Later this semester we will see that the comb function is central to the development the sampling theory. This is because x ∞ f x 1 f nb δ x − nb . ( ) |b|comb b = ( ) ( ) (39) n=−∞

4. DERIVATIVES AND OF δ(X) First let’s consider a function defined as x   0 x<0 u(x)= δ(x )dx = (40) −∞ 1 x>0.

11 We recognize this as the unit step function, so we can say that d δ x x . ( )=dxstep ( ) (41)

Likewise we can consider the derivative of the δ-function. Let’s define dδ x δ x ( ). ( )= dx (42)

We can determine the properties of this function from the perspective of the integral ∞ ∞   ∞  f(x)δ (x − x0)dx = δ(x − x0)f (x)|−∞ − f (x)δ(x − x0) (43) −∞ −∞  = −f (x0). (44)

This function is often referred to as the doublet function. We can repeat this process as many times as we would like to, and the result is ∞ (n) n (n) f(x)δ (x − x0)dx =(−1) f (x0), (45) −∞ where f (n) represents the nth derivative of f(x)(NOT f(x) raised to the nth power.

12