Skip to content

Commit 37be401

Browse files
authored
remove extra conversion to dB and adjust results to retain top 95% values (#150)
Results is already converted to dB inside the for loop, so we don't need to convert it again outside. Also, applied floor to results to keep top 95% and prevent extreme values rather than arbitrary min.
1 parent 4350223 commit 37be401

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

figure-generating-scripts/doa_2d.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ def get_unit_vector(theta, phi): # angles are in radians
212212
resp = w.conj().T @ a # scalar
213213
results[i, j] = 10*np.log10(np.abs(resp)[0,0]) # power in signal, in dB
214214
# plot_surface needs x,y,z form
215-
results = 10*np.log10(results) # convert to dB
215+
floor = np.percentile(results, 5) # bottom 5% → keeps top 95%
216+
results = np.maximum(results, floor)
216217
#results[results < -10] = -10 # crop the z axis to some level of dB
217218
fig, ax = plt.subplots(subplot_kw={"projection": "3d", "computed_zorder": False})
218219
surf = ax.plot_surface(np.rad2deg(theta_scan[:,None]), # type: ignore

0 commit comments

Comments
 (0)