You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
* start of 2d cal example, and some tweaks to existing 2d content* messing around still not working* x-y plane* cleanups* fix plotting* asdasd* fixed lms* example using mean of angle of x * x conj* beam pattern sampling* van trees* spelling* encoding---------Co-authored-by: Marc Lichtman <marc@projecteagle.net>
Copy file name to clipboardExpand all lines: content/doa.rst
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1163,7 +1163,7 @@ In the example Python code below, we simulate an 8-element array with a SOI that
1163
1163
# Scenario
1164
1164
sample_rate=1e6
1165
1165
d=0.5# half wavelength spacing
1166
-
N=10000# number of samples to simulate
1166
+
N=100000# number of samples to simulate
1167
1167
Nr=8# elements
1168
1168
theta_soi=20/180* np.pi# convert to radians
1169
1169
theta2=60/180* np.pi
@@ -1191,8 +1191,7 @@ In the example Python code below, we simulate an 8-element array with a SOI that
1191
1191
r= r+0.5*n# 8xN
1192
1192
1193
1193
# LMS, not knowing the direction of SOI but knowing the SOI signal itself
1194
-
mu=1e-4# LMS step size
1195
-
gamma=0.995# knowledge decay rate
1194
+
mu=0.5e-5# LMS step size
1196
1195
w_lms= np.zeros((Nr,1),dtype=np.complex128)# start with all zeros
1197
1196
1198
1197
# Loop through received samples
@@ -1204,8 +1203,9 @@ In the example Python code below, we simulate an 8-element array with a SOI that
1204
1203
y= y.squeeze()# make it a scalar
1205
1204
error= soi_sample- y
1206
1205
error_log.append(np.abs(error)**2)
1207
-
w_lms= w_lms* gamma+ mu* np.conj(error)* r_sample# weights are still 8x1
1208
-
w_lms/= np.linalg.norm(w_lms)# normalize weights
1206
+
w_lms+= mu* np.conj(error)* r_sample# weights are still 8x1
1207
+
1208
+
w_lms/= np.linalg.norm(w_lms)# normalize weights
1209
1209
1210
1210
plt.plot(error_log)
1211
1211
plt.xlabel('Iteration')
@@ -1631,7 +1631,7 @@ This outputs 0 dB, which is what we expect because MVDR's goal is to achieve uni
1631
1631
* - A random direction
1632
1632
- -14.285 dB
1633
1633
1634
-
Your results may vary due to the random noise being used to calculate the received samples, which get used to calculate:code:`R`. But the main take-away is that the jammers will be in a null and very low power, the 1 degree off from:code:`dir` will be slightly below 0 dB, but still in the main lobe, and then a random direction is going to be lower than 0 dB but higher than the jammers, and very different every run of the simulation.
1634
+
Your results may vary due to the random noise being used to calculate the received samples, which get used to calculate:code:`R`. But the main take-away is that the jammers will be in a null and very low power, the 1 degree off from:code:`dir` will be slightly below 0 dB, but still in the main lobe, and then a random direction is going to be lower than 0 dB but higher than the jammers, and very different every run of the simulation. Note that with MVDR you get a gain of 0 dB for the main lobe, but if you were to use the conventional beamformer, you would get:math:`10\log_{10}(Nr)`, so about 12 dB for our 16-element array, showing one of the trade-offs of using MVDR.
1635
1635
1636
1636
*************************
1637
1637
Conclusion and References
@@ -1644,6 +1644,8 @@ All Python code, including code used to generate the figures/animations, can be
1644
1644
1645
1645
[1] Mailloux, Robert J. Phased Array Antenna Handbook. Second edition, Artech House, 2005
1646
1646
1647
+
[2] Van Trees, Harry L. Optimum Array Processing: Part IV of Detection, Estimation, and Modulation Theory. Wiley, 2002.
# At this point it's worth pointing out that we didn't actually change dimensionality of anything, going from 1D to 2D, we just have a non-zero y component, the steering vector equation is still the same and the weights are still a 1D array
120
120
# Some folks might assemble their weights as a 2D array so that visually it matches the array geometry, but it's not necessary and best to keep it 1D