PhasedArrays
Documentation for PhasedArrays.
PhasedArrays.CircularArrayPhasedArrays.CircularArrayPhasedArrays.ElementPatternPhasedArrays.FarfieldSourcePhasedArrays.IsotropicPatternPhasedArrays.PlaneWavePhasedArrays.RingArrayPhasedArrays.RingArrayPhasedArrays.TabulatedPatternPhasedArrays.ULAPhasedArrays.ULAPhasedArrays.URAPhasedArrays.URAPhasedArrays.HansenWoodyardArrayPhasedArrays.Radial_bartlett_hann_windowPhasedArrays.apply_radial_taper!PhasedArrays.apply_taper_2D!PhasedArrays.calculate_array_manifoldPhasedArrays.calculate_patternPhasedArrays.calculate_responsePhasedArrays.connect_sparamsPhasedArrays.element_gainPhasedArrays.element_gainPhasedArrays.flattopPhasedArrays.gaussian_patternPhasedArrays.least_squares_synthesisPhasedArrays.linear_bartlett_hann_windowPhasedArrays.linear_blackman_harris_windowPhasedArrays.linear_blackman_windowPhasedArrays.linear_dolph_cheb_windowPhasedArrays.linear_gaussian_windowPhasedArrays.linear_hamming_windowPhasedArrays.linear_hann_windowPhasedArrays.linear_kaiser_windowPhasedArrays.linear_taylor_windowPhasedArrays.linear_tukey_windowPhasedArrays.radial_blackman_harris_windowPhasedArrays.radial_blackman_windowPhasedArrays.radial_hamming_windowPhasedArrays.radial_hann_windowPhasedArrays.radial_kaiser_windowPhasedArrays.radial_tukey_windowPhasedArrays.raised_cosinePhasedArrays.sinc_patternPhasedArrays.truncate_phasePhasedArrays.truncate_phase!PhasedArrays.woodward_sampling
PhasedArrays.CircularArray — Type
CircularArrayCircular aperture array with support for various lattice types.
Fields
plane::String: The Cartesian plane in which the circular aperture lies ("xy","xz", or"yz").R::Float64: Radius of the circular aperture in meters.N_elements::Int64: Number of antenna elements in the array.lattice::LatticeType: Lattice geometry used for placing elements (e.g.,Rectangular).coordinates::Matrix{Float64}: A 3×N matrix of element coordinates in 3D space.weights::Vector{ComplexF64}: Excitation weights applied to each element.element_pattern::ElementPattern: Radiation pattern model of each element.
Description
The CircularArray type represents a 2D array of antenna elements placed within a circular aperture of radius R, lying in the specified Cartesian plane. The layout of elements is controlled by the chosen lattice geometry (currently, only Rectangular is supported). This array type supports arbitrary excitation weights and element radiation patterns.
PhasedArrays.CircularArray — Method
CircularArray(plane::String, R::Float64, lattice::LatticeType, args...; kwargs...)Construct a circular array of elements within a radius R in the specified Cartesian plane using the specified lattice type.
Arguments
plane: Plane in which the array lies ("xy","xz", or"yz").R: Radius of the circular aperture (in meters).lattice: Lattice type used for element placement (currently onlyRectangularis supported).args...,kwargs...: Passed to the specific lattice constructor (e.g., inter-element spacing, weights, element pattern).
Returns
A CircularArray with coordinates generated based on the chosen lattice type.
Example
f = 3e9
λ = 3e8 / f
array = CircularArray("xy", 5λ, Rectangular, 0.5λ, 0.5λ)PhasedArrays.ElementPattern — Type
abstract type ElementPattern endAbstract supertype for representing the far-field radiation pattern of an antenna element. Concrete subtypes should define how to evaluate the electric field components for given directions.
PhasedArrays.FarfieldSource — Type
FarfieldSource is a struct for patterns imported fron CST StudioPhasedArrays.IsotropicPattern — Type
IsotropicPattern(polarization::Char)Represents an ideal isotropic radiator with a specified polarization.
Arguments
polarization:'θ'or'ϕ'indicating the direction of the non-zero electric field component.
PhasedArrays.PlaneWave — Type
PlaneWave(θ, ϕ, frequency; Eθ=1.0 + 0im, Eϕ=0.0 + 0im) -> PlaneWaveConstruct a PlaneWave object representing an incident electromagnetic wave.
The wave is defined by its direction (θ, ϕ) in spherical coordinates (in degrees), its frequency (in Hz), and its electric field polarization components in the local θ and ϕ directions.
Arguments
θ::Real: Elevation angle in degrees (0 = +z, 90 = xy-plane).ϕ::Real: Azimuth angle in degrees (0 = +x, 90 = +y).frequency::Real: Frequency of the plane wave in Hz.Eθ::ComplexF64(optional): Complex amplitude of the electric field in θ-direction. Default =1.0 + 0im.Eϕ::ComplexF64(optional): Complex amplitude of the electric field in ϕ-direction. Default =0.0 + 0im.
Returns
PlaneWaveobject with fields:θ,ϕ: Direction of arrival (degrees)frequency: Frequency (Hz)a::Vector{Float64}: Unit direction vector[ax, ay, az](arrival direction)k::Vector{Float64}: Wave vector (rad/m)Eθ,Eϕ: Complex electric field components
Example
pw = PlaneWave(30, 45, 2.4e9)PhasedArrays.RingArray — Type
RingArray(plane::String, radius, N_elements; weights=nothing, pattern=IsotropicPattern('θ'))Construct a circular antenna array with N_elements elements equally spaced on a ring of radius radius in the specified plane.
Arguments
plane: The Cartesian plane in which the ring lies ("xy","xz", or"yz").radius: Radius of the ring in meters.N_elements: Number of antenna elements placed uniformly on the ring.weights(optional): Excitation weights for each element; defaults to uniform weights (1/N).pattern(optional): Element radiation pattern; defaults to an isotropic θ-directed pattern.
Returns
A RingArray instance with 3D element coordinates arranged around the origin.
Example
using PhasedArrays
f = 5e9
λ = 3e8/f
ra = RingArray("xy", λ, 8)PhasedArrays.RingArray — Type
RingArrayCircular (ring) array of antenna elements in a specified Cartesian plane.
Fields
plane::String: The plane in which the ring lies. Must be"xy","xz", or"yz".radius::Float64: Radius of the ring in meters.N_elements::Int64: Number of equally spaced elements along the ring.coordinates::Matrix{Float64}: A 3×N matrix of element coordinates in 3D space.weights: Complex excitation weights for each element (e.g., a vector ofComplexF64values).element_pattern::ElementPattern: Radiation pattern model for the array elements (e.g., isotropic or directional).
Description
The RingArray type defines a circular array with N_elements evenly spaced antennas placed on a ring of radius radius in the specified plane. It supports arbitrary excitation weights and customizable element radiation patterns.
PhasedArrays.TabulatedPattern — Type
TabulatedPattern(theta, phi, Eθ, Eϕ)Stores a tabulated element radiation pattern over a grid of (θ, ϕ) angles.
Arguments
theta: Vector of θ (theta) angles in degrees.phi: Vector of ϕ (phi) angles in degrees.Eθ: Matrix of complex electric field components in θ direction.Eϕ: Matrix of complex electric field components in ϕ direction.
Notes
Assumes that Eθ[i,j] and Eϕ[i,j] correspond to theta[i] and phi[j].
PhasedArrays.ULA — Type
ULA(axis::Char, N::Int, dist::Float64; weights=nothing, pattern=IsotropicPattern('θ'))Construct a Uniform Linear Array along the given axis ('x', 'y', or 'z') with N elements spaced dist meters apart.
Weights and element pattern are optional; defaults are uniform weighting and an isotropic θ-directed pattern.
PhasedArrays.ULA — Type
ULAUniform Linear Array (ULA) of antenna elements.
Fields
axis::Char: The axis along which the array is aligned ('x','y', or'z').N_elements::Int64: Number of antenna elements in the array.dist::Float64: Inter-element spacing in meters.coordinates::Matrix{Float64}: A 3×N matrix of element coordinates in 3D space.weights: Complex excitation weights for each element (e.g., a vector ofComplexF64values).element_pattern::ElementPattern: Radiation pattern model for the array elements (e.g., isotropic or custom pattern).
Description
The ULA type defines a uniform linear antenna array with equally spaced elements aligned along a specified Cartesian axis. The array supports arbitrary excitation weights and element radiation patterns.
Example use:
using PhasedArrays
using GLMakie
f = 3e9
λ = 3e8/f
d = 0.5*λ
N = 5
ula = ULA('x',N,d)
patt = calculate_pattern(ula,f)
fig = plot_pattern_cuts(patt,DirectivitydB)PhasedArrays.URA — Type
URA(plane::String, N1, N2, d1, d2; weights=nothing, pattern=IsotropicPattern('θ'))Construct a Uniform Rectangular Array (URA) with N1 × N2 elements spaced by d1 and d2 meters along the specified plane.
Arguments
plane: The plane in which the array is placed. Must be"xy","xz", or"yz".N1: Number of elements along the first axis of the chosen plane.N2: Number of elements along the second axis of the chosen plane.d1: Spacing along the first axis (in meters).d2: Spacing along the second axis (in meters).weights(optional): Excitation weights; defaults to uniform weights (1/N).pattern(optional): Element radiation pattern; defaults to isotropic pattern in the θ-direction.
Returns
A URA instance with 3D element coordinates centered around the origin.
Example
using PhasedArrays
f = 10e9
λ = 3e8/f
ura = URA("xy", 4, 4, 0.5λ, 0.5λ)PhasedArrays.URA — Type
URAUniform Rectangular Array (URA) of antenna elements.
Fields
plane::String: The Cartesian plane in which the array lies. Must be"xy","xz", or"yz".N1::Int64: Number of elements along the first axis of the plane.N2::Int64: Number of elements along the second axis of the plane.d1::Float64: Element spacing along the first axis (in meters).d2::Float64: Element spacing along the second axis (in meters).weights: Complex excitation weights for each element (e.g., a vector ofComplexF64values).element_pattern::ElementPattern: Radiation pattern of the element.
Description
The URA type represents a uniform rectangular antenna array, constructed in one of the three primary Cartesian planes. It supports arbitrary element weights and customizable radiation patterns.
Example use:
using PhasedArrays
f = 3e9
λ = 3e8/f
dx = 0.5*λ
dy = 0.25*λ
N = 5
ura = URA("xy",N,N,dx,dy)PhasedArrays.HansenWoodyardArray — Method
HansenWoodyardArray(axis::Char, N::Int, freq::Float64) -> ULAConstructs a Hansen-Woodyard endfire linear array along the specified axis.
Arguments
axis: Array orientation; must be one of'x','y', or'z'.N: Number of antenna elements.freq: Operating frequency in Hz.
Returns
A ULA object with Hansen-Woodyard spacing and weights that steer the beam toward the endfire direction.
Notes
- Spacing is set to
λ/2 * (1 - 1/N)for enhanced endfire directivity. - The beam is steered to:
- θ=90°, ϕ=0° for
'x'-axis - θ=90°, ϕ=90° for
'y'-axis - θ=0° for
'z'-axis
- θ=90°, ϕ=0° for
Example
array = HansenWoodyardArray('y', 10, 3e9)PhasedArrays.Radial_bartlett_hann_window — Method
Radial_bartlett_hann_window(r::Float64)Returns Bartlett-Hann window evaluated at normalized radius r.
Hybrid taper with smoother roll-off and moderate sidelobe control.
PhasedArrays.apply_radial_taper! — Method
apply_radial_taper!(array::URA, taper_fun::Function, n::Int)Applies a radial taper to the weights of a URA array in-place.
Arguments
array: AURA(Uniform Rectangular Array) whose weights will be modified.taper_fun: A function mapping normalized radius ∈ [0, 1] to a taper value.n: Number of outer radial rings (based on unique distance levels) to suppress fully (i.e., taper to zero).
Behavior
- Computes distance of each element from array center.
- Applies taper based on normalized radius
r/r_max, wherer_maxis the distance to then-th inner ring. - Weights are multiplied by the taper and normalized.
Example
apply_radial_taper!(ura, radial_hann_window, 1)PhasedArrays.apply_taper_2D! — Method
apply_taper_2D!(array::URA, taper::Function, axis::Symbol)Applies a 2D tapering function (with separable kernels) to the weights of a uniform rectangular array (URA).
Arguments
array: AURAinstance whose weights will be modified in-place.taper: A function that takes an integerNand returns a vector of lengthNrepresenting the taper weights along one dimension.axis: Specifies which dimensions to apply the taper on.:dim1applies taper along the first axis.:dim2applies taper along the second axis.:bothapplies same taper on both axes.
Behavior
The function constructs a 2D taper weight matrix by taking the outer product of the taper vectors along each dimension. It multiplies the existing weights element-wise by this taper matrix and then normalizes the resulting weights so that the sum of their absolute values is 1.
Notes
- The
weightsfield ofarrayis updated in-place. - The function assumes the weights vector can be reshaped into
(N1, N2), whereN1andN2are the array dimensions.
Example
tukey = N -> linear_tukey_window(N, 0.5) # Example taper function
apply_taper_2D!(ura, tukey, :both)PhasedArrays.calculate_array_manifold — Method
calculate_array_manifold(Array, plane_wave::PlaneWave)Compute the array manifold vector for a given plane wave.
Returns
A complex vector of phase shifts for all array elements.
PhasedArrays.calculate_pattern — Method
calculate_pattern(arr, freq) -> PatternCompute the far-field radiation pattern of an antenna array at a given frequency.
This function evaluates the complex far-field response over a spherical grid of angles (θ, ϕ) assuming plane-wave excitation and using the array weights and element pattern. The result includes the θ- and ϕ-polarized components as well as the combined total field magnitude.
Arguments
arr: A struct representing the array.freq::Real: Frequency in Hz at which to compute the pattern.
Returns
Patternobject containing:theta: θ angles in degrees (0:0.5:180).phi: ϕ angles in degrees (0:1:360).Υθ: θ-polarized complex far-field.Υϕ: ϕ-polarized complex far-field.Υ: Total field magnitude √(|Υθ|² + |Υϕ|²)
PhasedArrays.calculate_response — Method
calculate_response(Array, plane_wave::PlaneWave)Compute complex array response (scalar) to an incoming PlaneWave.
Combines:
- Array weights
- Element pattern
- Plane wave polarization and direction
Returns
Response of the array with given element pattern and weights.
PhasedArrays.connect_sparams — Method
connect_sparams(S1, S2, connections)Connect two N-port networks S1 and S2.
connections= vector of tuples(i,j)whereiis internal port of S1,jinternal port of S2.- Returns the reduced S-matrix of the composite network seen at external ports.
PhasedArrays.element_gain — Method
element_gain(p::IsotropicPattern, θ, ϕ)Returns the electric field components (Eθ, Eϕ) of an isotropic element at a given direction (θ, ϕ).
Arguments
p: AnIsotropicPatternobject.θ: Theta angle in degrees.ϕ: Phi angle in degrees.
Returns
Tuple (Eθ, Eϕ) of complex values representing the element response.
Notes
Returns unit magnitude for the specified polarization, and zero for the orthogonal component.
PhasedArrays.element_gain — Method
element_gain(p::TabulatedPattern, θ, ϕ)Looks up and returns the electric field components (Eθ, Eϕ) from the tabulated pattern.
Arguments
p: ATabulatedPatternobject.θ: Theta angle in degrees (must match exactly one of the entries inp.theta).ϕ: Phi angle in degrees (must match exactly one of the entries inp.phi).
Returns
Tuple (Eθ, Eϕ) of complex values at the specified direction.
Warning
This function requires an exact match for θ and ϕ for now, interpolation is not yet implemented.
PhasedArrays.flattop — Method
flattop(HalfWidth)Returns a function u -> 1 or 0, representing a flat-top beam pattern of given half-width (in degrees).
Arguments
HalfWidth: Angular half-width of the flat region in degrees.
Returns
Function defined on directional cosine u = cos(θ), with 1 inside the main lobe and 0 outside.
PhasedArrays.gaussian_pattern — Method
gaussian_pattern(σ)Returns a Gaussian-shaped pattern in the directional cosine domain.
Arguments
σ: Standard deviation controlling the width of the main lobe.
Returns
A function u -> exp(-u^2 / (2σ^2)) for smooth, bell-shaped beam shaping.
PhasedArrays.least_squares_synthesis — Method
least_squares_synthesis(N, d, λ, Bd; θrange=0.0:0.1:180.0) -> Vector{ComplexF64}Computes array weights using least-squares pattern synthesis.
Arguments
N: Number of elements.d: Element spacing.λ: Wavelength.Bd: Desired pattern as a function ofu = cos(θ).θrange: Angle range in degrees over which the pattern is matched (default:0.0:0.1:180.0).
Returns
Weight vector that minimizes the squared error between the desired and actual beam pattern.
PhasedArrays.linear_bartlett_hann_window — Method
linear_bartlett_hann_window(N)Returns a normalized Bartlett-Hann window of length N. Normalized to peak 1.
PhasedArrays.linear_blackman_harris_window — Method
linear_blackman_harris_window(N)Returns a normalized Blackman-Harris window of length N.
High sidelobe suppression, typically better than standard Blackman. Normalized to 1.
PhasedArrays.linear_blackman_window — Method
linear_blackman_window(N)Returns a normalized Blackman window of length N.
Provides good sidelobe suppression at the cost of wider mainlobe. Normalized to peak 1.
PhasedArrays.linear_dolph_cheb_window — Method
linear_dolph_cheb_window(N, R, d, λ)Computes Dolph-Chebyshev window of length N for a ULA with element spacing d and wavelength λ.
Arguments
R: Desired sidelobe level in dB (e.g. -20).d: Element spacing in meters.λ: Wavelength in meters.
Returns a real-valued weight vector normalized to unit gain in the endfire direction.
PhasedArrays.linear_gaussian_window — Method
linear_gaussian_window(N, σ)Returns a normalized Gaussian window of length N with spread parameter σ.
smaller σ results in wider mainlobe and lower sidelobes. Normalized to peak 1.
PhasedArrays.linear_hamming_window — Method
linear_hamming_window(N)Returns a normalized Hamming window of length N.
Used to taper array weights to reduce sidelobe levels. The window is normalized to have maximum value 1.
PhasedArrays.linear_hann_window — Method
linear_hann_window(N)Returns a normalized Hann window of length N.
A cosine-based taper that reduces sidelobes. Maximum value is normalized to 1.
PhasedArrays.linear_kaiser_window — Method
linear_kaiser_window(N, β)Returns a normalized Kaiser window of length N with shape parameter β.
Useful for controlling sidelobe levels via β. Normalized to peak 1.
PhasedArrays.linear_taylor_window — Method
linear_taylor_window(N, R, n̄, d, λ)Generates a Taylor window with N elements, sidelobe level R (dB), and n̄ equal-level sidelobes.
Arguments
R: Desired sidelobe level in dB (for example -20).n̄: Number of equal sidelobes + 1. Must be between 1 and N–1.d: Element spacing in meters.λ: Wavelength in meters.
Returns a real-valued taper optimized for sidelobe control in antenna arrays.
PhasedArrays.linear_tukey_window — Method
linear_tukey_window(N, α)Returns a normalized Tukey (tapered cosine) window of length N with tapering parameter α ∈ [0, 1].
α = 0→ rectangular windowα = 1→ Hann window
Normalized to maximum value 1.
PhasedArrays.radial_blackman_harris_window — Method
radial_blackman_harris_window(r::Float64)Returns Blackman-Harris window at normalized radius r.
PhasedArrays.radial_blackman_window — Method
radial_blackman_window(r::Float64)Blackman window evaluated at normalized radius r.
Provides stronger sidelobe suppression than Hann or Hamming.
PhasedArrays.radial_hamming_window — Method
radial_hamming_window(r::Float64)Returns the value of a Hamming window at normalized radius r.
Commonly used for moderate sidelobe suppression in array tapering.
PhasedArrays.radial_hann_window — Method
radial_hann_window(r::Float64)Returns the value of a Hann window evaluated at normalized radius r ∈ [0, 1].
Used in radial tapers for circular or rectangular arrays.
PhasedArrays.radial_kaiser_window — Method
radial_kaiser_window(r::Float64, β::Float64)Returns Kaiser window value at normalized radius r, with shape parameter β.
PhasedArrays.radial_tukey_window — Method
radial_tukey_window(r::Float64, α::Float64)Returns Tukey (tapered cosine) window value at normalized radius r, with tapering parameter α ∈ [0, 1].
α = 0gives rectangular windowα = 1gives Hann window
PhasedArrays.raised_cosine — Method
raised_cosine(HalfWidth, rolloff)Returns a function representing a raised-cosine-shaped beam pattern in the directional cosine domain.
Arguments
HalfWidth: Half-width of the main lobe (in degrees).rolloff: Transition width (in directional cosine units).
Returns
A smooth beam pattern tapering from 1 to 0 around the edge of the flat region.
PhasedArrays.sinc_pattern — Method
sinc_pattern(scale)Returns a sinc-based beam shaping function.
Arguments
scale: Controls the lobe spacing and width in the directional cosine domain.
Returns
A function u -> sinc(scale * u), centered at broadside.
PhasedArrays.truncate_phase! — Method
truncate_phase!(arr, bits::Int)In-place phase quantization of array weights.
The phase of each complex weight is quantized to the nearest level among 2^bits uniformly spaced values on the unit circle. The magnitude of each weight is preserved.
Arguments
arr: antenna array struct.bits: Number of phase bits for quantization. Ifbits == 0, no modification is performed.
Example
truncate_phase!(ula, 3) # Quantize to 8 phase levelsPhasedArrays.truncate_phase — Method
truncate_phase(w::Vector{ComplexF64}, bits::Int) -> Vector{ComplexF64}Returns a new vector of complex weights with quantized phase.
The phase of each complex number in w is quantized to the nearest level among 2^bits values evenly spaced on the unit circle. The magnitude of each weight is preserved.
Arguments
w: Vector of complex weights to be quantized.bits: Number of bits used for phase quantization. Ifbits == 0, returns the original vector.
Returns
- New
Vector{ComplexF64}with quantized phases.
Example
wq = truncate_phase(w, 2) # Quantize phase to 4 levelsPhasedArrays.woodward_sampling — Method
woodward_sampling(N, d, λ, goalPattern) -> Vector{ComplexF64}Computes array weights using Woodward (spatial) sampling method.
Arguments
N: Number of elements.d: Element spacing (in meters).λ: Wavelength (in meters).goalPattern: A functionu -> desired pattern, whereu = cos(θ)is the directional cosine.
Returns
Complex weight vector that approximates the desired pattern over sampled points.