-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path7_7_sub_array_sum_diff.py
More file actions
executable file
·57 lines (45 loc) · 1.78 KB
/
Copy path7_7_sub_array_sum_diff.py
File metadata and controls
executable file
·57 lines (45 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python
"""Sub-array sum and difference beam patterns for monopulse.
Split a 20-element ULA into left and right halves (sub-arrays), compute each
sub-array's gain pattern, then form the sum (Sigma) and difference (Delta)
beams.
The sum beam has maximum gain at boresight — used for detection and tracking.
The difference beam has a null at boresight — used for angle estimation.
The monopulse ratio (Delta/Sigma) gives a steep, monotonic curve near
boresight that maps directly to target angle.
"""
import numpy as np
import matplotlib.pyplot as plt
import rad_lab.uniform_linear_arrays as ula
import rad_lab.constants as c
plt.rcParams["text.usetex"] = True
# -- Array parameters --
fc = 10e9 # carrier frequency [Hz]
wavelength = c.C / fc
Nel = 20 # total number of elements
dx = wavelength / 2 # element spacing [m] (half-wavelength)
# -- Create element positions centered about the origin --
L = (Nel - 1) * dx # total array length [m]
el_pos = np.linspace(-L / 2, L / 2, Nel)
# -- Split into left and right sub-arrays --
assert Nel % 2 == 0
sub_arrays = [el_pos[: int(Nel / 2)], el_pos[int(Nel / 2) :]]
# -- Compute each sub-array's complex gain pattern --
sub_array_gain = []
for sub_array in sub_arrays:
thetas, gain = ula.linear_antenna_gain_meters(sub_array, fc)
sub_array_gain.append(gain)
# -- Form sum and difference beams --
sum_gain = sub_array_gain[0] + sub_array_gain[1] # Sigma: max at boresight
diff_gain = sub_array_gain[0] - sub_array_gain[1] # Delta: null at boresight
# -- Plot --
plt.title("Sum and Difference Gain Profiles")
plt.plot(thetas, abs(sum_gain), label=r"$\Sigma$")
plt.plot(thetas, abs(diff_gain), label=r"$\Delta$")
plt.xlabel(r"Angle $\theta$ [deg]")
plt.ylabel("Gain")
plt.xlim((-20, 20))
plt.grid()
plt.legend()
plt.tight_layout()
plt.show()