C10 · Lesson 46 · Antenna and link lab
Array patterns, beamwidths, directivity and link budgets in Python
Lessons 40 to 44 gave antennas and links by formula. Real patterns are often known only as a function to be evaluated, and real links have a dozen terms. In this lab you'll compute an array's pattern element by element, find its beamwidth by searching the pattern, integrate any pattern over the sphere to get its directivity, and turn a link budget into a margin and a maximum range.
- The curve is a uniform linear array's pattern in dB against the angle from broadside, for N elements d wavelengths apart, steered to .
- Add elements: the main beam narrows as about 1/N, and the first side lobes stay near −13 dB.
- Widen the spacing past half a wavelength and steer off broadside: grating lobes, full-size copies of the main beam, rise at other angles.
Predict
Numerically, what is the directivity of a half-wave dipole, whose pattern is ?
1.64, or 2.15 dBi. The short dipole's gives 1.5; the half-wave dipole's pattern is a little narrower, so a little more directive. Numerical integration over θ gives these to as many digits as you like, which is how directivities of real antennas are computed from measured patterns.
Name it
Array factor
N equal elements d wavelengths apart, each fed with a phase step α from the last, give
with θ from broadside. Steering to uses . The sum is computed directly in code, which also handles unequal weights.
Beamwidth by search
The half-power beamwidth is twice the angle where falls to ½. Bisection between 0 and 90° finds it to any accuracy. For a broadside array it's about .
Directivity by integration
For a pattern U(θ) that doesn't depend on azimuth,
A midpoint rule with a few thousand points is accurate to many digits for smooth patterns.
Margin and range
The margin is received power less the noise floor less the required SNR. In free space it falls 20 dB per decade of distance, so the range at zero margin is the distance at which the margin was computed times .
Worked example
What is the half-power beamwidth of an 8-element broadside array at half-wavelength spacing?
Show the solution
- Search the array factor. Solving gives a half-angle of 6.40°.
- Beamwidth.
- Rule of thumb. within 1%.
- More elements. Doubling to 16 elements gives 6.36°.
Answer the half-power beamwidth is 12.8°.
Worked example
A 2.4 GHz link sends 20 dBm through 2 dBi antennas, with a 20 MHz receiver of 6 dB noise figure that needs 25 dB of SNR. What is its margin at 50 m, and its free-space range?
Show the solution
- Received power.
- Noise.
- SNR and margin. The SNR is 45.0 dB, so the margin over 25 dB is
- Free-space range. more precisely 498 m.
- Indoors. Walls take that margin quickly.
Answer a 20.0 dB margin at 50 m, and a free-space range of about 500 m (498 m more precisely).
Check
About what is the broadside beamwidth of 8 elements 0.5λ apart, by the rule of thumb?
Check
Write array_factor(N, d, alpha, theta): the normalized array factor for N elements d wavelengths apart with phase step alpha degrees, at theta degrees from broadside, by summing the elements directly.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write beamwidth(N, d): the half-power beamwidth, in degrees, of a uniform broadside array, found by bisection on . Write array_factor again inside your answer, or reuse it.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write directivity(U): the directivity of an azimuthally symmetric pattern U(theta) (θ in radians from the axis), by the midpoint rule with 20,000 points.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write link_margin(pt, gt, gr, f, d, B, nf, snr) in dB (pt in dBm, gains in dBi, f in Hz, d in m, B in Hz, nf and snr in dB) for free space, and max_range(pt, gt, gr, f, B, nf, snr), the distance in meters where the margin reaches 0.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
Why do grating lobes appear when array elements are spaced more than half a wavelength apart?
An array's pattern repeats whenever the phase difference between neighboring elements' contributions, , changes by a full : the elements then add in phase again, exactly as at the main beam. As θ sweeps from −90° to 90°, covers a range of 2, so ψ sweeps a range of . With d below half a wavelength (and no steering) that's less than , so only one in-phase direction exists. With wider spacing, or when steering shifts the range, ψ reaches another multiple of at some real angle, and a second full-size beam, a grating lobe, appears there.
Practice
Keep practicing
One kind of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.