Lecture 2. Special Functions and the Impulse Function
Total Page:16
File Type:pdf, Size:1020Kb
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 Fourier transform of step (x) later on this term. 1.3. The Ramp Function We can define the ramp function as the integral 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 Taylor series expansion of sin(x)todo this and we have 1 1 πx − (πx)3 + (πx)5 + ..