PhD Thesis: Appendix D
 

"Phase-Only Optical Information Processing"

University of Edinburgh, D.J.Potter, 1992.

Index   Chapter 1  2  3  4  5  6  7  8  9 

 

Appendix D: Computational Intensity

A comparison between the Bessel function method of spectrum calculation with a simpler method is made in this appendix. Recall the expression for the phase object spectrum is given as
G(n
=
  +¥
å
m1=-¥ 
¼ +¥
å
m2=-¥ 
 Jm1(a1)¼ JmN(aN) i( m1+¼+mN ) e-i (m1F1+¼+mNFN )
dn-[m11 +¼+ mNN] )
(1)
where N denotes the number of frequencies in the object f(x). This equation is not insolueable but requires that for every frequency of observation g the equation
g = m11 + m22 + m33 + ¼ + mNN
(2)
be solved to find the mk. Perhaps the easiest way to implement this search is with a nested set of N loops in a computer program, each loop incrementing mk and at the heart of the set the above equation then determines the resulting frequency g. Suppose the size of each Fourier component an describing the object phase is such that little accuracy is lost if Bessel orders higher than `P' may be ignored. A suitable FORTRAN style implementation of this loop for N=3 would be

DO 100 m1=-P,+P

       DO 90 m2= -P,+P

               DO 80 m3= -P,+P

                       g = m11 + m22 + m33

               CONTINUE

       CONTINUE

CONTINUE

so that the number of mk cycled through is (2P+1)N if there are N object spatial frequencies each requiring one loop. Once the specific frequency g has been found, the partial sum, `s' to be added to the complex amplitude is

Jm1(a1)¼ JmN(aN) i( m1+¼+mN ) e-i (m1F1+¼+mNFN )
(3)
so that N multiplications must be performed. (The Bessel function values for each argument an are assumed to have been calculated previously and stored in an array, requiring no further calculation). Each d-function of every comb has a complex amplitude which can also be written in the form
Jmk(an) ei mkFn = a + ib
(4)
The convolution with another comb requires the complex amplitudes of two d-functions be multiplied, so that if the other d-function has an amplitude described by x+iy the REAL and IMAGINARY parts of the answer are given by
REAL 
=
 ax - by
(5)
IMAGINARY 
=
 ay + bx
(6)
The number of multiplications for each convolution step would then be four. Some advantage is gained by multiplying the complex number as modulus and phase, changing to the a+ib form when addition of the partial sums is required. The minimum number of multiplications required to find the spectrum via this method is thus
N (2P + 1)N
(7)
Of course refinements to the algorithm would be made to save computation, such as only calculating the N Bessel function products if g is within a certain range. The effect of such a refinement on the number of multiplications is hard to quantify so it is to be remembered that the above figure is something of an upper limit. Apart from the multiplication power law dependence on N, the programming is made cumbersome as N loops are required. Fourier Series having a large number of terms are thus somewhat of a problem for this the most straightforward approach to the solution.

Bessel Method

Consider the Bessel function approach. This is not a search-based algorithm so at once reduces the physical size of the program. Figure 4.1 shows one step in the convolution of the unit comb with an N-comb. In this case, the unit comb actually belongs to the first Fourier coefficient a1 so the d-function amplitudes are described by the appropriate Bessel function.


Figure D.1: First Convolution Stage showing Furthest Frequency Reached

If the maximum value of a1 is such that Jk(a1) @ 0 for k ³ 7 as in the figure, it is only necessary to centre the N-comb on the -6 to +6 order d-functions of the unit comb to obtain an accurate spectrum. The variable gmax determines the highest significant frequency location beyond which the d-function amplitudes are negligible, so gmax=6 for the first comb, for example.

It is necessary to determine gmax at each stage of the convolution so that

  1. only convolutions producing a significant contribution to the complex amplitude of the new unit comb are carried out and
  2. a comparison may be made with the simple method described above
The sixth order d-function of the N=2 comb lies at a distance of 6×2 from the centre of that comb, the comb origin itself sitting on gmax (=6) of the unit comb. (The unit of distance being the spacing of the fundamental unit comb). Therefore, the highest significant frequency of the new unit comb is n = 6+6×2 . It is shown in Chapter 3 that this is an oversimplification of the problem, but will allow a comparison to be made with the `simple' method regarding computational effort. The progress of gmax is shown in table 4.1 where gmax(2) is the highest significant frequency after 2 convolutions, for example.

Convolution Stage `n' gmax
1 6
2 gmax(1)+(6×2) = 6+(6×2)
3 gmax(2)+(6×3) = 6+(6×2)+(6×3)
Table 1: Furthest significant frequency after convolution with 1,2 &3 combs

The table shows the relation between convolution stage (which comb is now being convolved) and highest significant frequency that results to be

gmax(n) = 6 n
å
i=1 
i
(8)
where n denotes the convolution stage.

For each of the frequencies within the range [-gmax,+gmax] of the new unit comb, the complex amplitude must now be found. The observation frequency g takes on each frequency of this range and, recalling the equations for the correct summation indices m1 and mN it will be seen that mN must range from -6 to +6, or -P to +P using the previously introduced terminology. Thus thirteen products (2P+1) of Bessel functions are made . If the complex amplitude is stored in form a+ib, there are four multiplications to be made per JnJm multiplication as previously illustrated. The total number of multiplications involved in finding the spectrum is found by

Summation over combs to be convolved ån=1N
× No. of d-functions in comb2[ 6åi=1ni ]+1
× number of multiplications per d-function.4×2P

so that the total number of multiplications is given by

N
å
n=1 
 {2 [ n
å
i=1 
 i] + 1}×8P
(9)

This expression, together with that resulting from the `simple' method, is plotted in figure 4.2 below.


Figure D.2: Multiplications involved for `simple' and Bessel Method.

The `simple' method requires many orders of magnitude more calculations than the Bessel method of spectrum calculation. As such, it cannot be thought of as either fast or remotely elegant but serves to highlight the advantages of the Bessel function method introduced in chapter two.




File translated from TEX by TTH, version 3.02.
On 27 Oct 2001, 23:42.