Professional Documents
Culture Documents
Abstract—The implementation of code to efficiently compute the array TABLE I: The computer hardware used to test the algorithms.
factor and sidelobe level (SLL) of linear antenna arrays in MATLAB and C1 C2 C3
GNU Octave is considered. The use of a fast Fourier transform (FFT)
to compute the array factor is shown to be more efficient than other Intel 2×Intel 2×Intel
Type
approaches. The automatic determination of the sidelobe region as a Xeon 5140 Xeon 5355 Xeon E5-2630
CPU
necessary step to computing the SLL is addressed. A number of code- Architecture Woodcrest Covertown Sandy Bridge-EP
optimsation techniques in MATLAB and Octave are evaluated, including Cores 2 2×4 = 8 2×6 = 12
vectorisation, memory allocation and the use of built-in functions. Finally, Clock speed 2.33 GHz 2.66 GHz 2.30 GHz
an efficient function which can be used for the computation of the array Cache 4 MB 8 MB 15 MB
factor and SLL of linear arrays in MATLAB and Octave is presented. Main memory 6 GB 8 GB 32 GB
Index Terms—Linear arrays, antenna radiation patterns, software
libraries.
sidelobe level (SLL) of linear arrays. This discussion will be used
to develop an efficient function which can be used in MATLAB
I. I NTRODUCTION and GNU Octave, and which can be adapted to other programming
TABLE II: The effect of the number of angular points on the accuracy
of the SLL computation for a 200-element array.
SLL error (dB)
Points
Minimum Median Maximum Mean Std. dev.
2 000 0.000 0.033 0.254 0.044 0.042
2 500 0.000 0.024 0.151 0.032 0.030
3 000 0.000 0.017 0.109 0.023 0.022
3 500 0.000 0.015 0.084 0.019 0.016
4 000 0.000 0.012 0.062 0.015 0.013
4 500 0.000 0.009 0.051 0.012 0.011
65 536 0.000 0.000 2.07·10-4 3.67·10-6 1.71·10-5
Fig. 1: The geometry of a linear antenna array with the antenna
elements denoted by circles.
factor of an antenna array can be computed using a discrete Fourier
transform (DFT) [14].
this section.
The importance of the DFT has led to the development of FFT
algorithms which apply algorithmic and code optimisations to allow
A. Mathematical Analysis efficient computation of the DFT [15], [16]. The main implication of
The geometry of a linear antenna array is shown in Fig. 1, and its (10) is that these efficient FFT algorithms can be exploited to achieve
pattern can be computed using [14] rapid computation of the array factor.
The angles corresponding to each value of k in (10) can be
P (θ) = F (θ) AF (θ) (1) computed from
where P (θ) is the array pattern and F (θ) is the element pattern k
= u mod 1 (11)
with θ denoting either θb or θe in Fig. 1. The array factor AF (θ) is M
given by [14] d d
= sin (θb ) mod 1 = cos (θe ) mod 1 (12)
N
X −1 λ λ
jβnd sin(θb )
AF (θb ) = an e (2) where the modulo function, mod, is the remainder after division
n=0
defined by
N −1
X x
AF (θe ) = an ejβnd cos(θe ) (3) x mod y = x − y . (13)
y
n=0
where n is the index of the antenna elements, N is the number of For the special case of half-wavelength spacing of the antenna
antenna elements, an are the excitations of the antenna elements, β elements,
(
is the propagation phase constant defined by 2π/λ with λ denoting k
if k ∈ 0, M
2M 2
the wavelength, and d is the spacing between the antenna elements. sin (θb ) = cos (θe ) = k
(14)
− 1 if k ∈ M
2 M 2
,1
Defining
d d can be used to relate k to the angles θb and θe .
u= sin (θb ) = cos (θe ) (4) The main consequence of (12) is that the equal spacing of the
λ λ
values of k leads to a unequal spacing in terms of the angles θb
allows the array factor to be rewritten as
and θe . The nature of the sinusoidal functions means that the points
N
X −1 will be most closely spaced in the broadside direction (θb = 0◦ and
AF (θ) = an ej2πnu . (5) θe = 90◦ ).
n=0
(see Section III-B), so 4 096 points will be used for the computation
1 % Array l e n g t h .
of the array factors of 200-element arrays.
2 n elements = 200;
3 % Number o f t i m e s e a c h t e s t i s r e p e a t e d .
IV. C ODE O PTIMISATION 4 n runs = 100;
This section considers a number of optimisations which can be 5 % The number o f s i m u l t a n e o u s c o m p u t a t i o n s .
applied when MATLAB and Octave are used to compute the array 6 n s i m u l = 2 e3 ;
factor. 7 % The number o f a n g l e s c o n s i d e r e d
The code provided in Fig. 2 will be used to generate the majority 8 n a n g l e s = [ 1999 2000 2048 2500 2503 3000
3001 3499 3500 4000 4001 4093 4096 ] ;
of the results provided in this section. While the details of each
9
subsection of the code will be considered in detail below, the general- 10 t i m e s = z e r o s ( n r u n s , numel ( n a n g l e s ) , 5 ) ;
purpose control code is first briefly described. 11 f o r i n a n g l e s = 1 : numel ( n a n g l e s )
Lines 1 to 8 of Fig. 2 set a number of constants which control the 12 % I n i t i a l i s e the angles .
execution of the algorithm. The time required for each array-factor 13 c angle = n angles ( i n angles )
computation is determined using a tic - toc pair and is stored in the 14 temp = l i n s p a c e ( 0 , 2 , c a n g l e + 1 ) ’ ;
variable times which is initialised on Line 10 and updated in Lines 36, 15 i n d e x = temp >= 1 ;
40, 47, 53 and 58. The loop between Lines 11 and 60 steps through 16 temp ( i n d e x ) = temp ( i n d e x ) − 2 ;
the variable n angles which determines numbers of angular points at 17 f f t a n g l e s = a s i n ( temp ( 1 : ( end − 1 ) ) ) ;
which the array factor is computed. Line 13, in which the number 18 dir angles = sort ( fft angles ) ;
19 % I n t i a l i s e random number g e n e r a t o r .
of angular points used in the computation is selected, is intentionally
20 i f e x i s t ( ’OCTAVE VERSION ’ , ’ b u i l t i n ’ )
not terminated by a semi-colon to allow the value to be displayed 21 rand ( ’ s e e d ’ , 1 ) ; % O c t a v e
as a form of progress monitor. Lines 19 to 24 initialise the random- 22 else
number generator to a fixed initial state to ensure that all tests are 23 r n g ( 1 ) ; % MATLAB
conducted using the same array excitations. The array excitations 24 end
for n simul arrays each of which has n elements elements are set by 25 % I n i t i a l i s e d i r e c t −c o m p u t a t i o n m a t r i x .
Line 31. Lastly, the loop between Lines 28 and 59 ensures that each 26 n = 0 : ( n elements − 1) ;
test is run n runs times so that reliable timing results can be achieved 27 U = exp ( 1 i ∗ 2 ∗ p i ∗ 0 . 5 ∗ s i n ( d i r a n g l e s ) ∗ n ) ;
through averaging. The output variables are all cleared in Line 29 to 28 for i n runs = 1: n runs
29 c l e a r d i r a f f f t a f l p a f l p i a f mem af
ensure that all computations start from the same state.
30 % Create the arrays .
Unless otherwise specified, the results presented below are the
31 a r r a y s = rand ( n e l e m e n t s , n s i m u l ) ;
average execution times of 100 independent runs of the relevant al- 32 % Time c o m p u t a t i o n o f t h e a r r a y f a c t o r s .
gorithm, with each run performing 2 000 simultaneous computations 33 % Direct computation .
of the array factors of 200-element arrays at the specified numbers of 34 tic
angles. The excitation of each antenna element was randomly selected 35 d i r a f = U∗ a r r a y s ;
from a uniformly distribution over the range [0, 1]. 36 times ( i n runs , i n angles , 1) = toc ;
37 % FFT c o m p u t a t i o n .
38 tic
A. Vectorisation of Operations
39 f f t a f = i f f t ( arrays , c angle ) ;
1) Description: Vectorisation is the term used to describe the 40 times ( i n runs , i n angles , 2) = toc ;
process of rewriting an equation to allow large numbers of computa- 41 % FFT c o m p u t a t i o n − l o o p , pre − a l l o c a t e .
tions to be performed simultaneously by exploiting vector and matrix 42 tic
operators and built-in functions. The way software such as MATLAB 43 l p i a f = zeros ( c angle , n simul ) ;
and Octave functions means that vector and matrix operations and 44 for i f f t = 1: n simul
built-in functions are significantly faster than using loops to perform 45 lpi af (: , i fft ) =
i f f t ( arrays ( : , i f f t ) , c angle ) ;
computations. Vectorisation of both the direct and FFT approaches
46 end
to computing the array factor are considered below. 47 times ( i n runs , i n angles , 3) = toc ;
The vectorised form of the direct computation of the array factor 48 % FFT c o m p u t a t i o n − l o o p .
in software such as MATLAB and Octave is most easily understood 49 tic
by noting that (5) can be rewritten as 50 for i f f t = 1: n simul
51 lp af (: , i f f t ) =
AF = U a (15) i f f t ( arrays ( : , i f f t ) , c angle ) ;
where 52 end
T 53 times ( i n runs , i n angles , 4) = toc ;
AF = AF (θ0 ) AF (θ1 ) · · · AF (θm ) · · · AF (θM −1 ) 54 % FFT c o m p u t a t i o n − wrong d i m e n s i o n .
T (16) 55 t arrays = arrays ’ ;
a= a0 a1 a2 ··· an ··· aN −1 (17) 56 tic
57 mem af = i f f t ( t a r r a y s , c a n g l e , 2 ) ;
ej2π(N −1)u0
ej 2π 0 u0 ej 2π 1 u0 ··· 58 times ( i n runs , i n angles , 5) = toc ;
ej 2π 0 u1 ej 2π 1 u1 ··· ej2π(N −1)u1
59 end % f o r i n r u n s = 1 : n r u n s
.. .. .. .. 60 end % f o r i n a n g l e s = 1 : numel ( n a n g l e s )
. . . .
U= (18)
ej 2π 0 um ej 2π 1 um ··· ej2π(N −1)um Fig. 2: Code suitable for MATLAB and Octave which determines the
.. .. ..
.. execution time of a number of different options to compute the array
. . . .
factor.
ej 2π 0 uM −1 ej 2π 1 uM −1 · · · ej2π(N −1)uM −1
4
with TABLE III: A comparison between the performance of the direct and
d d FFT approaches to computing the array factor.
um = sin (θb m ) = cos (θe m ) . (19)
λ λ MATLAB Octave
The main benefit of using (15) to compute the array factor is that the Points Case C1 C2 C3 C1 C2 C3
matrix multiplication implicitly performs the summation in (5). (ms) (ms) (ms) (ms) (ms) (ms)
Further improvement can be achieved by assembling the column Direct 915 256 48 997 375 206
vectors of a number of excitations into a matrix, giving 4 093 FFT 629 165 68 998 592 404
Loop 1 188 1 060 740 1 289 2 173 1 038
A = a0 a1 a2 · · · ap · · · aP−1 (20) Direct 959 255 48 996 374 206
4 096 FFT 209 86 25 451 477 273
where there are P array excitations. The array factors can then be Loop 361 335 274 643 894 522
computed simultaneously using
800
AFall = U A (21)
700
almost identical to (21), except that the matrix multiplication in (21) 400
has been replaced by an FFT algorithm in (23).
2) Code: Lines 14 to 18 of Fig. 2 show the computation of the 300
broadside angles (θb ) used for the array-factor computation. Note that 200
while the code in Fig. 2 uses the same angles for both the direct and
FFT computations, this was only done to allow direct comparison 100
between the results and is not a requirement. The formulation of the
0
direct computation places no restrictions on the angles at which the 0 2 4 6 8 10 12
array factor is computed, so any angles may be used. This one clear Number of cores
benefit of the direct approach over the FFT approach.
(b)
The implementation of (18) to compute the matrix U is seen in
Matlab C1 Matlab C2 Matlab C3
Lines 25 to 27 of Fig. 2. The variables dir angles and n are column
Octave C1 Octave C2 Octave C3
and row vectors respectively, so that the multiplication dir angles ∗n
in Line 27 results in the necessary matrix structure. Note that the Fig. 3: The time to compute the array factor at 4 096 angular points
computation of U is not included in the direct-computation timing as a function of the number of CPU cores for (a) direct and (b) FFT
results as it is a fast operation which only needs to be performed computation.
once.
The direct computation of the array factor in (21) is implemented
by Line 35 of Fig. 2, while the FFT computation of the array factor for Octave differ somewhat with the FFT only being faster than the
from (21) is seen in Line 39. In both cases, the lack of loops is direct computation on computer C1 .
evident, and the simple form of the relevant code mimics that of As expected, using a loop rather than a vectorised computation
the simplicity of (21) and (23) rather than the complexity of the of the array factor leads to significant performance reductions in
underlying operations. Table III. The benefit of vectorising operations is thus clearly demon-
For comparison purposes, a version of FFT computation which is strated.
not vectorised is included in Lines 43 to 46 of Fig. 2. In this case, These results are explored further in Fig. 3 where the effect of
a loop is used to compute the array factors which were computed the number of cores available for the array-factor computation is
simultaneously in the two previous cases. explored. Fig. 3(a) presents results for the direct computation of the
3) Results: The times taken to compute the array factor using the array factor, while Fig. 3(b) shows the comparable results for the
direct, FFT and looped FFT approaches to computing the array factor FFT computation.
for an array with half-wavelength spacing are shown in Table III. Significantly, the improvement achieved by using q CPUs in Fig. 3
Table III clearly shows that the use of a FFT to compute the array is less than q times better than the case where only one CPU is
factor is faster in almost every case when MATLAB is used. The used. This result is actually well-known and applies in general, but
only exception is on computer C3 when the number of points used is sometimes not as widely realised as may be expected.
to compute the array factor is a large prime, but Section IV-C shows The most important observation from Fig. 3 is that MATLAB
that this number of points is an extremely poor choice. The results clearly outperforms Octave for the cases considered.
5
TABLE VI: The effect of the FFT length on the performance of the TABLE VII: Comparison of two methods of computing the pattern
FFT algorithms. magnitude.
MATLAB Octave MATLAB Octave
FFT Prime C1 C2 C3 C1 C2 C3 Computed C1 C2 C3 C1 C2 C3
length factors (ms) (ms) (ms) (ms) (ms) (ms) (ms) (ms) (ms) (ms) (ms) (ms)
1 999 1999 310 110 40 435 273 161 |AF | 168 44 12 340 306 151
2 000 24 · 53 138 71 23 286 292 164 |AF |2 272 239 118 348 366 183
2 048 211 109 72 42 203 232 126
2 500 2 · 54
2 155 68 18 368 386 181
2 503 2503 357 111 40 570 349 241 D. Pattern Magnitude Computation
3 000 23 · 3 · 53 185 62 22 441 453 216
1) Description: The magnitude of the array factor is usually more
3 001 3001 465 118 49 705 419 301
important than the phase because the magnitude determines key
3 499 3499 580 148 63 901 510 365
antenna parameters such as the gain, beamwidth and SLL.
3 500 22 · 53 · 7 220 73 25 516 514 250
The natural approach to compute the magnitude of the array factor
4 000 25 · 53 251 84 29 590 583 286
is to make use of the complex-magnitude function abs() . However,
4 001 4001 624 159 66 937 550 376
this results in the computation of
4 096 212 209 86 25 451 477 273
q
|AF | = Re{AF }2 + Im{AF }2 (25)
West (FFTW) library do not have this restriction [16]. The FFTW which requires two multiplications to compute the squares, an addi-
library is arguably the most important FFT library as a result of its tion and square root. Unfortunately, computation of a square root is
use in software packages such as MATLAB [18] and Octave [19]. a complex process on most computing systems and can thus lead to
The manual for the FFTW library states that it performs best when reduced performance.
the length of the FFT computations is of the form [20] The need to compute a square root can be removed by computing
the squared magnitude of the array factor from
N = 2a · 3b · 5c · 7d · 11e · 13f (24)
|AF |2 = Re{AF }2 + Im{AF }2 . (26)
where a, b, c, d, e and f are integers with minimum values of zero
and e + f = 0 or 1. This means that the FFTW algorithm is expected While it may be argued that this is not the desired result, the squared
to give the best results when the FFT length is the product of small magnitude and the magnitude can be used interchangeably. The key
prime factors, and to perform poorly when the FFT length is a large observation in this regard is that
prime number.
2) Code: Line 39 of Fig. 2 was used to compute the array factor |AF1 | < |AF2 | (27)
using the FFT for the specified numbers of points. is identical to
3) Results: The effect of using different numbers of angular points
(different FFT lengths) in MATLAB and Octave is shown in Table VI. |AF1 |2 < |AF2 |2 . (28)
The FFT lengths chosen ranged from 2 000 to 4 000 in steps of 500,
This means that algorithms which, for example, optimise the SLL
along with the closest primes to these values and the powers of two
of an array factor can compare either the magnitude or the squared
closest to this range.
magnitude without affecting the result. Furthermore, the decibel value
The most significant observation from Table VI is that the execu-
of the array factor can be computed from
tion time does not increase linearly as the FFT length increases. This
is anticipated in light of (24). AFdB = 20 log10 (|AF |) (29)
When the FFT lengths are a power of two (2 048 and 4 096), = 10 log10 |AF |2
(30)
the execution time in Table VI is significantly lower than at nearby
values. Again, this is anticipated as FFT algorithms are extremely so cases where, for example, the 3-dB beamwidth must be deter-
efficient in such cases [15]. This leads to the conclusion that setting mined are merely
√ computed by comparing to a different constant
the FFT length to a power of two remains the recommended approach (|AF | = 1/ 2 and |AF |2 = 1/2) without otherwise changing the
even when advanced FFT algorithms such as FFTW are used. computation. The magnitude of an array factor is in units of field
The longest execution times in Table VI are obtained when the FFT strength, so the conversion of the magnitude to decibels should use
length is a prime number, as expected. Using FFT lengths which are a factor of 20 as shown in (29).
prime factors should thus be avoided. 2) Code: The computation of the magnitude using abs( fft af )
However, the most interesting result from Table VI is that the and the squared magnitude using real ( fft af ) .ˆ2 + imag( fft af ) .ˆ2
execution times for FFT lengths of 3 000 were faster than for FFT were compared. The value of fft af was computed using the code
lengths of 4 096. Furthermore, the penalty for using 4 000 points in Fig. 2.
instead of 4 096 points is surprisingly small with all but one of the 3) Results: The comparison between the computation of the mag-
penalties being 20% or less. The FFT length does thus not have to be nitude and the magnitude squared is shown in Table VII. Surprisingly,
a power of two to be efficient as long as the FFT length is a product the computation of the magnitude using abs() is faster than the
of small primes. This leads to the surprising conclusion that rounding computation of the magnitude squared, despite the fact that the
up to the nearest power of two can actually lead to slower execution magnitude requires the additional computation of a square root.
in many cases. The reason that the magnitude computation is faster is that abs()
The selection of the number of angular points at which the array is a built-in function in MATLAB and Octave. This means that the
factor is computed is thus more strongly determined by the required operations required to compute the magnitude have been compiled by
accuracy of the array-factor computation than by FFT algorithm the authors of the MATLAB and Octave leading to fast execution. By
performance. comparison, the computation of the squared magnitude requires that
7
10001011000111111111111111111111111111111101011011
five built-in functions ( real () , imag(), .ˆ2 twice and +) be performed
and their results combined by the interpreter – a far slower process. 0
Normalised
preferable in MATLAB and Octave unless the required function is -10
not available and no similar functions exist. -15
While the above discussion is of limited value to MATLAB and -20 -20.15
Octave, it is far more significant when other programming languages -25
such as C and C++ are considered. In languages such as these, all
-30
code is compiled, so the code implemented by a developer will 0 0.2 0.4 0.6 0.8 1
be executed in the same way as library code. The implementation u
of a custom squared-magnitude function is thus expected to lead (a)
to significantly faster execution due to the lack of the square-root
11111110101111011111111111111101111110111100111111
computation.
0
Normalised
-10
1) Description: The goal of many optimisation algorithms is to -15 -16.24
minimise the SLL of the array factor of an antenna array (e.g. [1]– -20
[6]). The challenge with optimising the SLL is that the start of the
-25
sidelobe region must be determined. Two approaches to achieving
-30
this are considered below. 0 0.2 0.4 0.6 0.8 1
The first option is simply to define the edge of the main beam u
as being at some angle and then to compute the SLL as the highest (b)
value outside this region. This approach is extremely efficient from a
computational perspective as the start of the sidelobe region does 10011011111111111111111111111111111111111110101111
not need to be determined. However, this approach can lead to 0
array factor (dB)
undesirable results. -5
Normalised
-5
Arguably the most reliable way to determine the extent of the
Normalised
-10
main beam is to use the position of the first array-factor null. But
-15 -15.15
while potentially accurate, this approach means that the roots of a
polynomial need to be computed to determine the main-beam width. -20
Such computations are extremely time-consuming, with MATLAB -25
determining roots by computing the eigenvectors of the n × n -30
companion matrix of an nth -order polynomial [21], for example. 0 0.2 0.4 0.6 0.8 1
u
Computing the eigenvalues of a 199 × 199 matrix to determine the
start of the sidelobe region of a 200-element array will be extremely Fig. 6: Beam distortion which can occur when using the increase in
time-consuming. the array factor to determine the main-beam region.
A far more computationally efficient approach is simply to deter-
mine when the array-factor magnitude begins to increase. The only
drawback of this approach is that main-beam distortion can occur as case of thinned arrays where only a small proportion of the antenna
shown in Figure 6. The position of the first root from broadside is elements are active and the end elements are forced to be active.
indicated and can be seen to cause a distortion of the main beam. While it is possible to determine whether the array-factor magni-
This would not have occurred if the position of the root was used to tude increases for all points at which the array factor was computed,
determine the width of the main beam. However, situations like this this is inefficient. As long as the excitations are purely real, the array-
are rare, and to the best of the author’s knowledge, only occur in the factor magnitude is symmetrical around its centre point [22], so only
8
half of the points need to be considered. But more importantly, the TABLE VIII: A comparison of the different approaches to determin-
main beam constitutes only a small portion of the array factor, so ing the start of the sidelobe region.
only a small number of points outside the main beam need to be MATLAB Octave
considered. Even a rough estimate of the width of the main beam Arrays Case C1 C2 C3 C1 C2 C3
can thus significantly reduce the number of points which need to be (ms) (ms) (ms) (ms) (ms) (ms)
considered to find the start of the sidelobe region. Beam 174 113 71 408 358 239
50
The roots of an equally-excited array are equally spaced around the Half 187 129 79 419 370 248
unit circle with the exception of the positive real axis. The index of Beam 304 182 95 655 612 377
Rand. 100
Half 338 213 114 684 652 396
the first array-factor null (the edge of the main beam) in this case is
Beam 525 251 123 1 185 1 135 664
thus obtained by dividing the FFT length by the number of elements 200
Half 595 340 171 1 253 1 211 703
in the array. The first time the pattern increases now only needs to be
Beam 173 113 73 419 368 251
computed around the position of this null to find the sidelobe region 50
Half 185 128 81 415 367 246
in the majority of cases. There will inevitably be cases where the Beam 305 182 95 661 625 390
main beam is wider than this estimated value, but these special cases Wide 100
Half 333 213 112 676 637 392
are easily dealt with. Beam 522 255 125 1 186 1 142 674
200
The main issue in implementing the determination of the width of Half 588 335 171 1 236 1 198 697
the main beam is that the find () function in MATLAB and Octave Beam 172 115 77 416 364 253
50
does not allow independent operations to be performed on each Half 185 129 77 412 363 244
column of a matrix. Unfortunately, means that the operation cannot Beam 303 183 100 656 625 391
Flat 100
be vectorised, making it necessary to use a loop to compute the start Half 331 213 115 670 637 393
of the sidelobe region for a number of arrays. Beam 518 256 125 1 174 1 125 671
200
Half 584 336 171 1 224 1 182 697
2) Code: The code to determine whether the array factor magni-
tude is increasing is in Lines 13 to 16 of Figure 7, and the start of
the sidelobe region is determined by Lines 18 to 27.
Line 14 of Figure 7 estimates the edge of the main beam as Table VIII shows that limiting the range of angles which are
outlined above. Three times this estimated beamwidth is then used in checked to determine the start of the sidelobe region is faster is the
Line 16 as the range over which to determine whether the array-factor majority of the cases considered. The only exceptions are for some
magnitude increases. If the array-factor magnitude does not increase of the arrays with 50 elements when special cases comprise 10%
over the relevant range, Line 19 will not produce a result, and the of the arrays. However, these cases are likely to be extremely rare
condition in Line 21 will be true. The array-factor magnitude over and are expected to comprise significantly less than 10% of the arrays
slightly more than half the pattern is then checked (hence the addition considered. Furthermore, the penalty associated with these exceptions
of 2 in Line 12) to determine where the array-factor magnitude first is small.
increases. Slightly more than half the number of points are used The performance improvement associated with estimating the
because cases with a single null will only increase in the second half width of the main beam is surprisingly small considering the dramatic
of the pattern as the null at the edge of the main beam is at u = 1. reduction in the number of points which are checked for increases
If Line 22 also fails to produce a result, it means that only a single in the array factor magnitude (62 versus 2 050 points for 200
element is active and the pattern has no nulls. In this case, Lines 23 elements). This is a result of the fact that software like MATLAB
to 26 designate the first point as the start of the sidelobe region to and Octave executes built-in functions like diff () extremely quickly,
ensure that the correct of SLL of 0 dB is returned. This last case is while conditional branches and loops are far slower as outlined in
unlikely, so Lines 23 to 26 could safely be removed in the majority of Section IV-D.
cases (though this could lead to errors during the synthesis of thinned
arrays, for example). V. F INAL A LGORITHM
The alternative to using the main-beam region estimate is to replace The final function taking all the issues evaluated in Section IV into
min(ceil(3∗beam end), half end) by half end in Line 16 of Figure 7, consideration is shown in Fig. 7. A description of the function will
and to remove Lines 13 and 14, 20 to 22 and 27. This approach be followed by a brief analysis of its performance.
would simplify the code at the cost have having to perform the
computation in Line 16 on more points. While this change would
be expected to significantly slow the algorithm down, the nature of A. Code
vectorised computations and conditional branches in MATLAB and The inputs to the function thinned sll () are the array excitations
Octave means that this is not necessarily the case. and the number of points at which the array factors should be
3) Results: The results obtained when computing start of the computed. The input array excitations are in the columns of the
sidelobe region using the estimated first-null position and using half variable A, while the number of points at which the array factor
the points are shown in Table VIII as “Beam” and “Half” respectively. should be computed is in the variable n points . As outlined in
Three different cases with random excitations, random excitations Section III-B, 4 096 points gives only a small SLL error for 200-
with 10% of the arrays having wide beamwidths (the case considered element arrays, and this value can be scaled by the number of array
by Lines 21 and 22 of Fig. 7), and random excitations with 10% of elements (e.g. 1 024 and 2 048 points for 50- and 100-element arrays
the arrays having no pattern nulls (the case considered by Lines 24 to respectively).
26) denoted by “Rand.,” “Wide” and “Flat” in Table VIII respectively. No error checking has been included in the code in Fig. 7 both to
The two non-random cases are included to demonstrate the effect of keep the listing brief and to avoid slowing the code down. However,
the conditional branches in Lines 21 to 27. Finally, arrays of 50, 100 this does mean that care should be exercised in ensuring that the
and 200 elements are considered because shorter arrays have broader inputs are valid.
main beams, so the penalty associated with using half the available Line 6 of Fig. 7 computes the magnitude of the array factor,
angular points is reduced for smaller arrays. and Line 8 normalises the result to its maximum value. The use
9
1 f u n c t i o n [ SLL , AF abs ] = TABLE IX: The execution time for the final algorithm.
a r r a y s l l a f (A, n p o i n t s ) MATLAB Octave
2 % Compute t h e SLL and a r r a y f a c t o r o f l i n e a r CPUs C1 C2 C3 C1 C2 C3
3 % a r r a y s a t t h e s p e c i f i e d number o f p o i n t s . (ms) (ms) (ms) (ms) (ms) (ms)
4 2 525 489 248 1 185 1 099 620
5 % Compute t h e a r r a y f a c t o r m a g n i t u d e . 4 351 160 1 036 606
6 AF abs = abs ( i f f t (A, n p o i n t s ) ) ; 6 272 141 1 141 650
7 % Normalise the array f a c t o r magnitude . 8 251 147 1 135 660
8 AF abs = 12 123 664
b s x f u n ( @rdivide , AF abs , max ( AF abs ) ) ;
9 % A l l o c a t e a v a r i a b l e f o r SLL r e s u l t s .
1400
10 SLL = z e r o s ( 1 , s i z e (A, 2 ) ) ;
11 % The end o f t h e u n i q u e h a l f o f t h e p a t t e r n . 1200
factor is necessary to compute the SLL, and the use of an estimate [12] (2016, Feb.) GNU Octave. [Online]. Available: https://www.gnu.org/
of the width of the main beam along with error checking was shown software/octave/
[13] (2016, Feb.) Octave-Forge. [Online]. Available: http://octave.
to give good results.
sourceforge.net/
A number of aspects of coding in MATLAB and Octave were [14] S. J. Orfanidis, Electromagnetic Waves and Antennas. Piscataway, NJ:
considered and included in the final function including vectorisation, Rutgers University, 2 July 2014. [Online]. Available: www.ece.rutgers.
memory allocation, and the use of built-in functions. edu/∼orfanidi/ewa
[15] J. W. Cooley and J. W. Tukey, “An algorithm for the machine calculation
of complex Fourier series,” Mathematics of computation, vol. 19, no. 90,
R EFERENCES pp. 297–301, 1965.
[1] A. Trucco and V. Murino, “Stochastic optimization of linear sparse [16] M. Frigo and S. Johnson, “The design and implementation of FFTW3,”
arrays,” IEEE J. Oceanic Eng., vol. 24, no. 3, pp. 291–299, July 1999. Proc. IEEE, vol. 93, no. 2, pp. 216–231, Feb. 2005.
[2] R. L. Haupt, “Thinned arrays using genetic algorithms,” IEEE Trans. [17] T. T. Taylor, “Design of line-source antennas for narrow beamwidth and
Antennas Propag., vol. 42, no. 7, pp. 993–999, July 1994. low side lobes,” IRE Transactions on Antennas and Propagation, vol. 3,
[3] O. Quevedo-Teruel and E. Rajo-Iglesias, “Ant colony optimization in no. 1, pp. 16–28, Jan. 1955.
thinned array synthesis with minimum sidelobe level,” IEEE Antennas [18] (2016, Feb.) Fast Fourier transform – MATLAB fft. [Online]. Available:
Wirel. Propag. Lett., vol. 5, pp. 349–352, Dec. 2006. http://www.mathworks.com/help/matlab/ref/fft.html
[4] N. Jin and Y. Rahmat-Samii, “Advances in particle swarm optimization [19] (2016, Feb.) GNU Octave: Signal processing. [Online]. Available: https:
for antenna designs: real-number, binary, single-objective and multiob- //www.gnu.org/software/octave/doc/interpreter/Signal-Processing.html
jective implementations,” IEEE Trans. Antennas Propag., vol. 55, no. 3, [20] (2016, Feb.) FFTW home page. [Online]. Available: http://www.fftw.org/
pp. 556–567, March 2007. [21] (2016, March) Polynomial roots – MATLAB roots. [Online]. Available:
[5] M. Gregory, Z. Bayraktar, and D. Werner, “Fast optimization of elec- http://www.mathworks.com/help/matlab/ref/roots.html
tromagnetic design problems using the covariance matrix adaptation [22] J. Tsui, Digital Techniques for Wideband Receivers, 2nd ed. SciTech
evolutionary strategy,” IEEE Trans. Antennas Propag., vol. 59, no. 4, Publishing, 2004, Available electronically from the UP library via the
pp. 1275–1285, April 2011. Knovel database.
[6] W. P. du Plessis, “SLL, active elements and available elements of
uniformly-excited linear thinned arrays,” in Int. Conf. Electromagn. Adv.
Appl. (ICEAA), Sept. 2012, pp. 558–561.
[7] Y. T. Lo, “Aperiodic arrays,” in Antenna Handbook, Y. T. Lo and S. W. Warren du Plessis (wduplessis@ieee.org) received
Lee, Eds. Van Nostrand Reinhold, 1993, vol. II – Antenna Theory, the B.Eng. (Electronic) and M.Eng. (Electronic) and
ch. 14. Ph.D. (Engineering) degrees from the University
[8] M. I. Skolnik, J. W. Sherman, III, and F. C. Ogg, Jr, “Statistically of Pretoria in 1998, 2003 and 2010 respectively,
designed density-tapered arrays,” IEEE Trans. Antennas Propag., vol. 12, winning numerous academic awards including the
no. 4, pp. 408–417, July 1964. prestigious Vice-Chancellor and Principal’s Medal.
[9] W. P. du Plessis, “Efficient synthesis of large-scale thinned arrays using He spent two years as a lecturer at the University
a density-taper initialized genetic algorithm,” in Int. Conf. Electromagn. of Pretoria, and then joined Grintek Antennas as a
Adv. Appl. (ICEAA), Sept. 2011, pp. 363–366. design engineer for almost four years, followed by
[10] W. P. du Plessis and A. bin Ghannam, “Improved seeding schemes six years at the Council for Scientific and Industrial
for interleaved thinned array synthesis,” IEEE Trans. Antennas Propag., Research (CSIR). He is currently an Associate Pro-
vol. 62, no. 11, pp. 5906–5910, Nov. 2014. fessor at the University of Pretoria, and his primary research interests are
[11] (2016, Feb.) MATLAB – the language of technical computing. [Online]. cross-eye jamming and thinned antenna arrays. He is a Senior Member of the
Available: http://www.mathworks.com/products/matlab/ IEEE.