VISUALIZATION: WIDEBAND GRID MAPPING FRESNEL DIFFRACTION By Laurence Hassebrook 11-28-2011 Reproduce Figs. 3 through 12 for credit equal to the HW problems. 1. WIDEBAND AND NARROW BAND SCALAR FIELD MODEL The scalar field model is a complex exponential. It does not include E and B fields or polarization. But it works quite well for coherent light holography and acoustic imaging. Other references for use of this model are Fourier optics, [1] diffraction optics, holography, array signal processing[2-4] and acoustic imaging. The field equation for a modulated signal is f (r ) = B (t ) exp⎛⎜ − j 2πf w (t )t − j 2π r ⎞⎟ λs ⎠ ⎝ r (1) where r is the distance from the point source, B(t) is an amplitude modulation function, fw (t) is the frequency modulation in cycles/second. If c is the speed of the wave front in a particular medium then the relationship between a temporal center wavelength, λc, of fw (t) and the spatial wavelength, λs, is given by λ s = c λc (2) Fig. 1 shows the relationship in distance r from the point source to various terminology. The scalar model is valid in the “far field” where the distance from the source is much greater than the spatial period. The far field is divided into two regions, the Fresnel and Fraunhofer regions. This discussion is about the Fresnel region where the wavefront is spherical. Later discussion will be about the Fraunhofer region where the wavefront from the point source approaches a plane wave. Space in general, has a transfer function that is a complex exponential with quadratic phase. At large distances, the quadratic phase approaches a linear one, thus in the Fraunhofer region, we have the Fourier transform of the source. As it turns out, an optical lens will compress space such that the Fraunhofer field at infinity is moved to the focal plane of the lens. Thus, in diffractive optics, an ideal lens can be used to perform a Fourier transform on an input field in the front focal plane at exactly 2 focal lengths. In acoustic applications, the lens can be replaced with electronic delays to an array of transducers as shown in Fig. 2. 1 Figure 1: Relationship between the wavefront source and different regions represented by wave models. Fig. 2 shows the layout of a 10 sensor array with the grid map region relatively close to the array and indicated by the rectangular border. The focal point is defined to be where all wavefronts arrive at the same time. If we consider constant values for the modulations as B = B(t) and fc = fw (t), then it can be determined by the temporal signal delays for each sensor and the grid map field value at any point {xg, yg} in the grid map is given by ⎛ ⎞ j 2π rn B exp⎜⎜ − j 2πf c t − − j Δθ n ⎟⎟ λs n =1 rn ⎝ ⎠ f grid (x g , y g ) = ∑ Ns ⎛ − j 2π (rn − Δrn ) ⎞ 1 ⎟⎟ = B exp(− j 2πf c t )∑ exp⎜⎜ λs n =1 rn ⎝ ⎠ Ns (3) where Δrn is the effective distance decrease in distance caused by the phase delay for each sensor n. The distance rn is the distance from the nth sensor at {xs,n, ys,n} to the grid point {xg, yg} such that: rn = (x − x g ) + ( y s ,n − y g ) 2 s ,n 2 (4) 2 The contour plot of the log amplitude of Eq. (3) is superimposed on the layout in Fig. 2 (right). Note that the amplitude increases with the square near the sensors but has a peak at the focal point which is set to be the center of the grid map region. Figure 2: (left) Transducer/sensor array and grid map layout. (right) An example amplitude field (in dB) superimposed on the layout. In this example there are 10 sensors and the grid map is positioned near to the array. Wide Band arrays are based on the narrowband approach but work with a wide range of frequencies. The type of wide band signals we will use are noise based and begin with white noise which is filtered into a desired colored noise signal. As in the narrowband scenario, the sensors have time delays set to cause the noise signals to arrive at a focal point all at the same time. What is different is that the received signals, at each point in the grid map, will be integrated over time. This adds numerical computation but simulates real world systems. Modifying Eq. (3) to include this temporal integration of the summed sensor intensities such that f grid (x g , y g ) 2 2 ⎞ r B ⎛ = ∫ ∑ s n ⎜⎜ t − n − ΔTn ⎟⎟ dt r ⎝ Ts ⎠ 0 n =1 n T Ns (5) Where sn( ) is the random noise sequence. NUMERICAL IMPLEMENTATION OF THE WIDEBAND FRESNEL MODEL 2.1 BandPass Filter Design Consider the Butterworth lowpass filter design based on frequency sampling. The Butterworth transfer function in the frequency domain is 3 H(f ) = 2 1 1 + ⎛⎜ f ⎞⎟ ⎝ f0 ⎠ (6) 2N If we sample such that f = n / Ns and f 0= k0 / Ns for n = 0, 1, …, (Ns-1), and consider the amplitude, then the transfer function is ⎛ ⎜ 1 H (k ) = ⎜ 2N ⎜ ⎛ ⎞ ⎜1+ ⎜ k k ⎟ ⎝ ⎝ 0⎠ ⎞ ⎟ ⎟ ⎟ ⎟ ⎠ 0.5 (7) The MATLAB code for a low pass Butterworth filter based on simple frequency sampling is: function H=lp_butterworth_oN_DFT1D_2011(Nx,kc,Norder) %determine odd or even length %to specify a specific discrete frequency let % kc and Nx are discrete time frequency half power and Nx is number of % points temp=floor(Nx/2); temp=temp*2; % test for odd or even evenodd=0; % guess odd if temp==Nx, evenodd=1; % even end; % determine the frequency vector if evenodd==1 n0=-((Nx/2)-1); else n0=-((Nx-1)/2); end; n1=n0+Nx-1; na=n0:1:-1; % index vector nb=0:1:n1; n=[nb,na]; H=((1 + (n/kc).^(2*Norder)).^(-0.5))+i*0; We set up the lowpass filter with, Nx, the number of samples in the noise sequence, the half power frequency in DT frequency kcut, the order of the Butterworth filter Norder. % WIDEBAND FRESNEL MODEL with Butterworth Filter channel clear all % 1-D butterworth filter created by sampling the frequency components % H[k]=Ha[k/T]; Nx=400; kcut=Nx/10; % HALF POWER FREQUENCY Norder=10; Hlp=lp_butterworth_oN_DFT1D_2011(Nx,kcut,Norder); The resulting filter response is shown in Fig. 3 4 Figure 3: Frequency sampled Butterworth LP filter. SIDE NOTE: The plot in Fig. 3 was obtained with the following code: figure(3); kindexcenter=1:Nx; kindexcenter=kindexcenter-Nx/2; plot(kindexcenter,fftshift(Hlp)); title('Low Pass Butterworth Transfer Function') xlabel('k Frequency'); ylabel('Response'); print -djpeg figure3 We use a cosine modulation of the LP impulse response to create the bandpass filter which represents the Channel response to the signals. % BANDPASS based butterworth kcenter=floor(Nx/6); hlp=ifft(Hlp); n=0:(Nx-1); sbp=cos((2*pi*kcenter)*n/Nx); hbp=sbp.*hlp; Hbp=fft(hbp); The result is shown in Fig. 4 as Figure 4: Bandpass Butterworth filter transfer function. 5 The impulse response of the BP filter is shown in Fig. 5. Figure 5: Impulse response of BP filter. The noise sequence is generated with the normal distribution pseudo random number generator “randn” in MATLAB as % generate white noise vector and spectra w=randn(1,Nx); Ew=sqrt(w*w')/Nx; w=w./Ew; W=fft(w); The magnitude of the DFT of w[n] is shown in Fig. 6. Figure 6: Magnitude of noise spectrum. The noise vector is filtered by the bandpass filter into a colored noise sequence whose spectrum is shown in Fig. 7 6 % bandpass white noise vector and spectra Wbp=W.*Hbp; wbp=real(ifft(Wbp)); Ewbp=sqrt(wbp*wbp')/Nx; wbp=wbp./Ewbp; Wbp=fft(wbp); Figure 7: Noise spectrum of filtered noise. The correlation of the two noise sequences, the “white” versus “colored” are shown in Figs. 8 and 9, respectively. % white noise correlation cwhite=real(ifft(W.*conj(W))); cwhite=cwhite/max(cwhite); Figure 8: Correlation of white noise sequence with itself. 7 % colored noise correlation cbp=real(ifft(Wbp.*conj(Wbp))); cbp=cbp/max(cbp); Figure 9: Correlation of colored noise sequence with its self. GRID MAPPING OF SENSOR ARRAY INTENSITY We begin the numerical implementation by defining the physical length of the array between +/– Ha/2 along the Y axis and at X=0, with Ns=5 such that: % GRID MAP WIDE BAND FRESNEL FIELD % Fresnel Model % Parameters % Number of sensors Nsensors=5; % x0,y0,x1,y1 of linear array (example in mm) Ha=300; % width of array in mm xa0=0;ya0=-Ha/2;xa1=xa0;ya1=Ha/2; % footprint of array sensors The grid map region is positioned 350 mm from the array but with the same length and centered about the X axis such that: % xg0,yg0,Wg,Hg of grid map region Wg=100;Hg=Wg; % footprint of reception region xg0=350; yg0=-Hg/2;xg1=xg0+Wg;yg1=Hg/2; % grid map size Ng=100;Mg=Ng; The axes for the plots are determined as % axes of grid map dx=Wg/Ng; xgrid=xg0:dx:(xg1-dx); dy=Hg/Mg; 8 ygrid=yg0:dy:(yg1-dy); The focal point is defined to be in the center of the grid map such that % choose a focal point of sensor to be in center of grid map xf=(xg1+xg0)/2;yf=(yg1+yg0)/2; The array sensor coordinate coefficients are calculated as % grid map coefficients of sensors % ay= (yg1-yg0)/(My-1); by=yg0-ay; aay= (ya1-ya0)/(Nsensors-1); bay=ya0-aay; The focal point is used to calculate the delay values in terms of fractional distance Rdelay such that: % determine delay vector Adelay=zeros(1,Nsensors); Rdelay=zeros(1,Nsensors); for n=1:Nsensors % determine distance rs to sensor xs=xa0;ys=aay*n+bay; rsg2=(xs-xf).^2+(ys-yf).^2; rsg=sqrt(rsg2); Rdelay(n)=rsg; end; % n Rdelay=Rdelay-min(Rdelay); % time delay, let each sample in the signal vector have a spacial distance % of lambda=Hg/Ng lamda=Hg/Nx Adelay=Rdelay/lamda; SIDE NOTE: The “lamda” variable was chosen as to cause indexing across the entire field range of Hg, to be 1 to Nx. This is somewhat arbitrary and should be optimized for a real application. While we did not use the following information, it would be relevant to an acoustic application: % misc specifications for wavefront NOT USED IN THIS VISUALIZATION cair=343.2*1000; % speed of sound in water (mm/sec) cwater=1482*1000; % speed of sound in water (mm/sec) c=cair % speed of sound in medium fs=40000 % sampling rate in samples per sec Ts= c/fs% (mm/sec) / (samples/sec) The parameter Ts would figure into deciding the lamda parameter for a real world implementation. GRID MAP WITH INTEGRATION The grid map calculation, including the temporal integration by “dt” is given by % grid map coefficients between u,v and x,y % xg0=ax*1+bx, xg1=ax*Ng+bx, yg0=ay*1+by, yg1=ay*Mg+by 9 % ax= (xg1-xg0)/(Ng-1); bx=xg0-ax; % ay= (yg1-yg0)/(Mg-1); by=yg0-ay; ax= (xg1-xg0)/(Ng-1); bx=xg0-ax; ay= (yg1-yg0)/(Mg-1); by=yg0-ay; % Loop through grid map Gmap=zeros(Mg,Ng)+i*zeros(Mg,Ng); for u=1:Ng for v=1:Mg % loop through sensor contribution xg=ax*u+bx; yg=ay*v+by; for dt=1:Nx intensity=0; for n=1:Nsensors % determine distance rs to sensor xs=xa0;ys=aay*n+bay; rsg2=(xg-xs).^2+(yg-ys).^2; rsg=sqrt(rsg2); coef=1/rsg; % distance attenuation coefficient % coef=1; dt2=dt+(rsg-Rdelay(n))/lamda; dt2=mod((dt2-1),Nx)+1; dt3=floor(dt2); if dt3>Nx dt3=dt3-Nx; end; if dt3<1 dt3=dt3+Nx; end; intensity=intensity+wbp(dt3)*coef+i*0; end; % n % intensity is magnitude squared of amplitude Gmap(v,u)=Gmap(v,u)+abs(intensity).^2; end; % dt end; % v end; % u Note the scaling of the index by 1/lamda. Also note, the use of intensity combination of the all the sensors at each point in time dt. 10 Figure 10: Discrete Time delays for each sensor in array. The sequence is Adelay. The DT delays in Fig. 10 are reduced by subtracting away the smallest delay to the focal point from all sensor paths. Thus the delay is obtained to make all distances equal The resulting grid map contour is shown in Fig. 11. Figure 11: Gray level contour of field intensity in grid map region. A 3-D representation is shown in Fig. 12. 11 Figure 12: 3‐D representation of the grid map intensity. A log of Fig. 11 contour is shown in Fig. 13. Notice the interference causing the sidelobe responses. Also note that because the model can go near zero value, we added 1/100 of the maximum amplitude before taking the log to prevent the low values from dominating the log plot. Figure 13: Colorized log plot of the contour in Fig. 11. Try changing parameters to sharpen the peak as shown in Fig. 12. There are different ways to do this such as increasing the array length, or increasing the number of sensors or decreasing the wavelength. For the same number of sensors, how does this performance compare with the 12 narrowband array (be sure that your narrowband system has been modified with the correct “coef” and is in intensity, not magnitude). Use “coef=1/rsg” and square the abs(Gmap(.)) values. REFERENCES 1. J.W. Goodman, Introduction to Fourier Optics, McGraw Hill Book Company, San Francisco, 1968. 2. Mehroad Soumekh, Fourier Array Imaging, Prentice Hall, Inc. Englewood Cliffs, New Jersey, 1994. 3. D. H. Johnson and D. E. Dudgeon, Array Signal Processing, Concepts and Techniques, Series editor A.V. Oppenheim, Prentice Hall, Inc. Englewood Cliffs, New Jersey, 1993. 4. S. Unnikrishna Pillai, Array Signal Processing, Springer-Verlag New York Inc., 1989. APPENDIX: Graphing Code Figure numbers may not match the figures in the text: % grid map plots figure(8) plot(Adelay); title('Sensor Signal Delay') xlabel('Sensor Index'); ylabel('Discrete Time Delay'); print -djpeg figure8 figure(9); imagesc(xgrid,ygrid,abs(Gmap)); colormap gray; %colormap(vga); title('3-D surface contour of field intensity') xlabel('X (mm)'); ylabel('Y (mm)'); print -djpeg figure9 figure (10) colormap(gray); colormap(vga); colormap(jet); surf(xgrid,ygrid,abs(Gmap)); shading interp title('3-D surface topology of field intensity') xlabel('X (mm)'); ylabel('Y (mm)'); print -djpeg figure10 figure(11); maxG=max(max(abs(Gmap))); imagesc(xgrid,ygrid,log(abs(Gmap)+maxG/1000)); colormap gray; colormap(jet); title('3-D surface contour of field Log(intensity)') xlabel('X (mm)'); ylabel('Y (mm)'); 13 print -djpeg figure11 14