Solutions For Homework #7: Problem 1
Solutions For Homework #7: Problem 1
_
_
1
_
x
2
+ y
2
dy
_
e
i2qx
dx (2)
In the above, the inner integral can be seen as the Abel transform of f(r), while
the outer integral is the 1D Fourier transform evaluated at frequency q.
We make the following variable substitutions
x = r cos()
y = r sin()
In other words, we change coordinate systems from Cartesian to Polar. Notice
that
dxdy = rdrd (3)
Thus, the integral for the Hankel Transform above becomes
H(q) =
_
2
0
_
0
1
r
e
i2r cos()
rdrd (4)
Recalling the denition of the Bessel function
2J
0
(2rq) =
_
2
0
e
i2rq cos()
(5)
we see that,
H(q) =
_
0
2 J
0
(2rq) dr
=
2
2q
_
0
J
0
(u) du
=
1
q
1
where we have made a change of variables in the second line above, u = 2qr.
Thus, we see that the Hankel Transform of f(r) =
1
r
is
1
q
Problem 2:[10 pts]
(a) We model the aperture illumination function as a circular pillbox as follows
f(r) = rect
_
r
D
_
(6)
where D = 2.5 meters. We know that the Hankel Transform of f(r) is a
jinc function
F(q) = D
2
jinc(Dq) = D
2
J
1
(Dq)
2Dq
(7)
The Fraunhofer approximation gives the power-pattern of the antenna in the
far-eld
P() = |F
_
sin()
_
|
2
|D
2
jinc
_
D
_
|
2
where we have applied the small-angle approximation
sin()
. Figure 1
shows the 2D power-pattern, while a cut through the power-pattern is shown
in Figure 2. The cut through the power-pattern is denoted by the dotted line
in Figure 2. As we can see, the null-to-null width is about 0.1 seconds of
arc. Note: The horizontal axis of Figure 2 is plotted in terms of seconds of
arc by the following relation
q
180
o
3600 (8)
where q =
1
r
is spatial frequency. We anticipate this value of 0.1 arc seconds
for the null-to-null width of the untapered power-pattern through recogniz-
ing that the rst null of the jinc function given above occurs at the value of
1.22, corresponding to a value of , in arc seconds, of
1.22
D
180
r=0
f(r)J
0
(2qr)rr (13)
where, of course, the step size r = 1. In addition, the frequency variable
q assumes the values 0,
1
2n
, ....,
n1
2n
. To implement the Bessel function, we
make use of the MATLAB command
besselj(0,r)
.
5
(b) We implement the same function f(r) given in Part (a) in two-dimensions
as follows
f(r) =
1
(a/2)
2
rect
_
_
x
2
+ y
2
a
_
(14)
where x = n, n+1, ...0, ...n1 and y = n, n+1, ...0, ...n1. The Han-
kel Transform of this 2D circularly symmetric function can be easily com-
puted using the 2D FFT (remember that for a circularly-symmetric function,
the Hankel Transform is identical to the two-dimensional Fourier Trans-
form). The Hankel Transform of the 2D function is shown in Figure 5.
We are required to take cuts through the 2D function shown in Figure 5 in
normalized frequency
n
o
r
m
a
l
i
z
e
d
f
r
e
q
u
e
n
c
y
0.2 0.1 0 0.1 0.2
0.2
0.15
0.1
0.05
0
0.05
0.1
0.15
0.2
Figure 5:
the directions dened by the lines at angles 0
o
and 45
o
from the horizontal
axis. The cut at 0
o
is easily obtained by extracting values along a horizontal
line passing through the center of the function. The code that extracts the
cut at 45
o
is given at the back. Note: when displaying the cut at 45
o
, the
1D frequency axis needs to be stretched by a factor of
2, reecting the
fact that discrete steps (in the u v plane) at 45
o
are
r
2
x
2
(16)
Here, we are given the data a(x) evaluated at discrete values of x. Note that
the spacing between points in the prole a(x) is x = 0.01 and the number
of samples in le is 600. Our task is to recover the 2D, circularly symmetric
function f(r) using the Abel-Fourier-Hankel relationship. Note: to load in
the text le, we make use of MATLABs
load
command. The rst column gives the values a long the axis perpendicular
to the projection direction where the projection is evaluated. This function
is plotted in Figure 9
8
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
normalized frequency
numerical integration
2D FFT0
o
2D FFT45
o
jinc
Figure 8:
(b) Recall the Abel-Fourier-Hankel relationship:The Hankel Transformof the
2Dcircularly-symmetric function is equivalent to the 1DFourier Trans-
form of the functions Abel Transform. Mathematically, letting F(q) de-
note the Hankel Transform of the function f(r),
F(q) =
_
A(x)e
i2qx
dx (17)
where A(x) is as was given in Part (a). To recover the 2D function, we
would simply compute the Inverse Hankel Transform of F(q). Note that the
prole contained in the le hw7p4data is essentially A(x). Notice, however,
that the Abel Transform should return even functions. Thus, the data we
are given, shown in Figure 9, is probably the right half of the full, even
Abel Transform of the desired 2D function f(r). We thus form a new, even
function as follows
a
(x) = {
a(x) x > 0
a(x) x < 0
(18)
We then compute the 1D FFT of A
(x) is exactly one such radial cut of the 2D spectrum the desired 2D
9
0 1 2 3 4 5 6
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
spatial variable
noisy projection
Figure 9:
function. Let this spectrum be denoted A(q). To recover a radial cut of
the desired 2D circularly-symmetric function f(r), we compute the Inverse
Hankel Transform, in one dimension, of the 1D spectrum A(q). The Inverse
Hankel Transform is dened as
f
1D
(r) =
_
0
A(q)J
0
(2qr) qdq (19)
We approximate this integral by a sum, as we did in Problem 3.
f
1D
(r)
N1
i=0
A(q
i
)J
0
(2q
i
r)q
i
q (20)
Here, q refers to the frequency spacing in the FFT domain. We know that
the spatial separation of points in the data le hw7p4data is x = 0.01 and
the number of samples N = 2600 = 1200 (remember, the length of a
(x)
is twice the length of a(x)). Therefore, the frequency spacing q =
1
Nx
and the FFT frequencies q = 0,
1
Nq
, ...,
N1
Nq
. Plugging these values in the
discrete sum above, we recover the 1D cut, shown in Figure 10, through the
desired radially-symmetric 2D function f(r).
(c) The MATLAB code that we use to form the image from the 1D radial cut
f
1D
(r) shown in Figure 10 is given at the back. Essentially, we create a grid
(x, y) and copy the i-th value in the 1D prole f
1D
(r
i
) to all locations where
_
x
2
+ y
2
r
i
. The recovered 2D, circularly-symmetric function f(r) is
shown in Figure 11 f(r).
10
0 1 2 3 4 5 6
10
5
0
5
10
15
20
25
spatial variable
recovered 1D profile of
circularlysymmetric function
Figure 10:
horizontal distance
v
e
r
t
i
c
a
l
d
i
s
t
a
n
c
e
recovered 2D circularly symmetric function
5 0 5
6
4
2
0
2
4
6
5
0
5
10
15
20
Figure 11:
Problem 5:[10 pts]
The integral denition of the Bessel function of First Kind, order 0, J
0
(2qr)
is given by
J
0
(2qr) =
1
2
_
2
0
cos(2qr cos()) d (21)
In the above, q denotes frequency. For this problem, we are asked to produce three
Bessel functions of frequencies 4,7 and 10. This equation arises by adding up 2D
11
cosine functions rotated from the x-axis at various angles . That is,
J
0
(2 qr)
1
2
i
cos(2q(xcos(
i
) + y sin(
i
))) (22)
Here, q =
1
wavelength
is the spatial frequency, and we dene wavelength as
N
m
, m =
4, 7, 10, where N is the number of points along one dimension in our grid, is
the spacing between points and m indicates number of cycles over the span of the
grid. The MATLAB code implementing this is given at the back.
Figure 12 gives the three plots. The dots indicate the sum approximation,
while the solid line is the theoretical curve J
0
(2qr) where, of course, r =
_
x
2
+ y
2
.
0 10 20 30 40 50 60
0.5
0
0.5
1
approximation and theoretical, freq = 4
sum approx
theoretical
0 10 20 30 40 50 60
0.5
0
0.5
1
approximation and theoretical, freq = 7
sum approx
theoretical
0 10 20 30 40 50 60
0.5
0
0.5
1
approximation and theoretical, freq = 10
sum approx
theoretical
Figure 12:
MATLAB code for Problem 4
12
% load in data
im = load(hw7p4data);
data2 = im(:,2); x = im(:,1); data2 = data2;
Delta = x(2)-x(1);
% plot noisy projection
figure(1); plot(x,data2);grid on;
h=gca;set(h,FontSize,20); xlabel(spatial variable);
h1=title(noisy projection);set(h1,FontSize,20);
% make data an even function
data = [fliplr(data2(2:end-1)) data2];
N = length(data);
% Abel to Hankel - take FFT of data,
% but keep only positive Fourier coefficients since function
% real and even
F = real( fft(fftshift(data)) ); F = F(1:N/2);
q = [0:N/2-1]/N/(Delta);
% Inverse Hankel Transform, approximated by
% sum_{i=1}N/2 F(q_i) q_i J0(2 pi q_i r) Delta q
r = [0:N/2-1]
*
(Delta
*
sqrt(2));
f = zeros(size(r));
Delta_q = q(2) - q(1);
for k=1:length(r)
f(k) = sum(F(:).
*
Delta_q.
*
q(:).
*
besselj(0,2
*
pi
*
r(k).
*
q(:)));
end
% plot recovered 1D function
figure(2); plot(r, f); grid on;
h=gca;set(h,FontSize,20); xlabel(spatial variable);
h1=title({recovered 1D profile of,circularly-symmetric function});
set(h1,FontSize,20);
13
% create 2D function from 1D profile
rmax = max(r); NN = 4
*
ceil(rmax./Delta/sqrt(2));
horiz = [-NN/2:NN/2-1]
*
Delta; vert = [-NN/2:NN/2-1]
*
Delta;
theta = linspace(0,2
*
pi,2
*
length(f));
f2D = zeros(NN,NN); counts = zeros(NN,NN);
for k = 1:length(f)
if(r(k) = 0)
Rows = round( r(k)
*
sin(theta)./Delta/1 ); Rows = Rows + NN/2 + 1;
Cols = round( r(k)
*
cos(theta)./Delta/1 ); Cols = Cols + NN/2 + 1;
ind = find((Rows <= NN) & (Cols <= NN) );
Rows = Rows(ind); Cols = Cols(ind);
f2D(sub2ind(size(f2D),Rows,Cols)) =
f2D(sub2ind(size(f2D),Rows,Cols)) + f(k);
counts(sub2ind(size(f2D),Rows,Cols)) =
counts(sub2ind(size(f2D),Rows,Cols)) + 1;
else
f2D(ceil(NN/2),ceil(NN/2)) = f(k);
end
end
f2D(find(counts=0)) = f2D(find(counts=0))./counts(find(counts=0));
figure(3); imagesc(horiz,vert,f2D); grid on;
h=gca;set(h,FontSize,20); xlabel(horizontal distance);
ylabel(vertical distance); axis image;
h1=title(recovered 2D circularly symmetric function);
set(h1,FontSize,20); colorbar\\
MATLAB code for Problem 5
14
% parameters
N = 1024;
Delta = 0.1;
a = [N/4 N/7 N/10]
*
Delta; % wavelength
% create spatial array
horiz = [-N/2:N/2-1]
*
Delta; vert = [-N/2:N/2-1]
*
Delta;
[Cols,Rows] = meshgrid(horiz,vert);
rr = sqrt(Rows.2 + Cols.2);
% create angles between 0 and 2 pi radians
% Angles are measured from x-axis;
theta = linspace(0,2
*
pi,20);
% create cosines of varying wavelengths
for k = 1:length(a)
% create horizontal and vertical spatial frequencies
% from theta definition and wavelengths
u = a(k)
*
cos(theta); v = a(k)
*
sin(theta);
q = 1./sqrt( u.2 + v.2 );
% perform sum of 2pi radians as
% (1/2/pi) sum_{i=1}N cos( q r cos(theta) )Delta_theta
map2 = zeros(size(Cols));
for m = 1:length(theta)
disp(m);
map2 = map2 +
cos( 2
*
pi
*
(q(m)
*
cos(theta(m))
*
Cols + q(m)
*
sin(theta(m))
*
Rows) );
end
map2 = map2./length(m);
% extract horizontal cut and store
num_bessel2(k,:) = map2(N/2+1,N/2+1:N)./max(map2(N/2+1,N/2+1:N));
theo_bessel(k,:) = besselj(0,2
*
pi
*
q(1)
*
[0:N/2-1]
*
Delta);
end
15